IAR: Use same executable suffix as try_compile

There was a mismatch in the executable suffix between the compiler
detection and try_compile. This resulted in the generated executable
having a different suffix than what try_compile was looking for.

The IAR module is changed to use the same suffix as try_compile.

Fixes: #22567
This commit is contained in:
Rainer Keller
2021-09-21 07:41:57 +02:00
parent 6261210a67
commit 9254e7ddf2

View File

@@ -41,7 +41,7 @@
include_guard()
macro(__compiler_iar_ilink lang)
set(CMAKE_EXECUTABLE_SUFFIX_${lang} ".elf")
set(CMAKE_EXECUTABLE_SUFFIX ".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>")
@@ -74,7 +74,7 @@ macro(__compiler_iar_ilink lang)
endmacro()
macro(__compiler_iar_xlink lang)
set(CMAKE_EXECUTABLE_SUFFIX_${lang} ".bin")
set(CMAKE_EXECUTABLE_SUFFIX ".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>")