From 3f576ce6cab525e555cbda55221f7714a25d9e8e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?David=20Hrdli=C4=8Dka?= Date: Mon, 20 Dec 2021 21:23:54 +0100 Subject: [PATCH] Allow overriding the toolchain flags --- cmake/flags-gcc-arm64.cmake | 4 ++-- cmake/flags-gcc-armv7.cmake | 4 ++-- cmake/flags-gcc-i686.cmake | 4 ++-- cmake/flags-gcc-x86_64.cmake | 4 ++-- cmake/flags-gcc.cmake | 16 ++++++++-------- 5 files changed, 16 insertions(+), 16 deletions(-) diff --git a/cmake/flags-gcc-arm64.cmake b/cmake/flags-gcc-arm64.cmake index 9aa21f4a6..3a0778230 100644 --- a/cmake/flags-gcc-arm64.cmake +++ b/cmake/flags-gcc-arm64.cmake @@ -1,4 +1,4 @@ include(${CMAKE_CURRENT_LIST_DIR}/flags-gcc.cmake) -set(CMAKE_C_FLAGS "-march=armv8-a -mfloat-abi=hard ${CMAKE_C_FLAGS}") -set(CMAKE_CXX_FLAGS "-march=armv8-a -mfloat-abi=hard ${CMAKE_CXX_FLAGS}") \ No newline at end of file +set(CMAKE_C_FLAGS_INIT "-march=armv8-a -mfloat-abi=hard ${CMAKE_C_FLAGS_INIT}") +set(CMAKE_CXX_FLAGS_INIT "-march=armv8-a -mfloat-abi=hard ${CMAKE_CXX_FLAGS_INIT}") \ No newline at end of file diff --git a/cmake/flags-gcc-armv7.cmake b/cmake/flags-gcc-armv7.cmake index c832a389e..9df648f54 100644 --- a/cmake/flags-gcc-armv7.cmake +++ b/cmake/flags-gcc-armv7.cmake @@ -1,4 +1,4 @@ include(${CMAKE_CURRENT_LIST_DIR}/flags-gcc.cmake) -set(CMAKE_C_FLAGS "-march=armv7-a -mfloat-abi=hard ${CMAKE_C_FLAGS}") -set(CMAKE_CXX_FLAGS "-march=armv7-a -mfloat-abi=hard ${CMAKE_CXX_FLAGS}") \ No newline at end of file +set(CMAKE_C_FLAGS_INIT "-march=armv7-a -mfloat-abi=hard ${CMAKE_C_FLAGS_INIT}") +set(CMAKE_CXX_FLAGS_INIT "-march=armv7-a -mfloat-abi=hard ${CMAKE_CXX_FLAGS_INIT}") \ No newline at end of file diff --git a/cmake/flags-gcc-i686.cmake b/cmake/flags-gcc-i686.cmake index fd0a7618c..84c8a7b57 100644 --- a/cmake/flags-gcc-i686.cmake +++ b/cmake/flags-gcc-i686.cmake @@ -1,4 +1,4 @@ include(${CMAKE_CURRENT_LIST_DIR}/flags-gcc.cmake) -set(CMAKE_C_FLAGS "-m32 -march=i686 -msse2 -mfpmath=sse ${CMAKE_C_FLAGS}") -set(CMAKE_CXX_FLAGS "-m32 -march=i686 -msse2 -mfpmath=sse ${CMAKE_CXX_FLAGS}") \ No newline at end of file +set(CMAKE_C_FLAGS_INIT "-m32 -march=i686 -msse2 -mfpmath=sse ${CMAKE_C_FLAGS_INIT}") +set(CMAKE_CXX_FLAGS_INIT "-m32 -march=i686 -msse2 -mfpmath=sse ${CMAKE_CXX_FLAGS_INIT}") \ No newline at end of file diff --git a/cmake/flags-gcc-x86_64.cmake b/cmake/flags-gcc-x86_64.cmake index 1b8385661..5ee305551 100644 --- a/cmake/flags-gcc-x86_64.cmake +++ b/cmake/flags-gcc-x86_64.cmake @@ -1,4 +1,4 @@ include(${CMAKE_CURRENT_LIST_DIR}/flags-gcc.cmake) -set(CMAKE_C_FLAGS "-m64 -march=x86-64 -msse2 -mfpmath=sse ${CMAKE_C_FLAGS}") -set(CMAKE_CXX_FLAGS "-m64 -march=x86-64 -msse2 -mfpmath=sse ${CMAKE_CXX_FLAGS}") \ No newline at end of file +set(CMAKE_C_FLAGS_INIT "-m64 -march=x86-64 -msse2 -mfpmath=sse ${CMAKE_C_FLAGS_INIT}") +set(CMAKE_CXX_FLAGS_INIT "-m64 -march=x86-64 -msse2 -mfpmath=sse ${CMAKE_CXX_FLAGS_INIT}") \ No newline at end of file diff --git a/cmake/flags-gcc.cmake b/cmake/flags-gcc.cmake index 437b2e39e..bf67340c8 100644 --- a/cmake/flags-gcc.cmake +++ b/cmake/flags-gcc.cmake @@ -1,10 +1,10 @@ set(CMAKE_CONFIGURATION_TYPES Debug;Release;Optimized) -set(CMAKE_C_FLAGS "-fomit-frame-pointer -mstackrealign -Wall -fno-strict-aliasing") -set(CMAKE_CXX_FLAGS ${CMAKE_C_FLAGS}) -set(CMAKE_C_FLAGS_RELEASE "-g0 -O3") -set(CMAKE_CXX_FLAGS_RELEASE ${CMAKE_C_FLAGS_RELEASE}) -set(CMAKE_C_FLAGS_DEBUG "-ggdb -Og") -set(CMAKE_CXX_FLAGS_DEBUG ${CMAKE_C_FLAGS_DEBUG}) -set(CMAKE_C_FLAGS_OPTIMIZED "-march=native -mtune=native -O3 -ffp-contract=fast -flto") -set(CMAKE_CXX_FLAGS_OPTIMIZED ${CMAKE_C_FLAGS_OPTIMIZED}) \ No newline at end of file +set(CMAKE_C_FLAGS_INIT "-fomit-frame-pointer -mstackrealign -Wall -fno-strict-aliasing") +set(CMAKE_CXX_FLAGS_INIT ${CMAKE_C_FLAGS_INIT}) +set(CMAKE_C_FLAGS_RELEASE_INIT "-g0 -O3") +set(CMAKE_CXX_FLAGS_RELEASE_INIT ${CMAKE_C_FLAGS_RELEASE_INIT}) +set(CMAKE_C_FLAGS_DEBUG_INIT "-ggdb -Og") +set(CMAKE_CXX_FLAGS_DEBUG_INIT ${CMAKE_C_FLAGS_DEBUG_INIT}) +set(CMAKE_C_FLAGS_OPTIMIZED_INIT "-march=native -mtune=native -O3 -ffp-contract=fast -flto") +set(CMAKE_CXX_FLAGS_OPTIMIZED_INIT ${CMAKE_C_FLAGS_OPTIMIZED_INIT}) \ No newline at end of file