From df3fe5cea18e23545fa5fca83bc97ae2ee3d68ed Mon Sep 17 00:00:00 2001 From: Alejandro Alfonso Date: Tue, 5 Dec 2023 10:11:34 +0100 Subject: [PATCH] Setup compilers independently --- CMakeLists.txt | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 88518ac..f5251ea 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -13,10 +13,10 @@ set(BLACKSMITH_INCLUDE_DIR ${CMAKE_CURRENT_SOURCE_DIR}/include) set(BLACKSMITH_LIBS_DIR ${CMAKE_CURRENT_SOURCE_DIR}/lib) # Compiler-specific flags -if(CMAKE_COMPILER_IS_GNUCXX) - set(CMAKE_CXX_FLAGS "-Wall -Wextra -Wpedantic -Werror") -else() - set(CMAKE_CXX_FLAGS "-W4 -WX -EHsc") +if(CMAKE_CXX_COMPILER_ID STREQUAL "GNU") + set(CMAKE_CXX_FLAGS "-Wall -Wextra -Wpedantic -Werror -Os") +elseif(CMAKE_CXX_COMPILER_ID STREQUAL "MSVC") + set(CMAKE_CXX_FLAGS "-W4 -WX -EHsc -Os") endif() set(CMAKE_CXX_FLAGS_RELEASE "-Os")