From c14f47433ad4a49e9c3805696d456f2ef440e370 Mon Sep 17 00:00:00 2001 From: Michael Johnson Date: Wed, 27 May 2026 15:44:50 +0100 Subject: [PATCH] Removed -march=native flag This flag propogates to all users of the library which makes them non-portable. Users of the library can still enable this flag if they wish. The binary sets the flag privately. --- CMakeLists.txt | 3 +-- apps/texrecon/CMakeLists.txt | 1 + 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index f0006c0a..f9f03ccd 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -28,8 +28,7 @@ if(OPENMP_FOUND) endif() if(CMAKE_COMPILER_IS_GNUCXX) - set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -march=native -Wall -Wextra -Wundef -pedantic") - set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -mfpmath=sse -funroll-loops") + set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall -Wextra -Wundef -pedantic -funroll-loops") endif() find_package(PNG REQUIRED) diff --git a/apps/texrecon/CMakeLists.txt b/apps/texrecon/CMakeLists.txt index 98f9e0f2..86da5b2b 100644 --- a/apps/texrecon/CMakeLists.txt +++ b/apps/texrecon/CMakeLists.txt @@ -4,6 +4,7 @@ file (GLOB SOURCES "[^_]*.cpp") set(BIN texrecon) add_executable(${BIN} ${SOURCES}) +target_compile_options(${BIN} PRIVATE -march=native) set_property(TARGET ${BIN} PROPERTY INTERPROCEDURAL_OPTIMIZATION True) add_dependencies(${BIN} ext_mve) target_link_libraries(${BIN} tex ${TBB_LIBRARIES} -lmve -lmve_util)