Add the "-pthread" flag to the G++/Clang common flags instead of using another redundant condition

This commit is contained in:
Username404 2021-09-18 22:51:04 +02:00
parent 6243e97d48
commit ed3da58e31
Signed by: Username404-59
GPG Key ID: 7AB361FBB257A5D1
1 changed files with 2 additions and 6 deletions

View File

@ -29,16 +29,12 @@ else()
set(CMAKE_POSITION_INDEPENDENT_CODE TRUE) set(CMAKE_POSITION_INDEPENDENT_CODE TRUE)
endif() endif()
set(CMAKE_CXX_FLAGS "-Wall") set(CMAKE_CXX_FLAGS "-Wall")
set(CMAKE_CXX_FLAGS_RELEASE "-Os")
set(MINIMAL_GNU "11.0") set(MINIMAL_GNU "11.0")
set(MINIMAL_CLANG "13.0") set(MINIMAL_CLANG "13.0")
set(IS_GNU (${CMAKE_CXX_COMPILER_ID} STREQUAL GNU)) set(IS_GNU (${CMAKE_CXX_COMPILER_ID} STREQUAL GNU))
set(IS_CLANG (${CMAKE_CXX_COMPILER_ID} STREQUAL Clang)) 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) if (NOT DEFINED CCACHE_PRESENT)
find_program(CCACHE_PRESENT ccache) find_program(CCACHE_PRESENT ccache)
endif() endif()
@ -55,7 +51,7 @@ if (${IS_GNU} OR ${IS_CLANG})
add_definitions(-D_GLIBCXX_PARALLEL) add_definitions(-D_GLIBCXX_PARALLEL)
endif() endif()
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") set(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} -ffunction-sections -fdata-sections -fmerge-all-constants -ftree-vectorize")
include(CheckCXXCompilerFlag) include(CheckCXXCompilerFlag)
set(CF_PROTECTION "-fcf-protection") set(CF_PROTECTION "-fcf-protection")