From ed3da58e31f1d1c830c499a8f72a4242b49ad834 Mon Sep 17 00:00:00 2001 From: Username404 Date: Sat, 18 Sep 2021 22:51:04 +0200 Subject: [PATCH] Add the "-pthread" flag to the G++/Clang common flags instead of using another redundant condition --- CMakeLists.txt | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index ae28718..aca8d4a 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -29,16 +29,12 @@ else() set(CMAKE_POSITION_INDEPENDENT_CODE TRUE) endif() set(CMAKE_CXX_FLAGS "-Wall") +set(CMAKE_CXX_FLAGS_RELEASE "-Os") set(MINIMAL_GNU "11.0") set(MINIMAL_CLANG "13.0") set(IS_GNU (${CMAKE_CXX_COMPILER_ID} STREQUAL GNU)) set(IS_CLANG (${CMAKE_CXX_COMPILER_ID} STREQUAL Clang)) -if (NOT MSVC) - set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -pthread") -endif() -set(CMAKE_CXX_FLAGS_RELEASE "-Os") - if (NOT DEFINED CCACHE_PRESENT) find_program(CCACHE_PRESENT ccache) endif() @@ -55,7 +51,7 @@ if (${IS_GNU} OR ${IS_CLANG}) add_definitions(-D_GLIBCXX_PARALLEL) endif() endif() - set(CMAKE_CXX_FLAGS "-flto ${CMAKE_CXX_FLAGS} -fstrict-enums -pipe -fstack-protector-strong -fstack-clash-protection -funwind-tables -fasynchronous-unwind-tables -frtti -fexceptions") + set(CMAKE_CXX_FLAGS "-pthread -flto ${CMAKE_CXX_FLAGS} -fstrict-enums -pipe -fstack-protector-strong -fstack-clash-protection -funwind-tables -fasynchronous-unwind-tables -frtti -fexceptions") set(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} -ffunction-sections -fdata-sections -fmerge-all-constants -ftree-vectorize") include(CheckCXXCompilerFlag) set(CF_PROTECTION "-fcf-protection")