Skip to content

Commit

Permalink
Merge pull request #2868 from 7680x4320/fix-cmake-find-sse
Browse files Browse the repository at this point in the history
Use -mtune instead of -march on non-x86 CPUs
  • Loading branch information
SergioRAgostinho authored Feb 18, 2019
2 parents 4606e94 + 322fac6 commit 73f6af1
Showing 1 changed file with 7 additions and 1 deletion.
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

0 comments on commit 73f6af1

Please sign in to comment.