From 73fb6ac82bf4c9a203b879c6fee06b9c852cb0d6 Mon Sep 17 00:00:00 2001 From: Osama Moharam Date: Tue, 2 Jun 2020 14:17:26 +0200 Subject: ARMClang: Add support for armlink sets CMAKE_LIBRARY_PATH_FLAG to '--userlibpath=' when using armlink. Fixes: #20761 --- Modules/Compiler/ARMClang.cmake | 16 ++++++++++++++-- 1 file 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 " -o --list .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 " -o ${__CMAKE_ARMClang_USING_armlink_WRAPPER} --list .map") set(CMAKE_${lang}_CREATE_STATIC_LIBRARY " --create -cr ") set(CMAKE_${lang}_ARCHIVE_CREATE " --create -cr ") - 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() -- cgit v0.12