From 9c22b7d1c221c52317a5455fa6aae88aaa94e7cf Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lukas=20B=C3=B6ger?= Date: Wed, 2 Jun 2021 22:35:48 +0100 Subject: [PATCH] comply with older CMake versions (dependency graph) --- CMakeLists.txt | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index cbbf07c4..10bfae4e 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -185,6 +185,17 @@ function(add_compiled_library cfile) PREFIX "") endfunction() +if(BUILD_SHARED_LIBS) + # This makes sure we only use the separate bootstrap executable for static + # builds. With dynamic linking, the default executable is fine. The dispatch + # is not a generator expression within the actual custom command to process + # the stubs, as older CMake versions fail to properly construct the dependency + # on the bootstrap executable from the generator expression. + set(bootstrap chibi-scheme) +else() + set(bootstrap chibi-scheme-bootstrap) +endif() + function(add_stubs_library stub) get_filename_component(stubdir ${stub} PATH) get_filename_component(basename ${stub} NAME_WE) @@ -197,10 +208,7 @@ function(add_stubs_library stub) add_custom_command(OUTPUT ${stubout} - # This makes sure we only use the separate bootstrap executable for static - # builds. With dynamic linking, the default executable is fine. - COMMAND $,chibi-scheme,chibi-scheme-bootstrap> - ${chibi-ffi} ${stubfile} ${stubout} + COMMAND ${bootstrap} ${chibi-ffi} ${stubfile} ${stubout} DEPENDS ${stubfile} ${chibi-ffi} WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR})