cmake: use CMAKE_REQUIRED_LINK_DIRECTORIES
Use `CMAKE_REQUIRED_LINK_DIRECTORIES` with CMake 3.31.0 and upper, in local macro `curl_required_libpaths()`.9e95bd49f29e95bd49f2https://gitlab.kitware.com/cmake/cmake/-/merge_requests/9795 https://cmake.org/cmake/help/v3.31/module/CheckSymbolExists.html Tested OK with cmake 3.31.0-rc1. Follow-up to01a8157997#15271 Follow-up to7bab201abe#15193 Closes #15280
This commit is contained in:
parent
05ba353435
commit
3dbd4362fd
@ -73,10 +73,14 @@ macro(curl_dependency_option _dependency)
|
||||
endif()
|
||||
endmacro()
|
||||
|
||||
# Convert the passed paths to libpath linker options and add them to CMAKE_REQUIRED_LINK_OPTIONS.
|
||||
# Convert the passed paths to libpath linker options and add them to CMAKE_REQUIRED_*.
|
||||
macro(curl_required_libpaths _libpaths_arg)
|
||||
set(_libpaths "${_libpaths_arg}")
|
||||
foreach(_libpath IN LISTS _libpaths)
|
||||
list(APPEND CMAKE_REQUIRED_LINK_OPTIONS "${CMAKE_LIBRARY_PATH_FLAG}${_libpath}")
|
||||
endforeach()
|
||||
if(CMAKE_VERSION VERSION_LESS 3.31)
|
||||
set(_libpaths "${_libpaths_arg}")
|
||||
foreach(_libpath IN LISTS _libpaths)
|
||||
list(APPEND CMAKE_REQUIRED_LINK_OPTIONS "${CMAKE_LIBRARY_PATH_FLAG}${_libpath}")
|
||||
endforeach()
|
||||
else()
|
||||
list(APPEND CMAKE_REQUIRED_LINK_DIRECTORIES "${_libpaths_arg}")
|
||||
endif()
|
||||
endmacro()
|
||||
|
||||
Loading…
Reference in New Issue
Block a user