File tree 1 file changed +25
-3
lines changed
1 file changed +25
-3
lines changed Original file line number Diff line number Diff line change @@ -9,7 +9,15 @@ include(CheckCXXSourceCompiles)
9
9
include (CMakeCheckCompilerFlagCommonPatterns)
10
10
11
11
macro (CHECK_CXX_COMPILER_FLAG _FLAG _RESULT)
12
- set (SAFE_CMAKE_REQUIRED_DEFINITIONS "${CMAKE_REQUIRED_DEFINITIONS} " )
12
+ ## end copy ]]
13
+ set (cccf_do_save_crd false )
14
+ if (DEFINED CMAKE_REQUIRED_DEFINITIONS)
15
+ set (cccf_do_save_crd true )
16
+ ## begin copy [[
17
+ set (SAFE_CMAKE_REQUIRED_DEFINITIONS "${CMAKE_REQUIRED_DEFINITIONS} " )
18
+ ## end copy ]]
19
+ endif ()
20
+ ## begin copy [[
13
21
set (CMAKE_REQUIRED_DEFINITIONS "${_FLAG} " )
14
22
## end copy ]]
15
23
@@ -40,7 +48,13 @@ macro (CHECK_CXX_COMPILER_FLAG _FLAG _RESULT)
40
48
)
41
49
foreach (v ${_CheckCXXCompilerFlag_LOCALE_VARS} )
42
50
if (DEFINED _CheckCXXCompilerFlag_SAVED_${v} )
43
- set (ENV{${v} } ${${_CheckCXXCompilerFlag_SAVED_${v} }})
51
+ ## end copy ]]
52
+ if (DEFINED ${_CheckCXXCompilerFlag_SAVED_${v} })
53
+ ## begin copy [[
54
+ set (ENV{${v} } ${${_CheckCXXCompilerFlag_SAVED_${v} }})
55
+ ## end copy ]]
56
+ endif ()
57
+ ## begin copy [[
44
58
unset (_CheckCXXCompilerFlag_SAVED_${v} )
45
59
else ()
46
60
unset (ENV{${v} })
@@ -49,7 +63,15 @@ macro (CHECK_CXX_COMPILER_FLAG _FLAG _RESULT)
49
63
unset (_CheckCXXCompilerFlag_LOCALE_VARS)
50
64
unset (_CheckCXXCompilerFlag_COMMON_PATTERNS)
51
65
52
- set (CMAKE_REQUIRED_DEFINITIONS "${SAFE_CMAKE_REQUIRED_DEFINITIONS} " )
66
+ ## end copy ]]
67
+ if (cccf_do_save_crd)
68
+ ## begin copy [[
69
+ set (CMAKE_REQUIRED_DEFINITIONS "${SAFE_CMAKE_REQUIRED_DEFINITIONS} " )
70
+ ## end copy ]]
71
+ else ()
72
+ unset (CMAKE_REQUIRED_DEFINITIONS)
73
+ endif ()
74
+ ## begin copy [[
53
75
endmacro ()
54
76
## end copy ]]
55
77
You can’t perform that action at this time.
0 commit comments