Skip to content

Commit a7a0a10

Browse files
committed
build: migrate to standard mechanism for testing
Use `CTest` module rather than the custom `ENABLE_TESTING` option. The inclusion of `CTest` will default `BUILD_TESTING` to true, which preserves the existing behaviour.
1 parent c023edd commit a7a0a10

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

CMakeLists.txt

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@ list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/cmake/modules")
66
project(dispatch
77
VERSION 1.3
88
LANGUAGES C CXX)
9-
enable_testing()
109

1110
if("${CMAKE_C_SIMULATE_ID}" STREQUAL "MSVC")
1211
include(ClangClCompileRules)
@@ -36,6 +35,7 @@ include(CheckLibraryExists)
3635
include(CheckSymbolExists)
3736
include(GNUInstallDirs)
3837
include(SwiftSupport)
38+
include(CTest)
3939

4040
set(SWIFT_LIBDIR "lib" CACHE PATH "Library folder name, defined by swift main buildscript")
4141
set(INSTALL_LIBDIR "${SWIFT_LIBDIR}" CACHE PATH "Path where the libraries should be installed")
@@ -86,8 +86,6 @@ option(DISPATCH_ENABLE_ASSERTS "enable debug assertions" FALSE)
8686

8787
option(ENABLE_DTRACE "enable dtrace support" "")
8888

89-
option(ENABLE_TESTING "build libdispatch tests" ON)
90-
9189
option(ENABLE_THREAD_LOCAL_STORAGE "enable usage of thread local storage via _Thread_local" ON)
9290
set(DISPATCH_USE_THREAD_LOCAL_STORAGE ${ENABLE_THREAD_LOCAL_STORAGE})
9391

@@ -286,7 +284,7 @@ add_subdirectory(man)
286284
add_subdirectory(os)
287285
add_subdirectory(private)
288286
add_subdirectory(src)
289-
if(ENABLE_TESTING)
287+
if(BUILD_TESTING)
290288
add_subdirectory(tests)
291289
endif()
292290

0 commit comments

Comments
 (0)