mirror of
https://github.com/valitydev/osquery-1.git
synced 2024-11-06 17:45:22 +00:00
toolchain: Add CMake options for linking (#6112)
This commit is contained in:
parent
2303e1bbd0
commit
b8eacfa1f8
@ -2,9 +2,6 @@ include(CheckPIESupported)
|
||||
check_pie_supported()
|
||||
set(CMAKE_POSITION_INDEPENDENT_CODE ON)
|
||||
|
||||
set(CMAKE_LINK_SEARCH_START_STATIC ON)
|
||||
set(CMAKE_LINK_SEARCH_END_STATIC ON)
|
||||
|
||||
function(setupBuildFlags)
|
||||
add_library(cxx_settings INTERFACE)
|
||||
add_library(c_settings INTERFACE)
|
||||
@ -62,6 +59,7 @@ function(setupBuildFlags)
|
||||
)
|
||||
|
||||
set(posix_cxx_link_options
|
||||
-stdlib=libc++
|
||||
-ldl
|
||||
)
|
||||
|
||||
|
@ -4,4 +4,11 @@ if(OSQUERY_TOOLCHAIN_SYSROOT)
|
||||
overwrite_cache_variable("CMAKE_C_COMPILER" "STRING" "${OSQUERY_TOOLCHAIN_SYSROOT}/usr/bin/clang")
|
||||
overwrite_cache_variable("CMAKE_CXX_COMPILER" "STRING" "${OSQUERY_TOOLCHAIN_SYSROOT}/usr/bin/clang++")
|
||||
overwrite_cache_variable("CMAKE_SYSROOT" "PATH" "${OSQUERY_TOOLCHAIN_SYSROOT}")
|
||||
overwrite_cache_variable("CMAKE_LINK_SEARCH_START_STATIC" "BOOL" "ON")
|
||||
overwrite_cache_variable("CMAKE_LINK_SEARCH_END_STATIC" "BOOL" "ON")
|
||||
else()
|
||||
option(OSQUERY_STATIC_BUILD "Whether to prefer linking static libraries or not")
|
||||
|
||||
overwrite_cache_variable("CMAKE_LINK_SEARCH_START_STATIC" "BOOL" "${OSQUERY_STATIC_BUILD}")
|
||||
overwrite_cache_variable("CMAKE_LINK_SEARCH_END_STATIC" "BOOL" "${OSQUERY_STATIC_BUILD}")
|
||||
endif()
|
||||
|
Loading…
Reference in New Issue
Block a user