summaryrefslogtreecommitdiff
path: root/platform/ios
diff options
context:
space:
mode:
Diffstat (limited to 'platform/ios')
-rw-r--r--platform/ios/detect.py22
-rw-r--r--platform/ios/display_layer.mm10
-rw-r--r--platform/ios/display_server_ios.mm4
-rw-r--r--platform/ios/export/export_plugin.cpp1
-rw-r--r--platform/ios/godot_view.mm2
-rw-r--r--platform/ios/os_ios.h2
-rw-r--r--platform/ios/os_ios.mm9
7 files changed, 32 insertions, 18 deletions
diff --git a/platform/ios/detect.py b/platform/ios/detect.py
index 3cfb25cf61..0f277d6b3a 100644
--- a/platform/ios/detect.py
+++ b/platform/ios/detect.py
@@ -39,9 +39,6 @@ def get_flags():
("arch", "arm64"), # Default for convenience.
("tools", False),
("use_volk", False),
- # Disable by default even if production is set, as it makes linking in Xcode
- # on exports very slow and that's not what most users expect.
- ("lto", "none"),
]
@@ -58,22 +55,25 @@ def configure(env):
## Build type
if env["target"].startswith("release"):
- env.Append(CPPDEFINES=["NDEBUG", ("NS_BLOCK_ASSERTIONS", 1)])
+ env.Append(CPPDEFINES=[("NS_BLOCK_ASSERTIONS", 1)])
if env["optimize"] == "speed": # optimize for speed (default)
# `-O2` is more friendly to debuggers than `-O3`, leading to better crash backtraces
# when using `target=release_debug`.
opt = "-O3" if env["target"] == "release" else "-O2"
- env.Append(CCFLAGS=[opt, "-ftree-vectorize", "-fomit-frame-pointer"])
+ env.Append(CCFLAGS=[opt])
env.Append(LINKFLAGS=[opt])
elif env["optimize"] == "size": # optimize for size
- env.Append(CCFLAGS=["-Os", "-ftree-vectorize"])
+ env.Append(CCFLAGS=["-Os"])
env.Append(LINKFLAGS=["-Os"])
elif env["target"] == "debug":
- env.Append(CCFLAGS=["-gdwarf-2", "-O0"])
- env.Append(CPPDEFINES=["_DEBUG", ("DEBUG", 1)])
+ env.Append(CCFLAGS=["-g", "-O0"])
+
+ ## LTO
+
+ if env["lto"] == "auto": # Disable by default as it makes linking in Xcode very slow.
+ env["lto"] = "none"
- # LTO
if env["lto"] != "none":
if env["lto"] == "thin":
env.Append(CCFLAGS=["-flto=thin"])
@@ -120,6 +120,10 @@ def configure(env):
env.Append(CCFLAGS=["-miphoneos-version-min=11.0"])
if env["arch"] == "x86_64":
+ if not env["ios_simulator"]:
+ print("ERROR: Building for iOS with 'arch=x86_64' requires 'ios_simulator=yes'.")
+ sys.exit(255)
+
env["ENV"]["MACOSX_DEPLOYMENT_TARGET"] = "10.9"
env.Append(
CCFLAGS=(
diff --git a/platform/ios/display_layer.mm b/platform/ios/display_layer.mm
index 7c83494768..74c760ae9a 100644
--- a/platform/ios/display_layer.mm
+++ b/platform/ios/display_layer.mm
@@ -89,12 +89,12 @@
// FIXME: Add Vulkan support via MoltenVK. Add fallback code back?
- // Create GL ES 2 context
- if (GLOBAL_GET("rendering/driver/driver_name") == "opengl3") {
- context = [[EAGLContext alloc] initWithAPI:kEAGLRenderingAPIOpenGLES2];
- NSLog(@"Setting up an OpenGL ES 2.0 context.");
+ // Create GL ES 3 context
+ if (GLOBAL_GET("rendering/renderer/rendering_method") == "gl_compatibility") {
+ context = [[EAGLContext alloc] initWithAPI:kEAGLRenderingAPIOpenGLES3];
+ NSLog(@"Setting up an OpenGL ES 3.0 context.");
if (!context) {
- NSLog(@"Failed to create OpenGL ES 2.0 context!");
+ NSLog(@"Failed to create OpenGL ES 3.0 context!");
return;
}
}
diff --git a/platform/ios/display_server_ios.mm b/platform/ios/display_server_ios.mm
index 74d6bc2e97..d3a0f38463 100644
--- a/platform/ios/display_server_ios.mm
+++ b/platform/ios/display_server_ios.mm
@@ -62,7 +62,7 @@ DisplayServerIOS::DisplayServerIOS(const String &p_rendering_driver, WindowMode
// Note that we should be checking "opengl3" as the driver, might never enable this seeing OpenGL is deprecated on iOS
// We are hardcoding the rendering_driver to "vulkan" down below
- if (rendering_driver == "opengl_es") {
+ if (rendering_driver == "opengl3") {
bool gl_initialization_error = false;
// FIXME: Add Vulkan support via MoltenVK. Add fallback code back?
@@ -163,7 +163,7 @@ Vector<String> DisplayServerIOS::get_rendering_drivers_func() {
drivers.push_back("vulkan");
#endif
#if defined(GLES3_ENABLED)
- drivers.push_back("opengl_es");
+ drivers.push_back("opengl3");
#endif
return drivers;
diff --git a/platform/ios/export/export_plugin.cpp b/platform/ios/export/export_plugin.cpp
index 7aacb2de85..74a57dc614 100644
--- a/platform/ios/export/export_plugin.cpp
+++ b/platform/ios/export/export_plugin.cpp
@@ -34,7 +34,6 @@
#include "editor/editor_node.h"
void EditorExportPlatformIOS::get_preset_features(const Ref<EditorExportPreset> &p_preset, List<String> *r_features) const {
- String driver = ProjectSettings::get_singleton()->get("rendering/driver/driver_name");
// Vulkan and OpenGL ES 3.0 both mandate ETC2 support.
r_features->push_back("etc2");
diff --git a/platform/ios/godot_view.mm b/platform/ios/godot_view.mm
index 9ed219508c..ff90c05b1d 100644
--- a/platform/ios/godot_view.mm
+++ b/platform/ios/godot_view.mm
@@ -74,7 +74,7 @@ static const float earth_gravity = 9.80665;
if ([driverName isEqualToString:@"vulkan"]) {
layer = [GodotMetalLayer layer];
- } else if ([driverName isEqualToString:@"opengl_es"]) {
+ } else if ([driverName isEqualToString:@"opengl3"]) {
if (@available(iOS 13, *)) {
NSLog(@"OpenGL ES is deprecated on iOS 13");
}
diff --git a/platform/ios/os_ios.h b/platform/ios/os_ios.h
index 3b88f53b6a..00d91da771 100644
--- a/platform/ios/os_ios.h
+++ b/platform/ios/os_ios.h
@@ -100,6 +100,8 @@ public:
virtual Error get_dynamic_library_symbol_handle(void *p_library_handle, const String p_name, void *&p_symbol_handle, bool p_optional = false) override;
virtual String get_name() const override;
+ virtual String get_distribution_name() const override;
+ virtual String get_version() const override;
virtual String get_model_name() const override;
virtual Error shell_open(String p_uri) override;
diff --git a/platform/ios/os_ios.mm b/platform/ios/os_ios.mm
index b9d186f355..a674498620 100644
--- a/platform/ios/os_ios.mm
+++ b/platform/ios/os_ios.mm
@@ -240,6 +240,15 @@ String OS_IOS::get_name() const {
return "iOS";
}
+String OS_IOS::get_distribution_name() const {
+ return get_name();
+}
+
+String OS_IOS::get_version() const {
+ NSOperatingSystemVersion ver = [NSProcessInfo processInfo].operatingSystemVersion;
+ return vformat("%d.%d.%d", (int64_t)ver.majorVersion, (int64_t)ver.minorVersion, (int64_t)ver.patchVersion);
+}
+
String OS_IOS::get_model_name() const {
String model = ios->get_model();
if (model != "") {