From 20eea021c6558e391c1b95316845dd5bdfad73ff Mon Sep 17 00:00:00 2001 From: Joel Linn Date: Sat, 12 Jun 2021 01:25:40 +0200 Subject: [PATCH] Windows: set HAVE_IMMINTRIN_H for AVX intrinsics --- CMakeLists.txt | 1 + include/SDL_config_windows.h | 5 ++++- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index ee7da4154..665bca6e8 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -773,6 +773,7 @@ if(ASSEMBLY) set(HAVE_SSE TRUE) set(HAVE_SSE2 TRUE) set(HAVE_SSE3 TRUE) + check_include_file("immintrin.h" HAVE_IMMINTRIN_H) set(SDL_ASSEMBLY_ROUTINES 1) endif() endif() diff --git a/include/SDL_config_windows.h b/include/SDL_config_windows.h index 1c838f856..ec7f3f2d7 100644 --- a/include/SDL_config_windows.h +++ b/include/SDL_config_windows.h @@ -84,7 +84,10 @@ typedef unsigned int uintptr_t; #define HAVE_XINPUT_H 1 #define HAVE_MMDEVICEAPI_H 1 #define HAVE_AUDIOCLIENT_H 1 -#define HAVE_SENSORSAPI_H +#define HAVE_SENSORSAPI_H 1 +#if defined(_M_IX86) || defined(_M_X64) || defined(_M_AMD64) +#define HAVE_IMMINTRIN_H 1 +#endif /* This is disabled by default to avoid C runtime dependencies and manifest requirements */ #ifdef HAVE_LIBC