From 981555b7889a3d31f874915d01c5b36d2b6e4175 Mon Sep 17 00:00:00 2001 From: Maarten Bent Date: Sun, 9 Dec 2018 15:55:04 +0100 Subject: [PATCH] CMake: Do not add -pthread to link flags with clang on Windows It causes argument unused warnings. --- build/cmake/functions.cmake | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/build/cmake/functions.cmake b/build/cmake/functions.cmake index 088d685eb2..dfab1ccc95 100644 --- a/build/cmake/functions.cmake +++ b/build/cmake/functions.cmake @@ -105,9 +105,13 @@ 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") - set_target_properties(${target_name} PROPERTIES LINK_FLAGS "-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()