summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2019-05-01 16:40:45 (GMT)
committerKitware Robot <kwrobot@kitware.com>2019-05-01 16:41:30 (GMT)
commit13b73ff65f2a6107f1257bac92df94fed31c25f8 (patch)
treeeaaf709e9f407bf454d954c2e5bf8a92559cf63a
parent34d67a24058477dfb0ec69faca7847dd6b1847be (diff)
parent01a4eec446496f52146949a959fab2f1fab6e654 (diff)
downloadCMake-13b73ff65f2a6107f1257bac92df94fed31c25f8.zip
CMake-13b73ff65f2a6107f1257bac92df94fed31c25f8.tar.gz
CMake-13b73ff65f2a6107f1257bac92df94fed31c25f8.tar.bz2
Merge topic 'iar-binutils'
01a4eec446 IAR: Changes required for Linux Acked-by: Kitware Robot <kwrobot@kitware.com> Merge-request: !3262
-rw-r--r--Modules/Compiler/IAR-FindBinUtils.cmake25
1 files changed, 14 insertions, 11 deletions
diff --git a/Modules/Compiler/IAR-FindBinUtils.cmake b/Modules/Compiler/IAR-FindBinUtils.cmake
index e8f5e6b..7fc6b59 100644
--- a/Modules/Compiler/IAR-FindBinUtils.cmake
+++ b/Modules/Compiler/IAR-FindBinUtils.cmake
@@ -2,7 +2,7 @@ if(NOT DEFINED _CMAKE_PROCESSING_LANGUAGE OR _CMAKE_PROCESSING_LANGUAGE STREQUAL
message(FATAL_ERROR "Internal error: _CMAKE_PROCESSING_LANGUAGE is not set")
endif()
-# Try to find tools in the same directory as Clang itself
+# Try to find tools in the same directory as the compiler itself
get_filename_component(__iar_hint_1 "${CMAKE_${_CMAKE_PROCESSING_LANGUAGE}_COMPILER}" REALPATH)
get_filename_component(__iar_hint_1 "${__iar_hint_1}" DIRECTORY)
@@ -12,20 +12,23 @@ set(__iar_hints "${__iar_hint_1}" "${__iar_hint_2}")
if("${CMAKE_${_CMAKE_PROCESSING_LANGUAGE}_COMPILER_ARCHITECTURE_ID}" STREQUAL "ARM" OR
"${CMAKE_${_CMAKE_PROCESSING_LANGUAGE}_COMPILER_ARCHITECTURE_ID}" STREQUAL "RX")
- # could allow using normal binutils ar, since objects are normal ELF files?
- find_program(CMAKE_IAR_LINKER ilink${CMAKE_${_CMAKE_PROCESSING_LANGUAGE}_COMPILER_ARCHITECTURE_ID}.exe HINTS ${__iar_hints}
+
+ string(TOLOWER "${CMAKE_${_CMAKE_PROCESSING_LANGUAGE}_COMPILER_ARCHITECTURE_ID}" _archid_lower)
+
+ # Find linker
+ find_program(CMAKE_IAR_LINKER ilink${_archid_lower} HINTS ${__iar_hints}
DOC "The IAR ILINK linker")
- find_program(CMAKE_IAR_ARCHIVE iarchive.exe HINTS ${__iar_hints}
+ find_program(CMAKE_IAR_ARCHIVE iarchive HINTS ${__iar_hints}
DOC "The IAR archiver")
- # find auxiliary tools
- find_program(CMAKE_IAR_ELFTOOL ielftool.exe HINTS ${__iar_hints}
+ # Find utility tools
+ find_program(CMAKE_IAR_ELFTOOL ielftool HINTS ${__iar_hints}
DOC "The IAR ELF Tool")
- find_program(CMAKE_IAR_ELFDUMP ielfdump${CMAKE_${_CMAKE_PROCESSING_LANGUAGE}_COMPILER_ARCHITECTURE_ID}.exe HINTS ${__iar_hints}
+ find_program(CMAKE_IAR_ELFDUMP ielfdump${_archid_lower} HINTS ${__iar_hints}
DOC "The IAR ELF Dumper")
- find_program(CMAKE_IAR_OBJMANIP iobjmanip.exe HINTS ${__iar_hints}
+ find_program(CMAKE_IAR_OBJMANIP iobjmanip HINTS ${__iar_hints}
DOC "The IAR ELF Object Tool")
- find_program(CMAKE_IAR_SYMEXPORT isymexport.exe HINTS ${__iar_hints}
+ find_program(CMAKE_IAR_SYMEXPORT isymexport HINTS ${__iar_hints}
DOC "The IAR Absolute Symbol Exporter")
mark_as_advanced(CMAKE_IAR_LINKER CMAKE_IAR_ARCHIVE CMAKE_IAR_ELFTOOL CMAKE_IAR_ELFDUMP CMAKE_IAR_OBJMANIP CMAKE_IAR_SYMEXPORT)
@@ -41,9 +44,9 @@ set(CMAKE_IAR_LINKER \"${CMAKE_IAR_LINKER}\")
elseif("${CMAKE_${_CMAKE_PROCESSING_LANGUAGE}_COMPILER_ARCHITECTURE_ID}" STREQUAL "AVR")
# For AVR and AVR32, IAR uses the "xlink" linker and the "xar" archiver:
- find_program(CMAKE_IAR_LINKER xlink.exe HINTS ${__iar_hints}
+ find_program(CMAKE_IAR_LINKER xlink HINTS ${__iar_hints}
DOC "The IAR XLINK linker")
- find_program(CMAKE_IAR_AR xar.exe HINTS ${__iar_hints}
+ find_program(CMAKE_IAR_AR xar HINTS ${__iar_hints}
DOC "The IAR archiver")
mark_as_advanced(CMAKE_IAR_LINKER CMAKE_IAR_AR)