-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathCMakeLists.txt
62 lines (51 loc) · 1.52 KB
/
CMakeLists.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
#
# project: fips-googletest
#
if (NOT FIPS_IMPORT)
cmake_minimum_required(VERSION 2.8)
# include the fips main cmake file
get_filename_component(FIPS_ROOT_DIR "../fips" ABSOLUTE)
include("${FIPS_ROOT_DIR}/cmake/fips.cmake")
fips_setup(PROJECT fips-googletest)
endif()
fips_begin_lib(googletest)
fips_include_directories(googletest/googletest)
fips_dir(googletest/googletest/src)
fips_files(
gtest.cc
gtest-death-test.cc
gtest-filepath.cc
gtest-port.cc
gtest-printers.cc
gtest-test-part.cc
gtest-typed-test.cc
gtest_main.cc
)
fips_end_lib()
if (NOT FIPS_EXCEPTIONS)
add_definitions(-DGTEST_HAS_EXCEPTIONS=0)
set(GOOGLETEST_NO_EXCEPTIONS "-fno-exceptions")
else()
add_definitions(-DGTEST_HAS_EXCEPTIONS=1)
endif()
if (NOT FIPS_RTTI)
add_definitions(-DGTEST_HAS_RTTI=0)
set(GOOGLETEST_NO_RTTI "-fno-rtti")
else()
add_definitions(-DGTEST_HAS_RTTI=1)
endif()
if (FIPS_CLANG)
set_target_properties(googletest PROPERTIES COMPILE_FLAGS "${GOOGLETEST_NO_EXCEPTIONS} ${GOOGLETEST_NO_RTTI}")
elseif(FIPS_GCC)
set_target_properties(googletest PROPERTIES COMPILE_FLAGS "${GOOGLETEST_NO_EXCEPTIONS} ${GOOGLETEST_NO_RTTI}")
elseif(FIPS_MSVC)
if (NOT FIPS_EXCEPTIONS)
string(REPLACE "/EHsc" "" CMAKE_CXX_FLAGS ${CMAKE_CXX_FLAGS}) # -fno-exceptions
endif()
if (NOT FIPS_RTTI)
string(REPLACE "/GR" "" CMAKE_CXX_FLAGS ${CMAKE_CXX_FLAGS}) # -fno-rtti
endif()
endif()
if (NOT FIPS_IMPORT)
fips_finish()
endif()