From c0f338fba3435a0d5219ae4591c27647d7477781 Mon Sep 17 00:00:00 2001 From: ruben Date: Thu, 2 Apr 2020 20:01:39 +0100 Subject: [PATCH] Trying to make Appveyor link --- CMakeLists.txt | 2 +- examples/CMakeLists.txt | 2 +- test/CMakeLists.txt | 3 ++- 3 files changed, 4 insertions(+), 3 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 01102ebc..cf351479 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -11,7 +11,7 @@ endif() # Utility function to set warnings and other compile properties of # our test targets -function(_mysql_set_target_warnings TARGET_NAME) +function(_mysql_common_target_settings TARGET_NAME) if(MSVC) target_compile_definitions(${TARGET_NAME} PRIVATE _CRT_SECURE_NO_WARNINGS _WIN32_WINNT=0x0601) target_link_directories(${TARGET_NAME} PRIVATE ${Boost_LIBRARY_DIRS}) diff --git a/examples/CMakeLists.txt b/examples/CMakeLists.txt index 3353e973..3eabe98e 100644 --- a/examples/CMakeLists.txt +++ b/examples/CMakeLists.txt @@ -12,7 +12,7 @@ function (_mysql_add_example EXECUTABLE_NAME CPPFILE) mysql_asio Boost::coroutine ) - _mysql_set_target_warnings(${EXECUTABLE_NAME}) + _mysql_common_target_settings(${EXECUTABLE_NAME}) endfunction() set(MYSQL_EXAMPLES diff --git a/test/CMakeLists.txt b/test/CMakeLists.txt index e7a5bc23..c5979661 100644 --- a/test/CMakeLists.txt +++ b/test/CMakeLists.txt @@ -9,6 +9,7 @@ FetchContent_Declare( FetchContent_GetProperties(googletest) if(NOT googletest_POPULATED) FetchContent_Populate(googletest) + set(gtest_force_shared_crt ON CACHE BOOL "" FORCE) # Avoid GTest linking against wrong CRT add_subdirectory(${googletest_SOURCE_DIR} ${googletest_BINARY_DIR}) endif() @@ -51,7 +52,7 @@ target_link_libraries( gmock mysql_asio ) -_mysql_set_target_warnings(mysql_unittests) +_mysql_common_target_settings(mysql_unittests) add_test( NAME mysql_unittests COMMAND ${CMAKE_CURRENT_BINARY_DIR}/mysql_unittests