cmake_policy(SET CMP0077 NEW)

This commit is contained in:
mutouyun 2021-08-15 13:43:10 +08:00
parent e47902d13b
commit 36717e6336
2 changed files with 6 additions and 3 deletions

View File

@ -13,7 +13,7 @@
option(
gtest_force_shared_crt
"Use shared (DLL) run-time lib even when Google Test is built as static lib."
ON)
OFF)
option(gtest_build_tests "Build all of gtest's own tests." OFF)
@ -59,6 +59,10 @@ if (POLICY CMP0063) # Visibility
cmake_policy(SET CMP0063 NEW)
endif (POLICY CMP0063)
if (POLICY CMP0077) # Visibility
cmake_policy(SET CMP0077 NEW)
endif (POLICY CMP0077)
if (COMMAND set_up_hermetic_build)
set_up_hermetic_build()
endif()

View File

@ -4,7 +4,7 @@ project(cpp-ipc)
option(LIBIPC_BUILD_TESTS "Build all of libipc's own tests." OFF)
option(LIBIPC_BUILD_DEMOS "Build all of libipc's own demos." OFF)
option(LIBIPC_BUILD_SHARED_LIBS "Build shared libraries (DLLs)." OFF)
option(LIBIPC_USE_STATIC_CRT "Set to ON to build with static CRT on Windows (/MT)." ON )
option(LIBIPC_USE_STATIC_CRT "Set to ON to build with static CRT on Windows (/MT)." OFF)
set(CMAKE_POSITION_INDEPENDENT_CODE ON)
set(CMAKE_CXX_STANDARD 17)
@ -38,7 +38,6 @@ add_subdirectory(src)
if (LIBIPC_BUILD_TESTS)
set(GOOGLETEST_VERSION 1.10.0)
set(CMAKE_POLICY_DEFAULT_CMP0077 NEW)
set(gtest_force_shared_crt $<NOT:$<BOOL:${LIBIPC_USE_STATIC_CRT}>>)
add_subdirectory(3rdparty/gtest)
add_subdirectory(test)