Replace FindThreads with custom logic
It doesn't seem to do what we want, unfortunately...
This commit is contained in:
parent
6c7b8d8b4c
commit
19aa4dd175
1 changed files with 9 additions and 7 deletions
|
|
@ -4,6 +4,8 @@
|
||||||
# For license and copyright information please follow this link:
|
# For license and copyright information please follow this link:
|
||||||
# https://github.com/desktop-app/legal/blob/master/LEGAL
|
# https://github.com/desktop-app/legal/blob/master/LEGAL
|
||||||
|
|
||||||
|
include(CheckCXXCompilerFlag)
|
||||||
|
|
||||||
target_compile_options(common_options
|
target_compile_options(common_options
|
||||||
INTERFACE
|
INTERFACE
|
||||||
-fstack-protector-all
|
-fstack-protector-all
|
||||||
|
|
@ -91,14 +93,15 @@ if (DESKTOP_APP_USE_ALLOCATION_TRACER)
|
||||||
)
|
)
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
if (DESKTOP_APP_USE_PACKAGED)
|
check_cxx_compiler_flag(-pthread DESKTOP_APP_HAVE_PTHREAD_ARG)
|
||||||
set(THREADS_PREFER_PTHREAD_FLAG ON)
|
if (DESKTOP_APP_HAVE_PTHREAD_ARG)
|
||||||
find_package(Threads REQUIRED)
|
target_link_options(common_options
|
||||||
target_link_libraries(common_options
|
|
||||||
INTERFACE
|
INTERFACE
|
||||||
Threads::Threads
|
-pthread
|
||||||
)
|
)
|
||||||
else()
|
endif()
|
||||||
|
|
||||||
|
if (NOT DESKTOP_APP_USE_PACKAGED)
|
||||||
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
|
||||||
|
|
@ -118,7 +121,6 @@ else()
|
||||||
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