mirror of
https://github.com/ashinn/chibi-scheme.git
synced 2025-05-18 21:29:19 +02:00
fix paths of includes in clib.c
With the module search path cleverly handled with different install.h configurations, the genstatic script inserted absolute paths into the generated clib.c file. This didn't fail on Windows CI as this is an in-source build. For out-of-source builds, it's crucial that clib.c can refer to both .c files in the source directory and those generated in the build directory. As a fix, the genstatic invocation now uses the -I flag. This patch also improves the handling of include paths to find the .c. files mentioned above by trimming down the scope of this property to clib.c only. Also, there is no need to manually tell the preprocessor where to look for generated .c, as they live relative to clib.c anyhow.
This commit is contained in:
parent
7de835bad8
commit
e2555e5fed
2 changed files with 12 additions and 7 deletions
|
@ -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)
|
set(CMAKE_BUILD_TYPE "RelWithDebInfo" CACHE STRING "" FORCE)
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
|
|
||||||
#
|
#
|
||||||
# Features
|
# Features
|
||||||
#
|
#
|
||||||
|
@ -284,6 +283,17 @@ if (NOT BUILD_SHARED_LIBS)
|
||||||
${genstatic-helper}
|
${genstatic-helper}
|
||||||
${slds})
|
${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
|
target_compile_definitions(libchibi-scheme
|
||||||
PUBLIC
|
PUBLIC
|
||||||
SEXP_USE_STATIC_LIBS=1)
|
SEXP_USE_STATIC_LIBS=1)
|
||||||
|
@ -291,11 +301,6 @@ if (NOT BUILD_SHARED_LIBS)
|
||||||
target_sources(libchibi-scheme
|
target_sources(libchibi-scheme
|
||||||
PUBLIC
|
PUBLIC
|
||||||
${clibout})
|
${clibout})
|
||||||
|
|
||||||
target_include_directories(libchibi-common
|
|
||||||
INTERFACE
|
|
||||||
$<BUILD_INTERFACE:${stuboutdir}/..>
|
|
||||||
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}>)
|
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
#
|
#
|
||||||
|
|
|
@ -16,7 +16,7 @@ if(NOT OUT)
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
execute_process(
|
execute_process(
|
||||||
COMMAND ${EXEC} ${GENSTATIC} --no-inline
|
COMMAND ${EXEC} -q -I ./lib ${GENSTATIC} --no-inline
|
||||||
INPUT_FILE ${STUBS}
|
INPUT_FILE ${STUBS}
|
||||||
OUTPUT_FILE ${OUT}
|
OUTPUT_FILE ${OUT}
|
||||||
RESULT_VARIABLE rr
|
RESULT_VARIABLE rr
|
||||||
|
|
Loading…
Add table
Reference in a new issue