Skip to content

Commit bdbdf7e

Browse files
Garrett Browneigendude
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 ad026fd commit bdbdf7e

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
@@ -34,19 +34,9 @@ endif ()
3434

3535
set(CMAKE_EXPORT_COMPILE_COMMANDS ON)
3636

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

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

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

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

0 commit comments

Comments
 (0)