New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
CMake < 3.14: set IOS variable to 1? #4635
Comments
Maybe something like this, even if it's a little bit cumbersome: ...
elseif(APPLE)
if(CMAKE_SYSTEM_NAME MATCHES ".*Darwin.*")
set(DARWIN TRUE)
elseif(CMAKE_SYSTEM_NAME MATCHES ".*MacOS.*")
set(MACOSX TRUE)
elseif(CMAKE_SYSTEM_NAME MATCHES ".*tvOS.*")
set(TVOS TRUE)
elseif(CMAKE_SYSTEM_NAME MATCHES ".*iOS.*")
# could be set unconditionally, it's just a reminder to remove this logic if CMake min version is bumped to 3.14
if(CMAKE_VERSION VERSION_LESS 3.14)
set(IOS TRUE)
endif()
endif()
# what about watchOS?
... |
...are all of these necessary? If this isn't causing a problem beyond the missing IOS variable, I'd rather not bulk this up as a defensive measure. (if we need them explicitly set, though, then yeah, let's do it.) |
Generally speaking, we should not dispatch platforms inside CMake project since Apple's recommendation is feature detection macros (Macro itself still have versioning issue though: #4475 ). It seems current SDL2 codebase largely follows this.
IMHO we should follow CMake upstream thus we can depend on |
In CMakeLists, there is a lot of logic based on
IOS
variable, but this variable is never set to 1 whenCMAKE_SYSTEM_NAME
isiOS
.CMake does that automatically, but only since 3.14: https://cmake.org/cmake/help/latest/variable/IOS.html
In the meantime, CMake min version in sdl CMakeLists is 3.0.0, so I think that it should still be handled manually in CMakeLists.
The text was updated successfully, but these errors were encountered: