CMake: Compile and link with -pthread when using pthread

This commit is contained in:
Maarten Bent
2018-12-06 23:20:48 +01:00
parent c28ae123c1
commit 28a13209a2

View File

@@ -105,6 +105,10 @@ function(wx_set_common_target_properties target_name)
endif() endif()
# TODO: add warning flags for other compilers # TODO: add warning flags for other compilers
endif() endif()
if(CMAKE_USE_PTHREADS_INIT)
target_compile_options(${target_name} PRIVATE "-pthread")
set_target_properties(${target_name} PROPERTIES LINK_FLAGS "-pthread")
endif()
endfunction() endfunction()
# Set common properties on wx library target # Set common properties on wx library target