mirror of
https://github.com/fmtlib/fmt.git
synced 2024-11-22 10:30:05 +00:00
move gtest-specific check into gtest/CMakeLists.txt
This commit is contained in:
parent
ef72b471fc
commit
223a0fa55d
@ -8,13 +8,6 @@ target_link_libraries(test-main gtest)
|
|||||||
|
|
||||||
include(CheckCXXCompilerFlag)
|
include(CheckCXXCompilerFlag)
|
||||||
|
|
||||||
# Workaround GTest bug https://github.com/google/googletest/issues/705.
|
|
||||||
check_cxx_compiler_flag(
|
|
||||||
-fno-delete-null-pointer-checks HAVE_FNO_DELETE_NULL_POINTER_CHECKS)
|
|
||||||
if (HAVE_FNO_DELETE_NULL_POINTER_CHECKS)
|
|
||||||
target_compile_options(test-main PUBLIC -fno-delete-null-pointer-checks)
|
|
||||||
endif ()
|
|
||||||
|
|
||||||
# Use less strict pedantic flags for the tests because GMock doesn't compile
|
# Use less strict pedantic flags for the tests because GMock doesn't compile
|
||||||
# cleanly with -pedantic and -std=c++98.
|
# cleanly with -pedantic and -std=c++98.
|
||||||
if (CMAKE_COMPILER_IS_GNUCXX OR (CMAKE_CXX_COMPILER_ID MATCHES "Clang"))
|
if (CMAKE_COMPILER_IS_GNUCXX OR (CMAKE_CXX_COMPILER_ID MATCHES "Clang"))
|
||||||
|
@ -17,6 +17,13 @@ else ()
|
|||||||
target_compile_definitions(gtest PUBLIC GTEST_HAS_PTHREAD=0)
|
target_compile_definitions(gtest PUBLIC GTEST_HAS_PTHREAD=0)
|
||||||
endif ()
|
endif ()
|
||||||
|
|
||||||
|
# Workaround GTest bug https://github.com/google/googletest/issues/705.
|
||||||
|
check_cxx_compiler_flag(
|
||||||
|
-fno-delete-null-pointer-checks HAVE_FNO_DELETE_NULL_POINTER_CHECKS)
|
||||||
|
if (HAVE_FNO_DELETE_NULL_POINTER_CHECKS)
|
||||||
|
target_compile_options(gtest PUBLIC -fno-delete-null-pointer-checks)
|
||||||
|
endif ()
|
||||||
|
|
||||||
if (MSVC)
|
if (MSVC)
|
||||||
# Disable MSVC warnings of _CRT_INSECURE_DEPRECATE functions.
|
# Disable MSVC warnings of _CRT_INSECURE_DEPRECATE functions.
|
||||||
target_compile_definitions(gtest PRIVATE _CRT_SECURE_NO_WARNINGS)
|
target_compile_definitions(gtest PRIVATE _CRT_SECURE_NO_WARNINGS)
|
||||||
|
Loading…
Reference in New Issue
Block a user