From 41da4ef6acd615dcfa44bccec06c5b735cb97638 Mon Sep 17 00:00:00 2001 From: Username404 Date: Tue, 10 Aug 2021 10:58:18 +0200 Subject: [PATCH] Add even more flags for the GNU and Clang compilers... --- CMakeLists.txt | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 9f46c91..189a71a 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -39,7 +39,7 @@ endif() if ((${CMAKE_CXX_COMPILER_ID} STREQUAL GNU) OR (${CMAKE_CXX_COMPILER_ID} STREQUAL Clang)) set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -static-libgcc") set(CMAKE_CXX_FLAGS "-flto ${CMAKE_CXX_FLAGS} -pipe -fstack-protector-strong -fstack-clash-protection") - set(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} -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) CHECK_CXX_COMPILER_FLAG("-fcf-protection" CF_PROTECTION_SUPPORTED) if (CF_PROTECTION_SUPPORTED) @@ -51,7 +51,7 @@ if (${CMAKE_CXX_COMPILER_ID} STREQUAL GNU) if (CMAKE_CXX_COMPILER_VERSION VERSION_LESS ${MINIMAL_GNU}) message(FATAL_ERROR "G++ ${MINIMAL_GNU} or higher is required.") endif() - set(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} -fira-loop-pressure -ftree-loop-distribution -floop-interchange -fipa-pta -fivopts -s") + set(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} -fpredictive-commoning -ftree-partial-pre -fira-loop-pressure -ftree-loop-distribution -floop-interchange -fsplit-paths -fipa-pta -fivopts -s") set(CMAKE_CXX_FLAGS "-fno-use-linker-plugin -fwhole-program ${CMAKE_CXX_FLAGS}") elseif(${CMAKE_CXX_COMPILER_ID} STREQUAL Clang) if (CMAKE_CXX_COMPILER_VERSION VERSION_LESS ${MINIMAL_CLANG})