1
0
Fork 0

Use Threads in packaged mode as more universal approach

This commit is contained in:
Ilya Fedin 2022-01-21 15:09:41 +04:00 committed by John Preston
parent 8e0b1aa26c
commit ab4553e6ee

View file

@ -29,7 +29,6 @@ INTERFACE
target_link_options(common_options
INTERFACE
-Wl,--as-needed
-pthread
)
if (CMAKE_CXX_COMPILER_ID STREQUAL "GNU")
@ -92,7 +91,14 @@ if (DESKTOP_APP_USE_ALLOCATION_TRACER)
)
endif()
if (NOT DESKTOP_APP_USE_PACKAGED)
if (DESKTOP_APP_USE_PACKAGED)
set(THREADS_PREFER_PTHREAD_FLAG ON)
find_package(Threads REQUIRED)
target_link_libraries(common_options
INTERFACE
Threads::Threads
)
else()
if (CMAKE_CXX_COMPILER_ID STREQUAL "GNU")
target_link_options(common_options
INTERFACE
@ -112,6 +118,7 @@ if (NOT DESKTOP_APP_USE_PACKAGED)
endif()
target_link_options(common_options
INTERFACE
-pthread
-rdynamic
-fwhole-program
-Wl,-z,relro