summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKenneth Soerensen <knnthsrsn@gmail.com>2022-03-08 09:28:49 (GMT)
committerBrad King <brad.king@kitware.com>2022-03-08 14:34:48 (GMT)
commitbd3e23a605fa940aa91c9bc71b89d9d283af5515 (patch)
treeb72e5db493412d14d7f69384cb3df7bede1a451a
parent130c9889825f06dacb3453f6ee6ebc3b7e3d914a (diff)
downloadCMake-bd3e23a605fa940aa91c9bc71b89d9d283af5515.zip
CMake-bd3e23a605fa940aa91c9bc71b89d9d283af5515.tar.gz
CMake-bd3e23a605fa940aa91c9bc71b89d9d283af5515.tar.bz2
IAR: Fix detection of modern C++ version
The change in commit cc4da8d13a (IAR/CXX: Fix compatibility with CMP0057 OLD, 2022-01-29, v3.23.0-rc1~46^2) broke the detection of C++ version because the `IN_LIST` operator cannot work directly on a list but requires a variable.
-rw-r--r--Modules/Compiler/IAR-CXX.cmake4
1 files changed, 3 insertions, 1 deletions
diff --git a/Modules/Compiler/IAR-CXX.cmake b/Modules/Compiler/IAR-CXX.cmake
index 7df74ad..6c15735 100644
--- a/Modules/Compiler/IAR-CXX.cmake
+++ b/Modules/Compiler/IAR-CXX.cmake
@@ -19,12 +19,14 @@ if(NOT CMAKE_IAR_CXX_FLAG)
cmake_policy(PUSH)
cmake_policy(SET CMP0057 NEW) # if IN_LIST
- if(${CMAKE_CXX_STANDARD_COMPUTED_DEFAULT} IN_LIST "14;17" OR
+ set(_CMAKE_IAR_MODERNCXX_LIST 14 17)
+ if(${CMAKE_CXX_STANDARD_COMPUTED_DEFAULT} IN_LIST _CMAKE_IAR_MODERNCXX_LIST 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()