mirror of
https://github.com/cuberite/SQLiteCpp.git
synced 2025-08-04 09:46:02 -04:00
Fix problems with MSVC 2017 and issue warnings for MSVC < 2015
This commit is contained in:
parent
be235ffa94
commit
f4c9aedf09
@ -30,6 +30,14 @@ if (MSVC)
|
||||
set(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} /MT")
|
||||
set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} /MTd")
|
||||
endif (SQLITECPP_BUILD_TESTS)
|
||||
# Handle the (partly supported) MSVC versions prior to 2015
|
||||
if (MSVC_TOOLSET_VERSION LESS 140)
|
||||
message(WARNING "--------------- MSVC < 2015 detected ---------------")
|
||||
message(WARNING "Visual Studio prior to 2015 is not fully supported." )
|
||||
message(WARNING "BLOB storage seems to be corrupted for the built-in" )
|
||||
message(WARNING "SQLite3 implementation." )
|
||||
message(WARNING "----------------------------------------------------")
|
||||
endif (MSVC_TOOLSET_VERSION LESS 140)
|
||||
else (MSVC)
|
||||
set(CPPLINT_ARG_OUTPUT "--output=eclipse")
|
||||
set(CPPCHECK_ARG_TEMPLATE "--template=gcc")
|
||||
@ -291,6 +299,14 @@ if (SQLITECPP_BUILD_TESTS)
|
||||
add_subdirectory(googletest)
|
||||
include_directories("${PROJECT_SOURCE_DIR}/googletest/googletest/include")
|
||||
|
||||
# Add definitions to keep googletest from making the compilation fail
|
||||
if (MSVC_TOOLSET_VERSION EQUAL 141)
|
||||
target_compile_definitions(gtest PUBLIC _SILENCE_TR1_NAMESPACE_DEPRECATION_WARNING)
|
||||
target_compile_definitions(gtest_main PUBLIC _SILENCE_TR1_NAMESPACE_DEPRECATION_WARNING)
|
||||
target_compile_definitions(gmock PUBLIC _SILENCE_TR1_NAMESPACE_DEPRECATION_WARNING)
|
||||
target_compile_definitions(gmock_main PUBLIC _SILENCE_TR1_NAMESPACE_DEPRECATION_WARNING)
|
||||
endif (MSVC_TOOLSET_VERSION EQUAL 141)
|
||||
|
||||
# add the unit test executable
|
||||
add_executable(SQLiteCpp_tests ${SQLITECPP_TESTS})
|
||||
target_link_libraries(SQLiteCpp_tests gtest_main SQLiteCpp sqlite3)
|
||||
|
Loading…
x
Reference in New Issue
Block a user