[CMake Linux] Only include pthread and rt in target_link_libraries for ld.gold support (Alchemy sync)

Fixes CMake warnings on Linux
This commit is contained in:
Router Gray
2019-12-20 16:37:39 -06:00
parent 0496374328
commit c68e00730e
5 changed files with 6 additions and 17 deletions

View File

@@ -10,7 +10,6 @@ if (DARWIN)
find_library(CORESERVICES_LIBRARY CoreServices)
endif (DARWIN)
set(LLCOMMON_INCLUDE_DIRS
${LIBS_OPEN_DIR}/cwdebug
${LIBS_OPEN_DIR}/llcommon
@@ -19,14 +18,7 @@ set(LLCOMMON_INCLUDE_DIRS
${Boost_INCLUDE_DIRS}
)
if (LINUX)
# In order to support using ld.gold on linux, we need to explicitely
# specify all libraries that llcommon uses.
# llcommon uses `clock_gettime' which is provided by librt on linux.
set(LLCOMMON_LIBRARIES llcommon rt)
else (LINUX)
set(LLCOMMON_LIBRARIES llcommon)
endif (LINUX)
set(LLCOMMON_LIBRARIES llcommon)
set(LLCOMMON_LINK_SHARED OFF CACHE BOOL "Build the llcommon target as a shared library.")
if(LLCOMMON_LINK_SHARED)

View File

@@ -5,10 +5,4 @@ set(LLPLUGIN_INCLUDE_DIRS
${LIBS_OPEN_DIR}/llplugin
)
if (LINUX)
# In order to support using ld.gold on linux, we need to explicitely
# specify all libraries that llplugin uses.
set(LLPLUGIN_LIBRARIES llplugin pthread)
else (LINUX)
set(LLPLUGIN_LIBRARIES llplugin)
endif (LINUX)
set(LLPLUGIN_LIBRARIES llplugin)

View File

@@ -300,6 +300,7 @@ target_link_libraries(
${Boost_SYSTEM_LIBRARY}
${CORESERVICES_LIBRARY}
${URIPARSER_LIBRARY}
${RT_LIBRARY}
)
if (DARWIN)

View File

@@ -227,7 +227,8 @@ target_link_libraries(
${OPENSSL_LIBRARIES}
${CRYPTO_LIBRARIES}
${XMLRPCEPI_LIBRARIES}
)
${PTHREAD_LIBRARY}
)
# tests
if (LL_TESTS)

View File

@@ -69,6 +69,7 @@ target_link_libraries(SLPlugin
${LLCOMMON_LIBRARIES}
${APRUTIL_LIBRARIES}
${PLUGIN_API_WINDOWS_LIBRARIES}
${PTHREAD_LIBRARY}
)
add_dependencies(SLPlugin