From 86090f1a7df9e670f3179b49d8a3b0a90d7925a9 Mon Sep 17 00:00:00 2001 From: Username404-59 Date: Tue, 9 Mar 2021 21:32:38 +0100 Subject: [PATCH] Don't use the -pthread option when MSVC is being used. --- CMakeLists.txt | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index acc1256..69d2b03 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -3,8 +3,11 @@ project(Yerbacon VERSION 0.0.1 LANGUAGES C CXX) set(CMAKE_CXX_STANDARD 20) set(CMAKE_CXX_STANDARD_REQUIRED ON) -set(CMAKE_CXX_FLAGS "-Wall -pthread") -set(CMAKE_CXX_FLAGS_RELEASE "-Os") +set(CMAKE_CXX_FLAGS "-Wall") +if (NOT MSVC) + set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -pthread") +endif() +set(CMAKE_CXX_FLAGS_RELEASE "-Os") if((${CMAKE_CXX_COMPILER_ID} STREQUAL GNU) OR (${CMAKE_CXX_COMPILER_ID} STREQUAL Clang)) set(CMAKE_EXE_LINKER_FLAGS "-static-libgcc")