mirror of
https://github.com/OpenTTD/OpenTTD.git
synced 2025-02-10 08:17:05 +00:00
18 lines
639 B
CMake
18 lines
639 B
CMake
|
# Autodetect if SSE4.1 can be used. If so, the assumption is, so can the other
|
||
|
# SSE version (SSE 2.0, SSSE 3.0).
|
||
|
|
||
|
include(CheckCXXSourceCompiles)
|
||
|
set(CMAKE_REQUIRED_FLAGS "")
|
||
|
|
||
|
if (CMAKE_CXX_COMPILER_ID STREQUAL "GNU" OR CMAKE_CXX_COMPILER_ID STREQUAL "Clang" OR CMAKE_CXX_COMPILER_ID STREQUAL "AppleClang")
|
||
|
set(CMAKE_REQUIRED_FLAGS "-msse4.1")
|
||
|
endif (CMAKE_CXX_COMPILER_ID STREQUAL "GNU" OR CMAKE_CXX_COMPILER_ID STREQUAL "Clang" OR CMAKE_CXX_COMPILER_ID STREQUAL "AppleClang")
|
||
|
|
||
|
check_cxx_source_compiles("
|
||
|
#include <xmmintrin.h>
|
||
|
#include <smmintrin.h>
|
||
|
#include <tmmintrin.h>
|
||
|
int main() { return 0; }"
|
||
|
SSE_FOUND
|
||
|
)
|