Skip to content

Commit a2d7c7c

Browse files
eigendudegarbear
authored andcommitted
CMake: Expose CMake options to includes
This change shuffles the order of several CMake steps to expose CMake options to included files. By defining options before inclusion, included files are able to access the input provided by the build system.
1 parent 8fb01b2 commit a2d7c7c

File tree

1 file changed

+9
-10
lines changed

1 file changed

+9
-10
lines changed

CMakeLists.txt

Lines changed: 9 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -35,19 +35,9 @@ endif ()
3535

3636
set(CMAKE_EXPORT_COMPILE_COMMANDS ON)
3737

38-
include(CheckCXXCompilerFlag)
39-
include(cmake/toolchain-util.cmake)
40-
include(cmake/dependencies.cmake)
41-
include(cmake/functions.cmake)
42-
include(cmake/san.cmake)
43-
4438
# export compile commands for clang-tidy to analyse only changed files
4539
set(CMAKE_EXPORT_COMPILE_COMMANDS ON)
4640

47-
print("C flags: ${CMAKE_C_FLAGS}")
48-
print("CXX flags: ${CMAKE_CXX_FLAGS}")
49-
print("Using CMAKE_TOOLCHAIN_FILE=${CMAKE_TOOLCHAIN_FILE}")
50-
5141
option(TESTING "Build tests" ON)
5242
option(TESTING_PROOFS "Build proofs tests" OFF)
5343
option(TESTING_ACTORS "Build actors tests" OFF)
@@ -61,6 +51,15 @@ option(MSAN "Enable memory sanitizer" OFF)
6151
option(TSAN "Enable thread sanitizer" OFF)
6252
option(UBSAN "Enable UB sanitizer" OFF)
6353

54+
include(CheckCXXCompilerFlag)
55+
include(cmake/toolchain-util.cmake)
56+
include(cmake/dependencies.cmake)
57+
include(cmake/functions.cmake)
58+
include(cmake/san.cmake)
59+
60+
print("C flags: ${CMAKE_C_FLAGS}")
61+
print("CXX flags: ${CMAKE_CXX_FLAGS}")
62+
print("Using CMAKE_TOOLCHAIN_FILE=${CMAKE_TOOLCHAIN_FILE}")
6463

6564
## setup compilation flags
6665
if ("${CMAKE_CXX_COMPILER_ID}" MATCHES "^(AppleClang|Clang|GNU)$")

0 commit comments

Comments
 (0)