mirror of
https://github.com/Ryujinx/SDL.git
synced 2025-06-20 18:37:52 +00:00
cmake: add support for building with Intel C compiler
This commit is contained in:
parent
977781d3f4
commit
e5ebbdafd4
|
@ -207,7 +207,7 @@ else()
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
# Compiler info
|
# Compiler info
|
||||||
if(CMAKE_C_COMPILER_ID MATCHES "Clang")
|
if(CMAKE_C_COMPILER_ID MATCHES "Clang|IntelLLVM")
|
||||||
set(USE_CLANG TRUE)
|
set(USE_CLANG TRUE)
|
||||||
set(OPT_DEF_ASM TRUE)
|
set(OPT_DEF_ASM TRUE)
|
||||||
# Visual Studio 2019 v16.2 added support for Clang/LLVM.
|
# Visual Studio 2019 v16.2 added support for Clang/LLVM.
|
||||||
|
@ -221,11 +221,14 @@ elseif(CMAKE_COMPILER_IS_GNUCC)
|
||||||
elseif(MSVC_VERSION GREATER 1400) # VisualStudio 8.0+
|
elseif(MSVC_VERSION GREATER 1400) # VisualStudio 8.0+
|
||||||
set(OPT_DEF_ASM TRUE)
|
set(OPT_DEF_ASM TRUE)
|
||||||
#set(CMAKE_C_FLAGS "/ZI /WX- /
|
#set(CMAKE_C_FLAGS "/ZI /WX- /
|
||||||
|
elseif(CMAKE_C_COMPILER_ID MATCHES "^Intel$")
|
||||||
|
set(OPT_DEF_ASM TRUE)
|
||||||
|
set(USE_INTELCC TRUE)
|
||||||
else()
|
else()
|
||||||
set(OPT_DEF_ASM FALSE)
|
set(OPT_DEF_ASM FALSE)
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
if(USE_GCC OR USE_CLANG)
|
if(USE_GCC OR USE_CLANG OR USE_INTELCC)
|
||||||
set(OPT_DEF_GCC_ATOMICS ON)
|
set(OPT_DEF_GCC_ATOMICS ON)
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
|
@ -551,7 +554,7 @@ if(NOT SDL_FOREGROUNDING_SIGNAL STREQUAL "OFF")
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
# Compiler option evaluation
|
# Compiler option evaluation
|
||||||
if(USE_GCC OR USE_CLANG)
|
if(USE_GCC OR USE_CLANG OR USE_INTELCC)
|
||||||
# Check for -Wall first, so later things can override pieces of it.
|
# Check for -Wall first, so later things can override pieces of it.
|
||||||
# Note: clang-cl treats -Wall as -Weverything (which is very loud),
|
# Note: clang-cl treats -Wall as -Weverything (which is very loud),
|
||||||
# /W3 as -Wall, and /W4 as -Wall -Wextra. So: /W3 is enough.
|
# /W3 as -Wall, and /W4 as -Wall -Wextra. So: /W3 is enough.
|
||||||
|
@ -689,7 +692,7 @@ if(CMAKE_C_COMPILER_ID STREQUAL "MSVC")
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
if(SDL_ASSEMBLY)
|
if(SDL_ASSEMBLY)
|
||||||
if(USE_GCC OR USE_CLANG)
|
if(USE_GCC OR USE_CLANG OR USE_INTELCC)
|
||||||
# TODO: Those all seem to be quite GCC specific - needs to be
|
# TODO: Those all seem to be quite GCC specific - needs to be
|
||||||
# reworked for better compiler support
|
# reworked for better compiler support
|
||||||
set(HAVE_ASSEMBLY TRUE)
|
set(HAVE_ASSEMBLY TRUE)
|
||||||
|
@ -2939,7 +2942,7 @@ if(SDL_WERROR)
|
||||||
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} /WX")
|
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} /WX")
|
||||||
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /WX")
|
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /WX")
|
||||||
endif()
|
endif()
|
||||||
elseif(USE_GCC OR USE_CLANG)
|
elseif(USE_GCC OR USE_CLANG OR USE_INTELCC)
|
||||||
cmake_push_check_state(RESET)
|
cmake_push_check_state(RESET)
|
||||||
check_c_compiler_flag(-Werror HAVE_WERROR)
|
check_c_compiler_flag(-Werror HAVE_WERROR)
|
||||||
if(HAVE_WERROR)
|
if(HAVE_WERROR)
|
||||||
|
|
Loading…
Reference in a new issue