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 INTERFACE
lzma lzma
) )
target_link_libraries(external_xz
INTERFACE
${CMAKE_DL_LIBS}
)
endif() endif()

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

@ -12,8 +12,3 @@ nice_target_sources(linux_xcb_helper ${CMAKE_CURRENT_SOURCE_DIR}
PRIVATE PRIVATE
linux_xcb_helper.cpp 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 target_link_options(common_options
INTERFACE INTERFACE
-Wl,--as-needed -Wl,--as-needed
-pthread
) )
if (CMAKE_CXX_COMPILER_ID STREQUAL "GNU") if (CMAKE_CXX_COMPILER_ID STREQUAL "GNU")
@ -64,6 +65,7 @@ endif()
target_link_libraries(common_options target_link_libraries(common_options
INTERFACE INTERFACE
desktop-app::external_jemalloc desktop-app::external_jemalloc
${CMAKE_DL_LIBS}
) )
if (DESKTOP_APP_USE_ALLOCATION_TRACER) if (DESKTOP_APP_USE_ALLOCATION_TRACER)
@ -109,7 +111,6 @@ if (NOT DESKTOP_APP_USE_PACKAGED)
endif() endif()
target_link_options(common_options target_link_options(common_options
INTERFACE INTERFACE
-pthread
-rdynamic -rdynamic
-fwhole-program -fwhole-program
-Wl,-z,relro -Wl,-z,relro
@ -117,16 +118,3 @@ if (NOT DESKTOP_APP_USE_PACKAGED)
# -pie # https://gitlab.gnome.org/GNOME/nautilus/-/issues/1601 # -pie # https://gitlab.gnome.org/GNOME/nautilus/-/issues/1601
) )
endif() 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()