From 8edb316b3335730c059624de669f8aab2b286d63 Mon Sep 17 00:00:00 2001 From: Franziska Wegner <57569315+franziska-wegner@users.noreply.github.com> Date: Sat, 6 Jan 2024 11:22:11 -0800 Subject: [PATCH] Removes the warnings `D9002` and `D9025` caused by `-Ofast` Flag under Windows `MSVC` (#101) * Check if the warning is cause by the -Ofast flag * Differentiate between windows and unix --- cmake/CompilerConfiguration.cmake | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/cmake/CompilerConfiguration.cmake b/cmake/CompilerConfiguration.cmake index a9f0dceb..93241245 100644 --- a/cmake/CompilerConfiguration.cmake +++ b/cmake/CompilerConfiguration.cmake @@ -17,9 +17,12 @@ if (CMAKE_BUILD_TYPE MATCHES "Debug" AND CMAKE_CXX_COMPILER_ID MATCHES "GNU" AND CMAKE_SYSTEM_NAME MATCHES "Linux") set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} -coverage") set(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} -Ofast -coverage") -else() +elseif(NOT CMAKE_SYSTEM_NAME MATCHES "Windows") set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG}") set(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} -Ofast") +else() + set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG}") + set(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE}") endif() ####################################################################