build: Remove RPATH from externals target (#3001)

This commit is contained in:
Teddy Reed 2017-02-15 07:54:03 -08:00 committed by GitHub
parent ab07bc21f7
commit d2727023b9
2 changed files with 4 additions and 4 deletions

View File

@ -51,7 +51,7 @@ macro(ADD_DEFAULT_LINKS TARGET ADDITIONAL)
if(${ADDITIONAL})
target_link_libraries(${TARGET} libosquery_additional_shared)
endif()
if(DEFINED ENV{FAST})
if(DEFINED ENV{OSQUERY_BUILD_SHARED})
target_link_libraries(${TARGET} "-Wl,-rpath,${CMAKE_BINARY_DIR}/osquery")
endif()
else()

View File

@ -215,9 +215,7 @@ else()
)
if (CMAKE_CXX_COMPILER MATCHES "clang")
# Only enale LTO builds when using clang on Unix, for now
add_compile_options(
-flto
)
add_compile_options(-flto)
endif()
endif()
endif()
@ -289,6 +287,7 @@ else()
if (CMAKE_CXX_COMPILER MATCHES "clang")
# Clang on Unix uses LTO; we also need to pass -flto when linking
set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -flto")
set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} -flto")
endif()
endif()
@ -466,6 +465,7 @@ execute_process(COMMAND mkdir ${MKDIR_OPTS} "${CMAKE_BINARY_DIR}/generated")
# We need to link some packages as dynamic/dependent.
set(CMAKE_FIND_LIBRARY_SUFFIXES .lib .dylib .so .a)
set(CMAKE_SKIP_RPATH TRUE)
# Most dependent packages/libs we want static.
if(DEFINED ENV{BUILD_LINK_SHARED})