mirror of https://github.com/OpenTTD/OpenTTD
Codechange: [OSX] Prevent the compiler from using SSE4 instructions unless we want to.
This improves compatibility on older systems. We don't need to disable anything older, as there are no SSE2-only Macs.pull/8477/head
parent
8596b43b2b
commit
5b1fb94240
|
@ -127,6 +127,18 @@ macro(compile_flags)
|
||||||
"$<$<BOOL:${LIFETIME_DSE_FOUND}>:-flifetime-dse=1>"
|
"$<$<BOOL:${LIFETIME_DSE_FOUND}>:-flifetime-dse=1>"
|
||||||
)
|
)
|
||||||
endif()
|
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")
|
elseif(CMAKE_CXX_COMPILER_ID STREQUAL "Intel")
|
||||||
add_compile_options(
|
add_compile_options(
|
||||||
-Wall
|
-Wall
|
||||||
|
|
Loading…
Reference in New Issue