cmake: Fix FindLlvmLld usage of unimported package
The find_package_handle_standard_args function is used in FindLlvmLld without being imported. This may cause FindLlvmLld to fail non-determistically based on if it's evaluated in a CMake build/process before find_package_handle_standard_args is included. We should include what we use. Explicitly include find_package_handle_standard_args. Signed-off-by: Aaron Massey <aaronmassey@google.com>
This commit is contained in:
parent
9d3f594432
commit
15cdcc79f0
|
@ -23,6 +23,8 @@
|
||||||
# Note that this will use CROSS_COMPILE, if defined,
|
# Note that this will use CROSS_COMPILE, if defined,
|
||||||
# as a prefix to the linker executable.
|
# as a prefix to the linker executable.
|
||||||
|
|
||||||
|
include(FindPackageHandleStandardArgs)
|
||||||
|
|
||||||
# GNULD_LINKER exists on repeated builds or defined manually...
|
# GNULD_LINKER exists on repeated builds or defined manually...
|
||||||
if(EXISTS "${GNULD_LINKER}")
|
if(EXISTS "${GNULD_LINKER}")
|
||||||
if(NOT DEFINED GNULD_LINKER_IS_BFD)
|
if(NOT DEFINED GNULD_LINKER_IS_BFD)
|
||||||
|
|
|
@ -17,6 +17,8 @@
|
||||||
# 'LLVMLLD_VERSION_STRING'
|
# 'LLVMLLD_VERSION_STRING'
|
||||||
# The version of LLVM lld.
|
# The version of LLVM lld.
|
||||||
|
|
||||||
|
include(FindPackageHandleStandardArgs)
|
||||||
|
|
||||||
# See if the compiler has a preferred linker
|
# See if the compiler has a preferred linker
|
||||||
execute_process(COMMAND ${CMAKE_C_COMPILER} --print-prog-name=ld.lld
|
execute_process(COMMAND ${CMAKE_C_COMPILER} --print-prog-name=ld.lld
|
||||||
OUTPUT_VARIABLE LLVMLLD_LINKER
|
OUTPUT_VARIABLE LLVMLLD_LINKER
|
||||||
|
|
|
@ -12,6 +12,8 @@
|
||||||
# 'ARMCLANG_VERSION'
|
# 'ARMCLANG_VERSION'
|
||||||
# The version of the arm clang toolchain.
|
# The version of the arm clang toolchain.
|
||||||
|
|
||||||
|
include(FindPackageHandleStandardArgs)
|
||||||
|
|
||||||
if(CMAKE_C_COMPILER)
|
if(CMAKE_C_COMPILER)
|
||||||
# Parse the 'clang --version' output to find the installed version.
|
# Parse the 'clang --version' output to find the installed version.
|
||||||
execute_process(COMMAND ${CMAKE_C_COMPILER} --target=${triple} --version OUTPUT_VARIABLE ARMCLANG_VERSION)
|
execute_process(COMMAND ${CMAKE_C_COMPILER} --target=${triple} --version OUTPUT_VARIABLE ARMCLANG_VERSION)
|
||||||
|
|
|
@ -12,6 +12,8 @@
|
||||||
# 'ONEAPI_VERSION'
|
# 'ONEAPI_VERSION'
|
||||||
# The version of the oneAPI toolchain.
|
# The version of the oneAPI toolchain.
|
||||||
|
|
||||||
|
include(FindPackageHandleStandardArgs)
|
||||||
|
|
||||||
if(CMAKE_C_COMPILER)
|
if(CMAKE_C_COMPILER)
|
||||||
# Parse the 'clang --version' output to find the installed version.
|
# Parse the 'clang --version' output to find the installed version.
|
||||||
execute_process(COMMAND ${CMAKE_C_COMPILER} --version OUTPUT_VARIABLE ONEAPI_VERSION)
|
execute_process(COMMAND ${CMAKE_C_COMPILER} --version OUTPUT_VARIABLE ONEAPI_VERSION)
|
||||||
|
|
Loading…
Reference in a new issue