mirror of
https://github.com/ashinn/chibi-scheme.git
synced 2025-05-19 05:39:18 +02:00
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.
27 lines
448 B
CMake
27 lines
448 B
CMake
#
|
|
# chibi-genstatic-helper.cmake
|
|
#
|
|
# INPUT:
|
|
# ROOT=<DIR>
|
|
# EXEC=<EXECUTABLE>
|
|
# GENSTATIC=<FILE>
|
|
# STUBS=<FILE>
|
|
# OUT=<FILE>
|
|
if(NOT EXEC)
|
|
message(FATAL_ERROR "huh?")
|
|
endif()
|
|
|
|
if(NOT OUT)
|
|
message(FATAL_ERROR "huh?")
|
|
endif()
|
|
|
|
execute_process(
|
|
COMMAND ${EXEC} -q -I ./lib ${GENSTATIC} --no-inline
|
|
INPUT_FILE ${STUBS}
|
|
OUTPUT_FILE ${OUT}
|
|
RESULT_VARIABLE rr
|
|
)
|
|
|
|
if(rr)
|
|
message(FATAL_ERROR "Error: ${rr}")
|
|
endif()
|