@@ -13,7 +13,7 @@ include(CheckIPOSupported)
13
13
include (CMakeDependentOption)
14
14
15
15
# Name chosen for compatibility with CTest.
16
- option (BUILD_TESTING "Build test programs as well as shims" ON )
16
+ option (SNMALLOC_BUILD_TESTING "Build test programs as well as shims" ON )
17
17
18
18
option (SNMALLOC_HEADER_ONLY_LIBRARY "Use snmalloc has a header-only library" OFF )
19
19
# Options that apply globally
@@ -288,7 +288,7 @@ if(NOT SNMALLOC_HEADER_ONLY_LIBRARY)
288
288
289
289
set (TESTDIR ${CMAKE_CURRENT_SOURCE_DIR} /src/test )
290
290
291
- if (BUILD_TESTING )
291
+ if (SNMALLOC_BUILD_TESTING )
292
292
enable_testing ()
293
293
subdirlist(TEST_CATEGORIES ${TESTDIR} )
294
294
else ()
@@ -448,7 +448,7 @@ if(NOT SNMALLOC_HEADER_ONLY_LIBRARY)
448
448
target_compile_definitions (snmallocshim-checks-rust PRIVATE SNMALLOC_CHECK_CLIENT)
449
449
endif ()
450
450
451
- if (BUILD_TESTING )
451
+ if (SNMALLOC_BUILD_TESTING )
452
452
if (WIN32
453
453
OR (CMAKE_SYSTEM_NAME STREQUAL NetBSD)
454
454
OR (CMAKE_SYSTEM_NAME STREQUAL OpenBSD)
@@ -496,7 +496,7 @@ if(NOT SNMALLOC_HEADER_ONLY_LIBRARY)
496
496
set (DEFINES "SNMALLOC_CHECK_CLIENT_MITIGATIONS=${MITIGATION} " )
497
497
add_shim(snmallocshim-${MITIGATION} SHARED ${SHIM_FILES} )
498
498
target_compile_definitions (snmallocshim-${MITIGATION} PRIVATE ${DEFINES} )
499
- if (BUILD_TESTING )
499
+ if (SNMALLOC_BUILD_TESTING )
500
500
make_tests(${MITIGATION} ${DEFINES} )
501
501
endif ()
502
502
endforeach ()
@@ -511,13 +511,15 @@ if(NOT SNMALLOC_HEADER_ONLY_LIBRARY)
511
511
set (DEFINES "-DSNMALLOC_CHECK_CLIENT_MITIGATIONS=${MITIGATIONSET} " )
512
512
add_shim(snmallocshim-${MITIGATIONNAME} SHARED ${SHIM_FILES} )
513
513
target_compile_definitions (snmallocshim-${MITIGATIONNAME} PRIVATE ${DEFINES} )
514
- if (BUILD_TESTING )
514
+ if (SNMALLOC_BUILD_TESTING )
515
515
make_tests(${MITIGATIONNAME} ${DEFINES} )
516
516
endif ()
517
517
endforeach ()
518
518
endif ()
519
519
520
- clangformat_targets()
520
+ if (SNMALLOC_BUILD_TESTING)
521
+ clangformat_targets()
522
+ endif ()
521
523
endif ()
522
524
523
525
install (TARGETS snmalloc EXPORT snmallocConfig)
0 commit comments