summaryrefslogtreecommitdiff
path: root/platform
diff options
context:
space:
mode:
Diffstat (limited to 'platform')
-rw-r--r--platform/android/detect.py24
-rw-r--r--platform/android/export/export_plugin.cpp8
-rw-r--r--platform/iphone/detect.py1
-rw-r--r--platform/javascript/detect.py1
-rw-r--r--platform/linuxbsd/detect.py1
-rw-r--r--platform/linuxbsd/freedesktop_screensaver.cpp4
-rw-r--r--platform/osx/detect.py1
-rw-r--r--platform/osx/display_server_osx.mm4
-rw-r--r--platform/uwp/detect.py1
-rw-r--r--platform/windows/detect.py2
10 files changed, 25 insertions, 22 deletions
diff --git a/platform/android/detect.py b/platform/android/detect.py
index 61ccad9ac3..6b0c60fe8b 100644
--- a/platform/android/detect.py
+++ b/platform/android/detect.py
@@ -27,8 +27,7 @@ def get_opts():
("ANDROID_NDK_ROOT", "Path to the Android NDK", get_android_ndk_root()),
("ANDROID_SDK_ROOT", "Path to the Android SDK", get_android_sdk_root()),
("ndk_platform", 'Target platform (android-<api>, e.g. "android-24")', "android-24"),
- EnumVariable("android_arch", "Target architecture", "armv7", ("armv7", "arm64v8", "x86", "x86_64")),
- BoolVariable("android_neon", "Enable NEON support (armv7 only)", True),
+ EnumVariable("android_arch", "Target architecture", "arm64v8", ("armv7", "arm64v8", "x86", "x86_64")),
]
@@ -143,10 +142,7 @@ def configure(env):
if env["android_arch"] not in ["armv7", "arm64v8", "x86", "x86_64"]:
env["android_arch"] = "armv7"
- neon_text = ""
- if env["android_arch"] == "armv7" and env["android_neon"]:
- neon_text = " (with NEON)"
- print("Building for Android, platform " + env["ndk_platform"] + " (" + env["android_arch"] + ")" + neon_text)
+ print("Building for Android, platform " + env["ndk_platform"] + " (" + env["android_arch"] + ")")
can_vectorize = True
if env["android_arch"] == "x86":
@@ -174,10 +170,7 @@ def configure(env):
target_subpath = "arm-linux-androideabi-4.9"
abi_subpath = "arm-linux-androideabi"
arch_subpath = "armeabi-v7a"
- if env["android_neon"]:
- env.extra_suffix = ".armv7.neon" + env.extra_suffix
- else:
- env.extra_suffix = ".armv7" + env.extra_suffix
+ env.extra_suffix = ".armv7" + env.extra_suffix
elif env["android_arch"] == "arm64v8":
if get_platform(env["ndk_platform"]) < 21:
print(
@@ -210,6 +203,7 @@ def configure(env):
env.Append(LINKFLAGS=["-O0"])
env.Append(CCFLAGS=["-O0", "-g", "-fno-limit-debug-info"])
env.Append(CPPDEFINES=["_DEBUG", "DEBUG_ENABLED"])
+ env.Append(CPPDEFINES=["DEV_ENABLED"])
env.Append(CPPFLAGS=["-UNDEBUG"])
# Compiler configuration
@@ -288,7 +282,6 @@ def configure(env):
if get_platform(env["ndk_platform"]) >= 24:
env.Append(CPPDEFINES=[("_FILE_OFFSET_BITS", 64)])
- env["neon_enabled"] = False
if env["android_arch"] == "x86":
target_opts = ["-target", "i686-none-linux-android"]
# The NDK adds this if targeting API < 21, so we can drop it when Godot targets it at least
@@ -301,12 +294,9 @@ def configure(env):
target_opts = ["-target", "armv7-none-linux-androideabi"]
env.Append(CCFLAGS="-march=armv7-a -mfloat-abi=softfp".split())
env.Append(CPPDEFINES=["__ARM_ARCH_7__", "__ARM_ARCH_7A__"])
- if env["android_neon"]:
- env["neon_enabled"] = True
- env.Append(CCFLAGS=["-mfpu=neon"])
- env.Append(CPPDEFINES=["__ARM_NEON__"])
- else:
- env.Append(CCFLAGS=["-mfpu=vfpv3-d16"])
+ # Enable ARM NEON instructions to compile more optimized code.
+ env.Append(CCFLAGS=["-mfpu=neon"])
+ env.Append(CPPDEFINES=["__ARM_NEON__"])
elif env["android_arch"] == "arm64v8":
target_opts = ["-target", "aarch64-none-linux-android"]
diff --git a/platform/android/export/export_plugin.cpp b/platform/android/export/export_plugin.cpp
index 727ce0ae46..6ef17faf06 100644
--- a/platform/android/export/export_plugin.cpp
+++ b/platform/android/export/export_plugin.cpp
@@ -1644,10 +1644,12 @@ void EditorExportPlatformAndroid::get_export_options(List<ExportOption> *r_optio
}
plugins_changed.clear();
- Vector<String> abis = get_abis();
+ const Vector<String> abis = get_abis();
for (int i = 0; i < abis.size(); ++i) {
- String abi = abis[i];
- bool is_default = (abi == "armeabi-v7a" || abi == "arm64-v8a");
+ const String abi = abis[i];
+ // All Android devices supporting Vulkan run 64-bit Android,
+ // so there is usually no point in exporting for 32-bit Android.
+ const bool is_default = abi == "arm64-v8a";
r_options->push_back(ExportOption(PropertyInfo(Variant::BOOL, "architectures/" + abi), is_default));
}
diff --git a/platform/iphone/detect.py b/platform/iphone/detect.py
index 05e24c5003..3c6453ff9b 100644
--- a/platform/iphone/detect.py
+++ b/platform/iphone/detect.py
@@ -59,6 +59,7 @@ def configure(env):
elif env["target"] == "debug":
env.Append(CCFLAGS=["-gdwarf-2", "-O0"])
env.Append(CPPDEFINES=["_DEBUG", ("DEBUG", 1), "DEBUG_ENABLED"])
+ env.Append(CPPDEFINES=["DEV_ENABLED"])
if env["use_lto"]:
env.Append(CCFLAGS=["-flto"])
diff --git a/platform/javascript/detect.py b/platform/javascript/detect.py
index 173b558b6d..9494ab6fa5 100644
--- a/platform/javascript/detect.py
+++ b/platform/javascript/detect.py
@@ -82,6 +82,7 @@ def configure(env):
env.Append(LINKFLAGS=["--profiling-funcs"])
else: # "debug"
env.Append(CPPDEFINES=["DEBUG_ENABLED"])
+ env.Append(CPPDEFINES=["DEV_ENABLED"])
env.Append(CCFLAGS=["-O1", "-g"])
env.Append(LINKFLAGS=["-O1", "-g"])
env["use_assertions"] = True
diff --git a/platform/linuxbsd/detect.py b/platform/linuxbsd/detect.py
index 8eb22c1c72..afb7c7b2ab 100644
--- a/platform/linuxbsd/detect.py
+++ b/platform/linuxbsd/detect.py
@@ -113,6 +113,7 @@ def configure(env):
elif env["target"] == "debug":
env.Prepend(CCFLAGS=["-g3"])
env.Prepend(CPPDEFINES=["DEBUG_ENABLED"])
+ env.Prepend(CPPDEFINES=["DEV_ENABLED"])
env.Append(LINKFLAGS=["-rdynamic"])
## Architecture
diff --git a/platform/linuxbsd/freedesktop_screensaver.cpp b/platform/linuxbsd/freedesktop_screensaver.cpp
index a6a3b27d76..3973d43d49 100644
--- a/platform/linuxbsd/freedesktop_screensaver.cpp
+++ b/platform/linuxbsd/freedesktop_screensaver.cpp
@@ -50,6 +50,7 @@ void FreeDesktopScreenSaver::inhibit() {
DBusConnection *bus = dbus_bus_get(DBUS_BUS_SESSION, &error);
if (dbus_error_is_set(&error)) {
+ dbus_error_free(&error);
unsupported = true;
return;
}
@@ -72,6 +73,7 @@ void FreeDesktopScreenSaver::inhibit() {
DBusMessage *reply = dbus_connection_send_with_reply_and_block(bus, message, 50, &error);
dbus_message_unref(message);
if (dbus_error_is_set(&error)) {
+ dbus_error_free(&error);
dbus_connection_unref(bus);
unsupported = false;
return;
@@ -96,6 +98,7 @@ void FreeDesktopScreenSaver::uninhibit() {
DBusConnection *bus = dbus_bus_get(DBUS_BUS_SESSION, &error);
if (dbus_error_is_set(&error)) {
+ dbus_error_free(&error);
unsupported = true;
return;
}
@@ -110,6 +113,7 @@ void FreeDesktopScreenSaver::uninhibit() {
DBusMessage *reply = dbus_connection_send_with_reply_and_block(bus, message, 50, &error);
if (dbus_error_is_set(&error)) {
+ dbus_error_free(&error);
dbus_connection_unref(bus);
unsupported = true;
return;
diff --git a/platform/osx/detect.py b/platform/osx/detect.py
index 6b25daf05d..10cf2b591e 100644
--- a/platform/osx/detect.py
+++ b/platform/osx/detect.py
@@ -64,6 +64,7 @@ def configure(env):
elif env["target"] == "debug":
env.Prepend(CCFLAGS=["-g3"])
env.Prepend(CPPDEFINES=["DEBUG_ENABLED"])
+ env.Prepend(CPPDEFINES=["DEV_ENABLED"])
env.Prepend(LINKFLAGS=["-Xlinker", "-no_deduplicate"])
## Architecture
diff --git a/platform/osx/display_server_osx.mm b/platform/osx/display_server_osx.mm
index da6c45793a..3fe055a511 100644
--- a/platform/osx/display_server_osx.mm
+++ b/platform/osx/display_server_osx.mm
@@ -3014,7 +3014,7 @@ void DisplayServerOSX::cursor_set_custom_image(const RES &p_cursor, CursorShape
ERR_FAIL_COND(!image.is_valid());
NSBitmapImageRep *imgrep = [[NSBitmapImageRep alloc]
- initWithBitmapDataPlanes:NULL
+ initWithBitmapDataPlanes:nullptr
pixelsWide:int(texture_size.width)
pixelsHigh:int(texture_size.height)
bitsPerSample:8
@@ -3418,7 +3418,7 @@ void DisplayServerOSX::set_icon(const Ref<Image> &p_icon) {
img = img->duplicate();
img->convert(Image::FORMAT_RGBA8);
NSBitmapImageRep *imgrep = [[NSBitmapImageRep alloc]
- initWithBitmapDataPlanes:NULL
+ initWithBitmapDataPlanes:nullptr
pixelsWide:img->get_width()
pixelsHigh:img->get_height()
bitsPerSample:8
diff --git a/platform/uwp/detect.py b/platform/uwp/detect.py
index 28922a4f59..f31b43cd49 100644
--- a/platform/uwp/detect.py
+++ b/platform/uwp/detect.py
@@ -72,6 +72,7 @@ def configure(env):
env.Append(CCFLAGS=["/Zi"])
env.Append(CCFLAGS=["/MDd"])
env.Append(CPPDEFINES=["DEBUG_ENABLED"])
+ env.Append(CPPDEFINES=["DEV_ENABLED"])
env.Append(LINKFLAGS=["/SUBSYSTEM:CONSOLE"])
env.AppendUnique(CPPDEFINES=["WINDOWS_SUBSYSTEM_CONSOLE"])
env.Append(LINKFLAGS=["/DEBUG"])
diff --git a/platform/windows/detect.py b/platform/windows/detect.py
index 3961480d23..6f99368e99 100644
--- a/platform/windows/detect.py
+++ b/platform/windows/detect.py
@@ -208,6 +208,7 @@ def configure_msvc(env, manual_msvc_config):
elif env["target"] == "debug":
env.AppendUnique(CCFLAGS=["/Zi", "/FS", "/Od", "/EHsc"])
env.AppendUnique(CPPDEFINES=["DEBUG_ENABLED"])
+ env.AppendUnique(CPPDEFINES=["DEV_ENABLED"])
env.Append(LINKFLAGS=["/DEBUG"])
if env["debug_symbols"]:
@@ -362,6 +363,7 @@ def configure_mingw(env):
elif env["target"] == "debug":
env.Append(CCFLAGS=["-g3"])
env.Append(CPPDEFINES=["DEBUG_ENABLED"])
+ env.Append(CPPDEFINES=["DEV_ENABLED"])
if env["windows_subsystem"] == "gui":
env.Append(LINKFLAGS=["-Wl,--subsystem,windows"])