-march=native is not for MSVC

release/4.3a0
Jose Luis Blanco-Claraco 2019-06-02 11:32:38 +02:00
parent 823c8bd5e8
commit ab8b2f5263
1 changed files with 6 additions and 4 deletions

View File

@ -90,10 +90,12 @@ if(${CMAKE_CXX_COMPILER_ID} STREQUAL "Clang")
endif()
endif()
option(GTSAM_BUILD_WITH_MARCH_NATIVE "Enable/Disable building with all instructions supported by native architecture (binary may not be portable!)" ON)
if(GTSAM_BUILD_WITH_MARCH_NATIVE)
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -march=native")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -march=native")
if (NOT MSVC)
option(GTSAM_BUILD_WITH_MARCH_NATIVE "Enable/Disable building with all instructions supported by native architecture (binary may not be portable!)" ON)
if(GTSAM_BUILD_WITH_MARCH_NATIVE)
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -march=native")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -march=native")
endif()
endif()
# Set up build type library postfixes