diff --git a/CMakeLists.txt b/CMakeLists.txt index e962c70a..d8524908 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -27,7 +27,6 @@ if (NOT EXISTS ${CMAKE_BINARY_DIR}/CMakeCache.txt AND NOT CMAKE_BUILD_TYPE) set(CMAKE_BUILD_TYPE "RelWithDebInfo" CACHE STRING "" FORCE) endif() - # # Features # @@ -284,6 +283,17 @@ if (NOT BUILD_SHARED_LIBS) ${genstatic-helper} ${slds}) + # The generated file will #include both manually written files in + # the source directory as well as files generated by chibi-ffi in + # the build directory. The latter can be found without special flags, + # as they are relative to the clib.c, but the preprocessor needs + # help for the former. As only clib.c needs this flag, we set it + # as locally as possible, i.e., not as a target property. + set_source_files_properties(${clibout} + PROPERTIES + INCLUDE_DIRECTORIES + ${CMAKE_CURRENT_SOURCE_DIR}) + target_compile_definitions(libchibi-scheme PUBLIC SEXP_USE_STATIC_LIBS=1) @@ -291,11 +301,6 @@ if (NOT BUILD_SHARED_LIBS) target_sources(libchibi-scheme PUBLIC ${clibout}) - - target_include_directories(libchibi-common - INTERFACE - $ - $) endif() # diff --git a/contrib/chibi-genstatic-helper.cmake b/contrib/chibi-genstatic-helper.cmake index abddb9d3..ff480ed4 100644 --- a/contrib/chibi-genstatic-helper.cmake +++ b/contrib/chibi-genstatic-helper.cmake @@ -16,7 +16,7 @@ if(NOT OUT) endif() execute_process( - COMMAND ${EXEC} ${GENSTATIC} --no-inline + COMMAND ${EXEC} -q -I ./lib ${GENSTATIC} --no-inline INPUT_FILE ${STUBS} OUTPUT_FILE ${OUT} RESULT_VARIABLE rr