diff options
author | Don Hinton <hintonda@gmail.com> | 2017-12-24 19:30:24 (GMT) |
---|---|---|
committer | Brad King <brad.king@kitware.com> | 2018-01-10 19:13:32 (GMT) |
commit | f74c25802de11e4e4578b1c9473f99d106491da8 (patch) | |
tree | 6f3c7a0a38a33dd9fadc062fa3a7c877c9ee8c65 /Modules/CheckIncludeFiles.cmake | |
parent | 40dea7e4b2e1c4518337bba284a233bf6f788a1a (diff) | |
download | CMake-f74c25802de11e4e4578b1c9473f99d106491da8.zip CMake-f74c25802de11e4e4578b1c9473f99d106491da8.tar.gz CMake-f74c25802de11e4e4578b1c9473f99d106491da8.tar.bz2 |
CheckIncludeFiles: Honor CMAKE_REQUIRED_LIBRARIES
This is needed when cross compiling and the compiler requires a specific
linker different from the default, e.g., when cross compiling from
Darwin to Linux and passing `-fuse-ld=lld` to clang.
Fixes: #9514
Diffstat (limited to 'Modules/CheckIncludeFiles.cmake')
-rw-r--r-- | Modules/CheckIncludeFiles.cmake | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/Modules/CheckIncludeFiles.cmake b/Modules/CheckIncludeFiles.cmake index 59afdab..14db68c 100644 --- a/Modules/CheckIncludeFiles.cmake +++ b/Modules/CheckIncludeFiles.cmake @@ -33,6 +33,8 @@ # list of macros to define (-DFOO=bar) # ``CMAKE_REQUIRED_INCLUDES`` # list of include directories +# ``CMAKE_REQUIRED_LIBRARIES`` +# list of libraries to link # ``CMAKE_REQUIRED_QUIET`` # execute quietly without messages # @@ -102,6 +104,7 @@ macro(CHECK_INCLUDE_FILES INCLUDE VARIABLE) ${CMAKE_BINARY_DIR} ${src} COMPILE_DEFINITIONS ${CMAKE_REQUIRED_DEFINITIONS} + LINK_LIBRARIES ${CMAKE_REQUIRED_LIBRARIES} CMAKE_FLAGS -DCOMPILE_DEFINITIONS:STRING=${MACRO_CHECK_INCLUDE_FILES_FLAGS} "${CHECK_INCLUDE_FILES_INCLUDE_DIRS}" |