CMake: Do not add -pthread to link flags with clang on Windows

It causes argument unused warnings.
This commit is contained in:
Maarten Bent
2018-12-09 15:55:04 +01:00
parent 9f21af693c
commit 981555b788

View File

@@ -105,10 +105,14 @@ function(wx_set_common_target_properties target_name)
endif()
# TODO: add warning flags for other compilers
endif()
if(CMAKE_USE_PTHREADS_INIT)
target_compile_options(${target_name} PRIVATE "-pthread")
# clang++.exe: warning: argument unused during compilation: '-pthread' [-Wunused-command-line-argument]
if(NOT (WIN32 AND "${CMAKE_CXX_COMPILER_ID}" STREQUAL "Clang"))
set_target_properties(${target_name} PROPERTIES LINK_FLAGS "-pthread")
endif()
endif()
endfunction()
# Set common properties on wx library target