1
0
Fork 0

Move libdl/libpthread handling to common_options

Setting -pthread makes linking libatomic manually unneeded
This commit is contained in:
Ilya Fedin 2021-12-30 08:32:11 +04:00 committed by John Preston
parent f2384057de
commit 10108ea237
14 changed files with 2 additions and 63 deletions

View file

@ -24,9 +24,4 @@ else()
INTERFACE
lzma
)
target_link_libraries(external_xz
INTERFACE
${CMAKE_DL_LIBS}
)
endif()

View file

@ -61,7 +61,6 @@ INTERFACE
target_link_libraries(external_dispatch_bundled
INTERFACE
${dispatch_binary_dir}/src/BlocksRuntime/libBlocksRuntime.a
pthread
)
target_link_libraries(external_dispatch

View file

@ -57,7 +57,6 @@ else()
target_link_libraries(external_ffmpeg
INTERFACE
X11
pthread
)
endif()
endif()

View file

@ -32,9 +32,4 @@ else()
PRIVATE
${X11_INCLUDE_DIRS}
)
target_link_libraries(external_hime_im_client
PRIVATE
${CMAKE_DL_LIBS}
)
endif()

View file

@ -51,12 +51,6 @@ INTERFACE
${SOURCE_DIR}/include
)
target_link_libraries(external_jemalloc_bundled
INTERFACE
${CMAKE_DL_LIBS}
pthread
)
add_dependencies(external_jemalloc_bundled jemalloc-build)
target_link_libraries(external_jemalloc

View file

@ -45,6 +45,5 @@ else()
target_link_libraries(external_nimf_qt5
PRIVATE
desktop-app::external_qt
${CMAKE_DL_LIBS}
)
endif()

View file

@ -47,11 +47,6 @@ else()
INTERFACE
openal
)
target_link_libraries(external_openal
INTERFACE
${CMAKE_DL_LIBS}
pthread
)
endif()
if (NOT DESKTOP_APP_USE_PACKAGED)

View file

@ -19,12 +19,4 @@ if (NOT DESKTOP_APP_USE_PACKAGED)
${libs_loc}/openssl/include
)
endif()
if (LINUX)
target_link_libraries(external_openssl_common
INTERFACE
${CMAKE_DL_LIBS}
pthread
)
endif()
endif()

View file

@ -305,8 +305,6 @@ else()
xcb
X11
X11-xcb
${CMAKE_DL_LIBS}
pthread
)
endif()
endif()

View file

@ -280,8 +280,6 @@ else()
xcb
X11
X11-xcb
${CMAKE_DL_LIBS}
pthread
)
endif()
endif()

View file

@ -133,13 +133,6 @@ else()
${rlottie_loc}/src/vector/freetype
)
if (LINUX)
target_link_libraries(external_rlottie_bundled
PRIVATE
pthread
)
endif()
if (CMAKE_CXX_COMPILER_ID STREQUAL "MSVC")
target_compile_options(external_rlottie_bundled
PRIVATE

View file

@ -16,5 +16,4 @@ PRIVATE
target_link_libraries(linux_wayland_helper
PUBLIC
desktop-app::external_gsl
${CMAKE_DL_LIBS}
)

View file

@ -12,8 +12,3 @@ nice_target_sources(linux_xcb_helper ${CMAKE_CURRENT_SOURCE_DIR}
PRIVATE
linux_xcb_helper.cpp
)
target_link_libraries(linux_xcb_helper
PUBLIC
${CMAKE_DL_LIBS}
)

View file

@ -28,6 +28,7 @@ INTERFACE
target_link_options(common_options
INTERFACE
-Wl,--as-needed
-pthread
)
if (CMAKE_CXX_COMPILER_ID STREQUAL "GNU")
@ -64,6 +65,7 @@ endif()
target_link_libraries(common_options
INTERFACE
desktop-app::external_jemalloc
${CMAKE_DL_LIBS}
)
if (DESKTOP_APP_USE_ALLOCATION_TRACER)
@ -109,7 +111,6 @@ if (NOT DESKTOP_APP_USE_PACKAGED)
endif()
target_link_options(common_options
INTERFACE
-pthread
-rdynamic
-fwhole-program
-Wl,-z,relro
@ -117,16 +118,3 @@ if (NOT DESKTOP_APP_USE_PACKAGED)
# -pie # https://gitlab.gnome.org/GNOME/nautilus/-/issues/1601
)
endif()
if (DESKTOP_APP_USE_PACKAGED)
find_library(ATOMIC_LIBRARY atomic)
else()
find_library(ATOMIC_LIBRARY libatomic.a)
endif()
if (ATOMIC_LIBRARY)
target_link_libraries(common_options
INTERFACE
${ATOMIC_LIBRARY}
)
endif()