From 699ffe18e9a860faeafa39d1e08bdd7af8ad9b7e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lukas=20B=C3=B6ger?= Date: Tue, 6 Jul 2021 10:15:33 +0100 Subject: [PATCH] mostly revert module path handling introduced in 27c421e3 chibi/install.h is included in C source files, and providing a different install.h upon actual installation is inconsistent and dangerous. When working with a chibi executable within the build tree (i.e., not an installed executable), the CHIBI_MODULE_PATH environment tweak can be used to not always specify -I paths on the command line. --- CMakeLists.txt | 23 +++++++---------------- 1 file changed, 7 insertions(+), 16 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index b092c5d5..f64ce6cb 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -342,16 +342,6 @@ string(JOIN ":" default_module_path ${CMAKE_INSTALL_FULL_DATAROOTDIR}/snow ${CMAKE_INSTALL_FULL_LIBDIR}/snow) -# This file will only be used during an installation (and renamed to install.h) -configure_file(include/chibi/install.h.in include/chibi/to-install.h) - -# This configuration is for development purpose: a chibi executable shall find -# both compiled libraries in its own build directory and scheme source libraries -# in the source directory. -string(JOIN ":" default_module_path - ${CMAKE_CURRENT_BINARY_DIR}/lib - ${CMAKE_CURRENT_SOURCE_DIR}/lib) - configure_file(include/chibi/install.h.in include/chibi/install.h) # @@ -368,12 +358,12 @@ set(chibi-scheme-tests foreach(e ${chibi-scheme-tests}) add_test(NAME "${e}" - COMMAND chibi-scheme tests/${e}.scm + COMMAND chibi-scheme -I ${CMAKE_CURRENT_BINARY_DIR}/lib tests/${e}.scm WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}) endforeach() add_test(NAME r5rs-test - COMMAND chibi-scheme -xchibi tests/r5rs-tests.scm + COMMAND chibi-scheme -I ${CMAKE_CURRENT_BINARY_DIR}/lib -xchibi tests/r5rs-tests.scm WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}) file(GLOB_RECURSE srfi_tests RELATIVE ${CMAKE_CURRENT_SOURCE_DIR}/lib @@ -418,7 +408,9 @@ foreach(e ${testlibs}) string(REGEX REPLACE "/" "_" testname ${e}) string(REGEX REPLACE "/" " " form ${e}) add_test(NAME "lib_${testname}" - COMMAND chibi-scheme -e "(import (${form}))" -e "(run-tests)" + COMMAND chibi-scheme -I ${CMAKE_CURRENT_BINARY_DIR}/lib + -e "(import (${form}))" + -e "(run-tests)" WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}) endforeach() @@ -456,9 +448,8 @@ install(DIRECTORY include/chibi PATTERN "sexp-*.[hc]" EXCLUDE PATTERN "*.h.in" EXCLUDE) -install(FILES ${CMAKE_CURRENT_BINARY_DIR}/include/chibi/to-install.h - DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/chibi - RENAME install.h) +install(FILES ${CMAKE_CURRENT_BINARY_DIR}/include/chibi/install.h + DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/chibi) add_library(chibi::chibi ALIAS libchibi-scheme)