diff options
author | Osama Moharam <osama.moharam.uw@renesas.com> | 2020-06-02 12:17:26 (GMT) |
---|---|---|
committer | Brad King <brad.king@kitware.com> | 2020-06-02 15:32:32 (GMT) |
commit | 73fb6ac82bf4c9a203b879c6fee06b9c852cb0d6 (patch) | |
tree | 887126d922fb49e5b090fd8743b6656aeafc5e6e /Modules | |
parent | a432b1075c8808c6e4c925d3f4d4ce94c5477bab (diff) | |
download | CMake-73fb6ac82bf4c9a203b879c6fee06b9c852cb0d6.zip CMake-73fb6ac82bf4c9a203b879c6fee06b9c852cb0d6.tar.gz CMake-73fb6ac82bf4c9a203b879c6fee06b9c852cb0d6.tar.bz2 |
ARMClang: Add support for armlink
sets CMAKE_LIBRARY_PATH_FLAG to '--userlibpath=' when using armlink.
Fixes: #20761
Diffstat (limited to 'Modules')
-rw-r--r-- | Modules/Compiler/ARMClang.cmake | 16 |
1 files changed, 14 insertions, 2 deletions
diff --git a/Modules/Compiler/ARMClang.cmake b/Modules/Compiler/ARMClang.cmake index 2518ac7..f0fdcd5 100644 --- a/Modules/Compiler/ARMClang.cmake +++ b/Modules/Compiler/ARMClang.cmake @@ -19,6 +19,13 @@ mark_as_advanced(CMAKE_ARMClang_LINKER) set(CMAKE_AR "${CMAKE_ARMClang_AR}" CACHE FILEPATH "The ARMClang archiver" FORCE) mark_as_advanced(CMAKE_ARMClang_AR) +if (CMAKE_LINKER MATCHES "armlink") + set(__CMAKE_ARMClang_USING_armlink TRUE) + set(CMAKE_LIBRARY_PATH_FLAG "--userlibpath=") +else() + set(__CMAKE_ARMClang_USING_armlink FALSE) +endif() + # get compiler supported cpu list function(__armclang_set_processor_list lang out_var) execute_process(COMMAND "${CMAKE_${lang}_COMPILER}" --target=${CMAKE_${lang}_COMPILER_TARGET} -mcpu=list @@ -60,10 +67,15 @@ macro(__compiler_armclang lang) string(APPEND CMAKE_${lang}_FLAGS_INIT "-mcpu=${CMAKE_SYSTEM_PROCESSOR}") string(APPEND CMAKE_${lang}_LINK_FLAGS "--cpu=${CMAKE_SYSTEM_PROCESSOR}") - set(CMAKE_${lang}_LINK_EXECUTABLE "<CMAKE_LINKER> <CMAKE_${lang}_LINK_FLAGS> <LINK_FLAGS> <LINK_LIBRARIES> <OBJECTS> -o <TARGET> --list <TARGET_BASE>.map") + if(__CMAKE_ARMClang_USING_armlink) + set(__CMAKE_ARMClang_USING_armlink_WRAPPER "") + else() + set(__CMAKE_ARMClang_USING_armlink_WRAPPER ${CMAKE_${lang}_LINKER_WRAPPER_FLAG}) + endif() + set(CMAKE_${lang}_LINK_EXECUTABLE "<CMAKE_LINKER> <CMAKE_${lang}_LINK_FLAGS> <LINK_FLAGS> <LINK_LIBRARIES> <OBJECTS> -o <TARGET> ${__CMAKE_ARMClang_USING_armlink_WRAPPER} --list <TARGET_BASE>.map") set(CMAKE_${lang}_CREATE_STATIC_LIBRARY "<CMAKE_AR> --create -cr <TARGET> <LINK_FLAGS> <OBJECTS>") set(CMAKE_${lang}_ARCHIVE_CREATE "<CMAKE_AR> --create -cr <TARGET> <LINK_FLAGS> <OBJECTS>") - set(CMAKE_${lang}_RESPONSE_FILE_LINK_FLAG "--via=") + set(CMAKE_${lang}_RESPONSE_FILE_LINK_FLAG "${__CMAKE_ARMClang_USING_armlink_WRAPPER} --via=") set(CMAKE_${lang}_OUTPUT_EXTENSION ".o") set(CMAKE_${lang}_OUTPUT_EXTENSION_REPLACE 1) endmacro() |