Fixes for arm64

This commit is contained in:
Vladyslav Usenko 2021-11-21 18:27:34 +01:00
parent ac1e5294b4
commit 05a6df43d6
2 changed files with 10 additions and 3 deletions

View File

@ -75,6 +75,13 @@ if(NOT CXX_MARCH)
set(CXX_MARCH native)
endif()
IF(NOT APPLE OR NOT CMAKE_SYSTEM_PROCESSOR STREQUAL "arm64")
set(BASALT_MARCH_FLAGS "-march=${CXX_MARCH}")
ELSE()
message(STATUS "Running on Apple ${CMAKE_SYSTEM_PROCESSOR}. Disabled -march flag.")
ENDIF()
set(CMAKE_CXX_STANDARD 17)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
@ -239,7 +246,7 @@ endif()
# setup combined compiler flags
set(CMAKE_CXX_FLAGS "${BASALT_CXX_FLAGS} -march=${CXX_MARCH} ${BASALT_PASSED_CXX_FLAGS}")
set(CMAKE_CXX_FLAGS "${BASALT_CXX_FLAGS} ${BASALT_MARCH_FLAGS} ${BASALT_PASSED_CXX_FLAGS}")
set(EIGEN_INCLUDE_DIR_HINTS ${EIGEN_ROOT})

View File

@ -50,7 +50,7 @@ set_target_properties(opengv PROPERTIES
# fix opengv: compile options (CMAKE_CXX_FLAGS is overwritten by Opengv)
target_compile_options(opengv PRIVATE
-Wno-unused-private-field
-march=${CXX_MARCH}
${BASALT_MARCH_FLAGS}
${BASALT_PASSED_CXX_FLAGS})
# TODO: enable once mpark issue is fixed upstream pangolin
@ -69,7 +69,7 @@ endif()
# fix pangolin: macOS >= 10.14 Mojave
if(APPLE AND CMAKE_SYSTEM_VERSION VERSION_GREATER_EQUAL 18.0.0)
target_compile_options(pangolin PRIVATE "-Wno-deprecated-declarations")
target_compile_options(pangolin PRIVATE "-Wno-deprecated-declarations" "-Wno-deprecated-copy")
endif()
# fix pangolin: clang