summaryrefslogtreecommitdiffstats
path: root/Modules/Compiler
diff options
context:
space:
mode:
authorLorenzo Cappelletti <lorenzo.cappelletti@gmail.com>2021-07-19 08:29:48 (GMT)
committerBrad King <brad.king@kitware.com>2021-07-20 15:51:19 (GMT)
commit05a3bafe650ae7f567c50abbdf626fca9ac2b3df (patch)
tree3341540ddecc189bf187fc75501485998e6d7df8 /Modules/Compiler
parent91a904495a862f961fabccf1640f2cc3c1af137f (diff)
downloadCMake-05a3bafe650ae7f567c50abbdf626fca9ac2b3df.zip
CMake-05a3bafe650ae7f567c50abbdf626fca9ac2b3df.tar.gz
CMake-05a3bafe650ae7f567c50abbdf626fca9ac2b3df.tar.bz2
Compiler/IAR: Avoid clobbering CMAKE_EXECUTABLE_SUFFIX
Use `CMAKE_EXECUTABLE_SUFFIX_<LANG>` instead. Fixes: #22426
Diffstat (limited to 'Modules/Compiler')
-rw-r--r--Modules/Compiler/IAR.cmake4
1 files changed, 2 insertions, 2 deletions
diff --git a/Modules/Compiler/IAR.cmake b/Modules/Compiler/IAR.cmake
index 8bfc3ef..a6b436a 100644
--- a/Modules/Compiler/IAR.cmake
+++ b/Modules/Compiler/IAR.cmake
@@ -41,7 +41,7 @@
include_guard()
macro(__compiler_iar_ilink lang)
- set(CMAKE_EXECUTABLE_SUFFIX ".elf")
+ set(CMAKE_EXECUTABLE_SUFFIX_${lang} ".elf")
set(CMAKE_${lang}_OUTPUT_EXTENSION ".o")
if (${lang} STREQUAL "C" OR ${lang} STREQUAL "CXX")
set(CMAKE_${lang}_COMPILE_OBJECT "<CMAKE_${lang}_COMPILER> ${CMAKE_IAR_${lang}_FLAG} --silent <SOURCE> <DEFINES> <INCLUDES> <FLAGS> -o <OBJECT>")
@@ -77,7 +77,7 @@ macro(__compiler_iar_ilink lang)
endmacro()
macro(__compiler_iar_xlink lang)
- set(CMAKE_EXECUTABLE_SUFFIX ".bin")
+ set(CMAKE_EXECUTABLE_SUFFIX_${lang} ".bin")
if (${lang} STREQUAL "C" OR ${lang} STREQUAL "CXX")
set(CMAKE_${lang}_COMPILE_OBJECT "<CMAKE_${lang}_COMPILER> ${CMAKE_IAR_${lang}_FLAG} --silent <SOURCE> <DEFINES> <INCLUDES> <FLAGS> -o <OBJECT>")