Skip to content

Export -march=native for Clang and prevent it from being included during cross compilation. #2416

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

Merged
merged 1 commit into from
Sep 10, 2018
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
15 changes: 3 additions & 12 deletions cmake/pcl_find_sse.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -4,18 +4,9 @@ macro(PCL_CHECK_FOR_SSE)
set(SSE_FLAGS)
set(SSE_DEFINITIONS)

# Test CLANG
#if(CMAKE_COMPILER_IS_CLANG)
# if(APPLE)
# SET(SSE_FLAGS "${SSE_FLAGS} -march=native")
# endif(APPLE)
#endif(CMAKE_COMPILER_IS_CLANG)

# Test GCC/G++
if(CMAKE_COMPILER_IS_GNUCC OR CMAKE_COMPILER_IS_GNUCXX)
execute_process(COMMAND ${CMAKE_CXX_COMPILER} "-dumpversion"
OUTPUT_VARIABLE GCC_VERSION_STRING)
if(GCC_VERSION_STRING VERSION_GREATER 4.2 AND NOT APPLE AND NOT CMAKE_CROSSCOMPILING)
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")
message(STATUS "Using CPU native flags for SSE optimization: ${SSE_FLAGS}")
endif()
Expand Down