[godot] Fix iOS build error with Vulkan headers and C++ modules

Adds compiler flag -Wno-error=module-import-in-extern-c to suppress compilation errors when building for iOS with newer Xcode versions. The Vulkan headers include stdint.h inside extern "C" blocks, which conflicts with C++ modules.

The fix is applied via a patch file during setup.sh execution.
This commit is contained in:
Mario Zechner 2025-11-19 09:45:43 +01:00
parent 368f46d68e
commit 2af04b6eee
2 changed files with 22 additions and 0 deletions

View File

@ -0,0 +1,14 @@
diff --git a/platform/ios/detect.py b/platform/ios/detect.py
index 53b367a0a7..aea9424abe 100644
--- a/platform/ios/detect.py
+++ b/platform/ios/detect.py
@@ -144,6 +144,9 @@ def configure(env: "SConsEnvironment"):
# Temp fix for ABS/MAX/MIN macros in iOS SDK blocking compilation
env.Append(CCFLAGS=["-Wno-ambiguous-macro"])
+ # Fix for C++ module imports in extern "C" blocks in Vulkan headers
+ env.Append(CCFLAGS=["-Wno-error=module-import-in-extern-c"])
+
env.Prepend(
CPPPATH=[
"$IOS_SDK_PATH/usr/include",

View File

@ -70,6 +70,14 @@ if [ "$branch" = "4.3-stable" ]; then
popd
fi
# Apply iOS Vulkan fix for C++ module imports in extern "C" blocks
# This fixes compilation errors with newer Xcode versions
pushd godot
if [ -f ../build/ios-vulkan-fix.patch ]; then
git apply ../build/ios-vulkan-fix.patch
fi
popd
popd
# Generate compile_commands.json for IDE integration (only in dev mode)