@@ -13,7 +13,7 @@ include(CheckIPOSupported)
1313include (CMakeDependentOption )
1414
1515# 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 )
1717
1818option (SNMALLOC_HEADER_ONLY_LIBRARY "Use snmalloc has a header-only library" OFF )
1919# Options that apply globally
@@ -288,7 +288,7 @@ if(NOT SNMALLOC_HEADER_ONLY_LIBRARY)
288288
289289 set (TESTDIR ${CMAKE_CURRENT_SOURCE_DIR } /src/test)
290290
291- if (BUILD_TESTING )
291+ if (SNMALLOC_BUILD_TESTING )
292292 enable_testing ()
293293 subdirlist (TEST_CATEGORIES ${TESTDIR} )
294294 else ()
@@ -448,7 +448,7 @@ if(NOT SNMALLOC_HEADER_ONLY_LIBRARY)
448448 target_compile_definitions (snmallocshim-checks-rust PRIVATE SNMALLOC_CHECK_CLIENT )
449449 endif ()
450450
451- if (BUILD_TESTING )
451+ if (SNMALLOC_BUILD_TESTING )
452452 if (WIN32
453453 OR (CMAKE_SYSTEM_NAME STREQUAL NetBSD)
454454 OR (CMAKE_SYSTEM_NAME STREQUAL OpenBSD)
@@ -496,7 +496,7 @@ if(NOT SNMALLOC_HEADER_ONLY_LIBRARY)
496496 set (DEFINES "SNMALLOC_CHECK_CLIENT_MITIGATIONS=${MITIGATION} " )
497497 add_shim (snmallocshim-${MITIGATION} SHARED ${SHIM_FILES} )
498498 target_compile_definitions (snmallocshim-${MITIGATION} PRIVATE ${DEFINES} )
499- if (BUILD_TESTING )
499+ if (SNMALLOC_BUILD_TESTING )
500500 make_tests (${MITIGATION} ${DEFINES} )
501501 endif ()
502502 endforeach ()
@@ -511,13 +511,15 @@ if(NOT SNMALLOC_HEADER_ONLY_LIBRARY)
511511 set (DEFINES "-DSNMALLOC_CHECK_CLIENT_MITIGATIONS=${MITIGATIONSET} " )
512512 add_shim (snmallocshim-${MITIGATIONNAME} SHARED ${SHIM_FILES} )
513513 target_compile_definitions (snmallocshim-${MITIGATIONNAME} PRIVATE ${DEFINES} )
514- if (BUILD_TESTING )
514+ if (SNMALLOC_BUILD_TESTING )
515515 make_tests (${MITIGATIONNAME} ${DEFINES} )
516516 endif ()
517517 endforeach ()
518518 endif ()
519519
520- clangformat_targets ()
520+ if (SNMALLOC_BUILD_TESTING)
521+ clangformat_targets ()
522+ endif ()
521523endif ()
522524
523525install (TARGETS snmalloc EXPORT snmallocConfig)
0 commit comments