Use Threads in packaged mode as more universal approach
This commit is contained in:
parent
8e0b1aa26c
commit
ab4553e6ee
1 changed files with 9 additions and 2 deletions
|
|
@ -29,7 +29,6 @@ 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")
|
||||||
|
|
@ -92,7 +91,14 @@ if (DESKTOP_APP_USE_ALLOCATION_TRACER)
|
||||||
)
|
)
|
||||||
endif()
|
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")
|
if (CMAKE_CXX_COMPILER_ID STREQUAL "GNU")
|
||||||
target_link_options(common_options
|
target_link_options(common_options
|
||||||
INTERFACE
|
INTERFACE
|
||||||
|
|
@ -112,6 +118,7 @@ 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
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue