cmake: we only need a C++ compiler for Android, Haiku and UWP

Our CMake script does (currently) not support NGage, Xbox One, or Xbox Series.
This commit is contained in:
Anonymous Maarten 2024-03-10 23:57:24 +01:00
parent fde420a645
commit b5eb704fa8
3 changed files with 5 additions and 2 deletions

View File

@ -8,7 +8,7 @@ endif()
set(CMAKE_POLICY_DEFAULT_CMP0091 NEW)
# See docs/release_checklist.md
project(SDL3 LANGUAGES C CXX VERSION "3.0.0")
project(SDL3 LANGUAGES C VERSION "3.0.0")
if(CMAKE_SOURCE_DIR STREQUAL PROJECT_SOURCE_DIR)
set(SDL3_SUBPROJECT OFF)
@ -1788,6 +1788,7 @@ elseif(WINDOWS)
sdl_glob_sources("${SDL3_SOURCE_DIR}/src/core/windows/*.c")
if(WINDOWS_STORE)
enable_language(CXX)
sdl_glob_sources(
"${SDL3_SOURCE_DIR}/src/core/winrt/*.c"
"${SDL3_SOURCE_DIR}/src/core/winrt/*.cpp"
@ -2357,6 +2358,7 @@ elseif(APPLE)
endif()
elseif(HAIKU)
enable_language(CXX)
if(SDL_AUDIO)
set(SDL_AUDIO_DRIVER_HAIKU 1)
sdl_glob_sources("${SDL3_SOURCE_DIR}/src/audio/haiku/*.cc")

View File

@ -25,7 +25,7 @@ not_ok () {
failed=1
}
version=$(sed -Ene 's/^project\(SDL[0-9]+ LANGUAGES C CXX VERSION "([0-9.]*)"\)$/\1/p' CMakeLists.txt)
version=$(sed -Ene 's/^project\(SDL[0-9]+ LANGUAGES C VERSION "([0-9.]*)"\)$/\1/p' CMakeLists.txt)
if [ "$ref_version" = "$version" ]; then
ok "CMakeLists.txt $version"

View File

@ -1068,6 +1068,7 @@ macro(CheckHIDAPI)
if(HAVE_HIDAPI)
if(ANDROID)
enable_language(CXX)
sdl_sources("${SDL3_SOURCE_DIR}/src/hidapi/android/hid.cpp")
endif()
if(IOS OR TVOS)