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

Codechange: [OSX] Prevent the compiler from using SSE4 instructions unless we want to. #8476

Merged
merged 1 commit into from Jan 2, 2021
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
12 changes: 12 additions & 0 deletions cmake/CompileFlags.cmake
Expand Up @@ -127,6 +127,18 @@ macro(compile_flags)
"$<$<BOOL:${LIFETIME_DSE_FOUND}>:-flifetime-dse=1>"
)
endif()

if(CMAKE_CXX_COMPILER_ID STREQUAL "AppleClang")
include(CheckCXXCompilerFlag)
check_cxx_compiler_flag("-mno-sse4" NO_SSE4_FOUND)

if(NO_SSE4_FOUND)
add_compile_options(
# Don't use SSE4 for general sources to increase compatibility.
-mno-sse4
)
endif()
endif()
elseif(CMAKE_CXX_COMPILER_ID STREQUAL "Intel")
add_compile_options(
-Wall
Expand Down