From 01e944128dba13fd68167edcb4a45704e80658e9 Mon Sep 17 00:00:00 2001 From: Felipe Torrezan Date: Wed, 19 Apr 2023 12:55:25 +0200 Subject: IAR: Move linker silencing flag to CMAKE_EXE_LINKER_FLAGS The IAR linker silencer flag was previously hardcoded in `CMAKE_${lang}_LINKER_EXECUTABLE`. Move the flag to a place that is under the end user's control. The default behavior (silenced linker) is not changed. Fixes: #24828 --- Modules/Compiler/IAR.cmake | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/Modules/Compiler/IAR.cmake b/Modules/Compiler/IAR.cmake index 0aca283..32a7b3f5 100644 --- a/Modules/Compiler/IAR.cmake +++ b/Modules/Compiler/IAR.cmake @@ -1,6 +1,6 @@ # This file is processed when the IAR C/C++ Compiler is used # -# CPU supported in CMake: 8051, Arm, AVR, MSP430, RH850, RISC-V, RL78, RX and V850 +# CPU supported in CMake: 8051, Arm, AVR, MSP430, RH850, RISC-V, RL78, RX, STM8 and V850 # # The compiler user documentation is architecture-dependent # and it can found with the product installation under /doc/{EW,BX}_DevelopmentGuide.ENU.pdf @@ -35,7 +35,9 @@ macro(__compiler_iar_ilink lang) __compiler_iar_common(${lang}) - set(CMAKE_${lang}_LINK_EXECUTABLE " --silent -o ") + string(APPEND CMAKE_EXE_LINKER_FLAGS_INIT " --silent") + set(CMAKE_${lang}_LINK_EXECUTABLE " -o ") + set(CMAKE_${lang}_CREATE_STATIC_LIBRARY " --create ") set(CMAKE_${lang}_ARCHIVE_CREATE " --create ") set(CMAKE_${lang}_ARCHIVE_APPEND " --replace ") @@ -46,7 +48,9 @@ macro(__compiler_iar_xlink lang) __compiler_iar_common(${lang}) - set(CMAKE_${lang}_LINK_EXECUTABLE " -S -o ") + string(APPEND CMAKE_EXE_LINKER_FLAGS_INIT " -S") + set(CMAKE_${lang}_LINK_EXECUTABLE " -o ") + set(CMAKE_${lang}_CREATE_STATIC_LIBRARY " ") set(CMAKE_${lang}_ARCHIVE_CREATE " ") set(CMAKE_${lang}_ARCHIVE_APPEND "") -- cgit v0.12