mirror of
https://github.com/valitydev/osquery-1.git
synced 2024-11-06 09:35:20 +00:00
build: Improve SO linking on Linux (#3285)
This commit is contained in:
parent
fb287745c6
commit
02a6f76fd9
@ -264,12 +264,7 @@ macro(ADD_OSQUERY_MODULE TARGET)
|
||||
# This could implement a similar LINK_MODULE for gcc, libc, and libstdc++.
|
||||
# However it is only provided as an example for unit testing.
|
||||
target_link_libraries(${TARGET} "-static-libstdc++")
|
||||
target_link_libraries(${TARGET} "-L${BUILD_DEPS}/legacy/lib")
|
||||
endif()
|
||||
if((LINUX OR APPLE) AND CMAKE_CXX_COMPILER MATCHES "clang")
|
||||
#enable LTO builds of modules when building with clang on Unix
|
||||
target_link_libraries(${TARGET} "-flto=thin")
|
||||
if(LINUX)
|
||||
if(CMAKE_CXX_COMPILER MATCHES "clang")
|
||||
target_link_libraries(${TARGET} "-fuse-ld=lld")
|
||||
endif()
|
||||
endif()
|
||||
|
2
Makefile
2
Makefile
@ -30,7 +30,7 @@ else
|
||||
endif
|
||||
|
||||
PATH_SET := PATH="$(DEPS_DIR)/bin:/usr/local/bin:$(PATH)"
|
||||
CMAKE := $(PATH_SET) CXXFLAGS="-L$(DEPS_DIR)/lib" cmake ../../
|
||||
CMAKE := $(PATH_SET) CXXFLAGS="-L$(DEPS_DIR)/legacy/lib -L$(DEPS_DIR)/lib" cmake ../../
|
||||
CTEST := $(PATH_SET) ctest ../../
|
||||
FORMAT_COMMAND := python tools/formatting/git-clang-format.py \
|
||||
"--commit" "master" "-f" "--style=file"
|
||||
|
Loading…
Reference in New Issue
Block a user