diff options
author | Tiger Wang <ziwei.tiger@outlook.com> | 2020-05-16 21:59:10 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-05-16 21:59:10 +0200 |
commit | 9e8598fb1ca359143600d6bb2e8b317126a86bcc (patch) | |
tree | 677c51b708937ee8fbcdb2da8e180e874878d77a /tests/OSSupport | |
parent | Travis: Fix ccache on debug builds (#4741) (diff) | |
download | cuberite-9e8598fb1ca359143600d6bb2e8b317126a86bcc.tar cuberite-9e8598fb1ca359143600d6bb2e8b317126a86bcc.tar.gz cuberite-9e8598fb1ca359143600d6bb2e8b317126a86bcc.tar.bz2 cuberite-9e8598fb1ca359143600d6bb2e8b317126a86bcc.tar.lz cuberite-9e8598fb1ca359143600d6bb2e8b317126a86bcc.tar.xz cuberite-9e8598fb1ca359143600d6bb2e8b317126a86bcc.tar.zst cuberite-9e8598fb1ca359143600d6bb2e8b317126a86bcc.zip |
Diffstat (limited to 'tests/OSSupport')
-rw-r--r-- | tests/OSSupport/CMakeLists.txt | 45 |
1 files changed, 19 insertions, 26 deletions
diff --git a/tests/OSSupport/CMakeLists.txt b/tests/OSSupport/CMakeLists.txt index 60c68c472..9d481ce09 100644 --- a/tests/OSSupport/CMakeLists.txt +++ b/tests/OSSupport/CMakeLists.txt @@ -1,36 +1,29 @@ -cmake_minimum_required(VERSION 3.0.2) -enable_testing() - +find_package(Threads REQUIRED) include_directories(${CMAKE_SOURCE_DIR}/src/) -add_definitions(-DTEST_GLOBALS=1) - # Create a single OSSupport library that contains all the OSSupport code used in the tests: -# Only needed for Windows; Linux already defines the OSSupport lib -if (WIN32) - set (OSSupport_SRCS - ${CMAKE_SOURCE_DIR}/src/OSSupport/CriticalSection.cpp - ${CMAKE_SOURCE_DIR}/src/OSSupport/Event.cpp - ${CMAKE_SOURCE_DIR}/src/StringUtils.cpp - ) - set (OSSupport_HDRS - ${CMAKE_SOURCE_DIR}/src/OSSupport/CriticalSection.h - ${CMAKE_SOURCE_DIR}/src/OSSupport/Event.h - ${CMAKE_SOURCE_DIR}/src/StringUtils.h - ${CMAKE_SOURCE_DIR}/src/Globals.h - ) - add_library(OSSupport - ${OSSupport_SRCS} - ${OSSupport_HDRS} - ) - target_link_libraries(OSSupport PUBLIC fmt::fmt) -endif() +set (OSSupport_SRCS + ${CMAKE_SOURCE_DIR}/src/OSSupport/CriticalSection.cpp + ${CMAKE_SOURCE_DIR}/src/OSSupport/Event.cpp + ${CMAKE_SOURCE_DIR}/src/StringUtils.cpp +) +set (OSSupport_HDRS + ${CMAKE_SOURCE_DIR}/src/OSSupport/CriticalSection.h + ${CMAKE_SOURCE_DIR}/src/OSSupport/Event.h + ${CMAKE_SOURCE_DIR}/src/StringUtils.h + ${CMAKE_SOURCE_DIR}/src/Globals.h +) +add_library(OSSupport + ${OSSupport_SRCS} + ${OSSupport_HDRS} +) +target_link_libraries(OSSupport PUBLIC fmt::fmt) # Define individual tests: # StressEvent: Stress-test the cEvent implementation: add_executable(StressEvent-exe StressEvent.cpp) -target_link_libraries(StressEvent-exe OSSupport fmt::fmt) +target_link_libraries(StressEvent-exe OSSupport fmt::fmt Threads::Threads) add_test(NAME StressEvent-test COMMAND StressEvent-exe) @@ -42,7 +35,7 @@ set_target_properties( ) set_target_properties( OSSupport - PROPERTIES FOLDER Lib + PROPERTIES FOLDER Tests/Libraries ) |