summaryrefslogtreecommitdiffstats
path: root/Modules/Compiler
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2021-07-14 14:06:19 (GMT)
committerKitware Robot <kwrobot@kitware.com>2021-07-14 14:06:29 (GMT)
commitf166d3257661a627cfa4a21fa80057d027b8658f (patch)
tree5cfaa4f1bc34e3ec6d43d7be7d51122673f4708a /Modules/Compiler
parent89039dfed878c701c675627bbd33ea737d8415e0 (diff)
parent509ef50a06fd690a85ca245a7221d001a3d6937f (diff)
downloadCMake-f166d3257661a627cfa4a21fa80057d027b8658f.zip
CMake-f166d3257661a627cfa4a21fa80057d027b8658f.tar.gz
CMake-f166d3257661a627cfa4a21fa80057d027b8658f.tar.bz2
Merge topic 'armlink_armar_detection'
509ef50a06 ARMClang: Fix regression in check for working compiler Acked-by: Kitware Robot <kwrobot@kitware.com> Merge-request: !6346
Diffstat (limited to 'Modules/Compiler')
-rw-r--r--Modules/Compiler/ARMClang.cmake17
1 files changed, 6 insertions, 11 deletions
diff --git a/Modules/Compiler/ARMClang.cmake b/Modules/Compiler/ARMClang.cmake
index 354c11d..c839220 100644
--- a/Modules/Compiler/ARMClang.cmake
+++ b/Modules/Compiler/ARMClang.cmake
@@ -1,6 +1,12 @@
if(_ARMClang_CMAKE_LOADED)
return()
endif()
+
+# This file requires CMAKE_LINKER and CMAKE_AR set by CMakeFindBinUtils.cmake.
+if(NOT (DEFINED CMAKE_LINKER AND DEFINED CMAKE_AR))
+ return()
+endif()
+
set(_ARMClang_CMAKE_LOADED TRUE)
# Save the CMP0123 setting in a variable used both below and by try_compile.
@@ -9,19 +15,8 @@ cmake_policy(GET CMP0123 CMAKE_ARMClang_CMP0123)
cmake_policy(PUSH)
cmake_policy(SET CMP0057 NEW) # if IN_LIST
-get_filename_component(_CMAKE_C_TOOLCHAIN_LOCATION "${CMAKE_C_COMPILER}" PATH)
-get_filename_component(_CMAKE_CXX_TOOLCHAIN_LOCATION "${CMAKE_CXX_COMPILER}" PATH)
-
set(CMAKE_EXECUTABLE_SUFFIX ".elf")
-find_program(CMAKE_ARMClang_LINKER armlink HINTS "${_CMAKE_C_TOOLCHAIN_LOCATION}" "${_CMAKE_CXX_TOOLCHAIN_LOCATION}" )
-find_program(CMAKE_ARMClang_AR armar HINTS "${_CMAKE_C_TOOLCHAIN_LOCATION}" "${_CMAKE_CXX_TOOLCHAIN_LOCATION}" )
-
-set(CMAKE_LINKER "${CMAKE_ARMClang_LINKER}" CACHE FILEPATH "The ARMClang linker" FORCE)
-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=")