diff --git a/CMakeLists.txt b/CMakeLists.txt index 43dc1ca7e..1a2d663b2 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,7 +1,7 @@ ##################################### # Define Project-Wide Settings ##################################### -cmake_minimum_required(VERSION 3.15.0 FATAL_ERROR) +cmake_minimum_required(VERSION 3.16.0 FATAL_ERROR) # Define the project name and language project(Crow @@ -92,7 +92,7 @@ if(CROW_BUILD_EXAMPLES) endif() # Tests -if(NOT MSVC AND CROW_BUILD_TESTS) +if(CROW_BUILD_TESTS) if(NOT "compression" IN_LIST CROW_FEATURES) message(STATUS "Compression tests are omitted. (Configure with CROW_FEATURES containing 'compression' to enable them)") endif() diff --git a/examples/CMakeLists.txt b/examples/CMakeLists.txt index 201bf15aa..28879b0cb 100644 --- a/examples/CMakeLists.txt +++ b/examples/CMakeLists.txt @@ -1,4 +1,4 @@ -cmake_minimum_required(VERSION 3.15) +cmake_minimum_required(VERSION 3.16) project(crow_examples) include(${CMAKE_SOURCE_DIR}/cmake/compiler_options.cmake) diff --git a/tests/CMakeLists.txt b/tests/CMakeLists.txt index e098a656a..eefc7f27c 100644 --- a/tests/CMakeLists.txt +++ b/tests/CMakeLists.txt @@ -1,4 +1,4 @@ -cmake_minimum_required(VERSION 3.15) +cmake_minimum_required(VERSION 3.16) project(crow_test) add_subdirectory(unittest) diff --git a/tests/img/CMakeLists.txt b/tests/img/CMakeLists.txt index b787acd6d..35c860f0b 100644 --- a/tests/img/CMakeLists.txt +++ b/tests/img/CMakeLists.txt @@ -1,3 +1,3 @@ -cmake_minimum_required(VERSION 3.15) +cmake_minimum_required(VERSION 3.16) file(COPY . DESTINATION ${CMAKE_CURRENT_BINARY_DIR}) diff --git a/tests/template/CMakeLists.txt b/tests/template/CMakeLists.txt index c9073671c..aa19afb19 100644 --- a/tests/template/CMakeLists.txt +++ b/tests/template/CMakeLists.txt @@ -1,4 +1,4 @@ -cmake_minimum_required(VERSION 3.15) +cmake_minimum_required(VERSION 3.16) project(template_test) set(PROJECT_INCLUDE_DIR diff --git a/tests/unittest/CMakeLists.txt b/tests/unittest/CMakeLists.txt index 5a9556a24..6a17f136a 100644 --- a/tests/unittest/CMakeLists.txt +++ b/tests/unittest/CMakeLists.txt @@ -1,4 +1,4 @@ -cmake_minimum_required(VERSION 3.15) +cmake_minimum_required(VERSION 3.16) project(crow_test) include(${CMAKE_SOURCE_DIR}/cmake/compiler_options.cmake) @@ -31,7 +31,13 @@ endif() add_executable(unittest ${TEST_SRCS}) target_include_directories(unittest PRIVATE include) target_link_libraries(unittest Crow::Crow) +target_precompile_headers(unittest PRIVATE include/catch.hpp) add_warnings_optimizations(unittest) +set_source_files_properties(src/catch.cpp + PROPERTIES + SKIP_PRECOMPILE_HEADERS ON +) + if("${CMAKE_CXX_COMPILER_ID}" STREQUAL "GNU") set_target_properties(unittest PROPERTIES COMPILE_FLAGS "--coverage -fprofile-arcs -ftest-coverage") diff --git a/tests/unittest/include/unittest.h b/tests/unittest/include/unittest.h index eb2a54ef5..67020d601 100644 --- a/tests/unittest/include/unittest.h +++ b/tests/unittest/include/unittest.h @@ -3,7 +3,6 @@ #define CROW_LOG_LEVEL 0 #define LOCALHOST_ADDRESS "127.0.0.1" -#include "catch.hpp" #include "crow.h" using namespace std;