summaryrefslogtreecommitdiffstats
path: root/Modules/Compiler
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2022-01-31 15:31:24 (GMT)
committerKitware Robot <kwrobot@kitware.com>2022-01-31 15:31:31 (GMT)
commit803578496781e13b13662d55e8308b0508e4033a (patch)
tree35a51a9c5bcbae30fe4345f228d54960d8cf94c9 /Modules/Compiler
parentd3006c0ca79f502f026d9b1b36cacac8e60b933b (diff)
parentcc4da8d13a93e2ad1de22144ac6c7dd3c97e1f03 (diff)
downloadCMake-803578496781e13b13662d55e8308b0508e4033a.zip
CMake-803578496781e13b13662d55e8308b0508e4033a.tar.gz
CMake-803578496781e13b13662d55e8308b0508e4033a.tar.bz2
Merge topic 'iar_cmp0057'
cc4da8d13a IAR/CXX: Fix compatibility with CMP0057 OLD Acked-by: Kitware Robot <kwrobot@kitware.com> Merge-request: !6921
Diffstat (limited to 'Modules/Compiler')
-rw-r--r--Modules/Compiler/IAR-CXX.cmake9
1 files changed, 6 insertions, 3 deletions
diff --git a/Modules/Compiler/IAR-CXX.cmake b/Modules/Compiler/IAR-CXX.cmake
index a3f1dbc..7df74ad 100644
--- a/Modules/Compiler/IAR-CXX.cmake
+++ b/Modules/Compiler/IAR-CXX.cmake
@@ -16,14 +16,17 @@ endif()
# Whenever needed, override this default behavior using CMAKE_IAR_CXX_FLAG in your toolchain file.
if(NOT CMAKE_IAR_CXX_FLAG)
- set(_CMAKE_IAR_MODERNCXX_LIST 14 17)
- if(${CMAKE_CXX_STANDARD_COMPUTED_DEFAULT} IN_LIST _CMAKE_IAR_MODERNCXX_LIST OR
+ cmake_policy(PUSH)
+ cmake_policy(SET CMP0057 NEW) # if IN_LIST
+
+ if(${CMAKE_CXX_STANDARD_COMPUTED_DEFAULT} IN_LIST "14;17" OR
("${CMAKE_CXX_COMPILER_ARCHITECTURE_ID}" STREQUAL "ARM" AND ${CMAKE_CXX_STANDARD_COMPUTED_DEFAULT} EQUAL 98))
string(PREPEND CMAKE_CXX_FLAGS "--c++ ")
else()
string(PREPEND CMAKE_CXX_FLAGS "--eec++ ")
endif()
- unset(_CMAKE_IAR_MODERNCXX_LIST)
+
+ cmake_policy(POP)
endif()
set(CMAKE_CXX_STANDARD_COMPILE_OPTION "")