From ac36da8e970d04bf41b645f2afdb33264068480f Mon Sep 17 00:00:00 2001 From: The-EDev Date: Tue, 28 Sep 2021 00:50:26 +0300 Subject: [PATCH] Updated ssl_test CMake config to match revamped_setup --- tests/CMakeLists.txt | 4 +++- tests/ssl/CMakeLists.txt | 16 ++++++++++------ tests/ssl/ssltest.cpp | 1 - 3 files changed, 13 insertions(+), 8 deletions(-) diff --git a/tests/CMakeLists.txt b/tests/CMakeLists.txt index a62ee6fc5..76ae0a7e5 100644 --- a/tests/CMakeLists.txt +++ b/tests/CMakeLists.txt @@ -17,5 +17,7 @@ if("${CMAKE_CXX_COMPILER_ID}" STREQUAL "GNU") endif() add_subdirectory(template) -add_subdirectory(ssl) +if (CROW_ENABLE_SSL) + add_subdirectory(ssl) +endif() add_subdirectory(img) diff --git a/tests/ssl/CMakeLists.txt b/tests/ssl/CMakeLists.txt index 571c35f18..07c6c5e36 100644 --- a/tests/ssl/CMakeLists.txt +++ b/tests/ssl/CMakeLists.txt @@ -1,14 +1,18 @@ cmake_minimum_required(VERSION 3.15) -project (ssl_test) +project (crow_ssl_test) -set(PROJECT_INCLUDE_DIR - ${PROJECT_SOURCE_DIR}/include -) +include(${CMAKE_SOURCE_DIR}/cmake/compiler_options.cmake) set(TEST_SRCS ssltest.cpp ) add_executable(ssltest ${TEST_SRCS}) -target_link_libraries(ssltest ${Boost_LIBRARIES} ${CMAKE_THREAD_LIBS_INIT} ${OPENSSL_LIBRARIES} z) -target_compile_options(ssltest PRIVATE "${compiler_options}") +target_link_libraries(ssltest Crow::Crow) +add_warnings_optimizations(ssltest) + +if("${CMAKE_CXX_COMPILER_ID}" STREQUAL "GNU") + set_target_properties(ssltest PROPERTIES COMPILE_FLAGS "--coverage -fprofile-arcs -ftest-coverage") + target_link_libraries(ssltest gcov) +endif() + diff --git a/tests/ssl/ssltest.cpp b/tests/ssl/ssltest.cpp index 32e10661b..901d2b855 100644 --- a/tests/ssl/ssltest.cpp +++ b/tests/ssl/ssltest.cpp @@ -1,4 +1,3 @@ -#define CROW_ENABLE_SSL #define CATCH_CONFIG_MAIN #define CROW_LOG_LEVEL 0 #define CROW_MAIN