leetal / ios-cmake

A CMake toolchain file for iOS/iPadOS, visionOS, macOS, watchOS & tvOS C/C++/Obj-C++ development
BSD 3-Clause "New" or "Revised" License
1.89k stars 448 forks source link

Missing variable `CMAKE_OBJC_COMPILE_OBJECT` #138

Closed glebm closed 2 years ago

glebm commented 2 years ago

iOS build of SDL2 master with this toolchain fails with the following error if enable_language(OBJC) is used:

CMake Error: Error required internal CMake variable not set, cmake may not be built correctly.
Missing variable is:
CMAKE_OBJC_COMPILE_OBJECT

It can be worked around by removing enable_language(OBJC) on iOS and skipping check_objc_source_compiles checks (https://github.com/libsdl-org/SDL/pull/5453).

I'm not sure whether this is a bug in SDL2, ios-cmake, or cmake itself.

leetal commented 2 years ago

139 Provides a patch for the toolchain to better align with the updated CMake handling of enable_language() directives. I'll look into either adding support via a switch, or migrating this into the toolchain in a way that does not compromise backwards compatibility.

glebm commented 2 years ago

Thanks @leetal, I'll try out the patch and will let you know if it indeed fixes this issue