Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use -mtune instead of -march on non-x86 CPUs #2868

Merged
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 7 additions & 1 deletion cmake/pcl_find_sse.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,13 @@ macro(PCL_CHECK_FOR_SSE)
if(NOT CMAKE_CROSSCOMPILING)
# Test GCC/G++ and CLANG
if(CMAKE_COMPILER_IS_GNUCC OR CMAKE_COMPILER_IS_GNUCXX OR CMAKE_COMPILER_IS_CLANG)
list(APPEND SSE_FLAGS "-march=native")
include(CheckCXXCompilerFlag)
check_cxx_compiler_flag("-march=native" HAVE_MARCH)
if(HAVE_MARCH)
list(APPEND SSE_FLAGS "-march=native")
else()
list(APPEND SSE_FLAGS "-mtune=native")
endif()
message(STATUS "Using CPU native flags for SSE optimization: ${SSE_FLAGS}")
endif()
endif()
Expand Down