From b6cfa5c9b9f920144287b2beb0ca0beff3aceb65 Mon Sep 17 00:00:00 2001 From: arabek Date: Sun, 7 Jul 2019 15:15:06 +0200 Subject: [PATCH] Fix build with cotire and clang-8.0 branch Without this patch, build fails when using cotire, because pch headers are missing the pthread flag when using Clang --- CMakeLists.txt | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/CMakeLists.txt b/CMakeLists.txt index 861d443576..d5248238fa 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -77,6 +77,10 @@ add_subdirectory(3rdparty) unset(CMAKE_CXX_FLAGS) unset(CMAKE_C_FLAGS) +if (NOT WIN32) + add_compile_options(-pthread) +endif() + # TODO: do real installation, including copying directory structure set(CMAKE_RUNTIME_OUTPUT_DIRECTORY_RELEASE "${PROJECT_BINARY_DIR}/bin") set(CMAKE_RUNTIME_OUTPUT_DIRECTORY_DEBUG "${PROJECT_BINARY_DIR}/bin")