From de6d468588cc0c7cff0d0a15f13c84dcf3f3257e Mon Sep 17 00:00:00 2001 From: Mikael Rekola Date: Thu, 1 Feb 2024 14:41:41 +0200 Subject: [PATCH] fix CMakeLists.txt to make it work in Visual Studio --- CMakeLists.txt | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 17f33da..b75da79 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -12,9 +12,13 @@ if(NOT CMAKE_BUILD_TYPE) set(CMAKE_BUILD_TYPE "Release") endif() -set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -march=native -O3 -Wall -Wsuggest-override -Werror=return-local-addr -Werror=multichar -Werror=enum-compare -Werror=return-type -Werror=conversion-null -Werror=parentheses -Werror=address -Werror=trigraphs -Werror=pointer-arith -Werror=write-strings -Werror=pessimizing-move -Wuninitialized -Wno-unknown-pragmas -Werror=switch -Werror=format -Werror=non-virtual-dtor -Werror=cast-qual -Wconversion -Wsign-conversion -Wsign-promo -I include") -# set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -pg") -# set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -pg") +IF (MSVC) + +else() + set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -march=native -O3 -Wall -Wsuggest-override -Werror=return-local-addr -Werror=multichar -Werror=enum-compare -Werror=return-type -Werror=conversion-null -Werror=parentheses -Werror=address -Werror=trigraphs -Werror=pointer-arith -Werror=write-strings -Werror=pessimizing-move -Wuninitialized -Wno-unknown-pragmas -Werror=switch -Werror=format -Werror=non-virtual-dtor -Werror=cast-qual -Wconversion -Wsign-conversion -Wsign-promo -I include") + # set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -pg") + # set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -pg") +endif() # add the executable add_executable(test test.cpp)