summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--SConstruct4
-rw-r--r--core/os/os.cpp4
-rw-r--r--core/os/os.h2
-rw-r--r--core/os/pool_allocator.cpp8
-rw-r--r--doc/classes/QuadMesh.xml1
-rw-r--r--drivers/unix/os_unix.cpp5
-rw-r--r--drivers/unix/os_unix.h1
-rw-r--r--main/main.cpp6
-rw-r--r--misc/dist/ios_xcode/godot_ios.xcodeproj/project.pbxproj1
-rw-r--r--modules/denoise/SCsub2
-rw-r--r--modules/raycast/SCsub3
-rw-r--r--platform/android/detect.py8
-rw-r--r--platform/ios/detect.py9
-rw-r--r--platform/macos/detect.py4
-rw-r--r--platform/windows/detect.py1
-rw-r--r--scene/resources/primitive_meshes.h1
16 files changed, 18 insertions, 42 deletions
diff --git a/SConstruct b/SConstruct
index 200e8e5984..b64e0bddd8 100644
--- a/SConstruct
+++ b/SConstruct
@@ -386,6 +386,9 @@ if env_base["target"] == "debug":
# DEV_ENABLED enables *engine developer* code which should only be compiled for those
# working on the engine itself.
env_base.Append(CPPDEFINES=["DEV_ENABLED"])
+else:
+ # Disable assert() for production targets (only used in thirdparty code).
+ env_base.Append(CPPDEFINES=["NDEBUG"])
# SCons speed optimization controlled by the `fast_unsafe` option, which provide
# more than 10 s speed up for incremental rebuilds.
@@ -669,7 +672,6 @@ if selected_platform in platform_list:
print(" Use `tools=no target=release` to build a release export template.")
Exit(255)
suffix += ".opt"
- env.Append(CPPDEFINES=["NDEBUG"])
elif env["target"] == "release_debug":
if env["tools"]:
suffix += ".opt.tools"
diff --git a/core/os/os.cpp b/core/os/os.cpp
index 526b31ae7e..ee8da21751 100644
--- a/core/os/os.cpp
+++ b/core/os/os.cpp
@@ -54,10 +54,6 @@ double OS::get_unix_time() const {
return 0;
}
-void OS::debug_break() {
- // something
-}
-
void OS::_set_logger(CompositeLogger *p_logger) {
if (_logger) {
memdelete(_logger);
diff --git a/core/os/os.h b/core/os/os.h
index 0f79ff1a23..aa45a3b8a8 100644
--- a/core/os/os.h
+++ b/core/os/os.h
@@ -287,8 +287,6 @@ public:
virtual Error move_to_trash(const String &p_path) { return FAILED; }
- virtual void debug_break();
-
virtual int get_exit_code() const;
// `set_exit_code` should only be used from `SceneTree` (or from a similar
// level, e.g. from the `Main::start` if leaving without creating a `SceneTree`).
diff --git a/core/os/pool_allocator.cpp b/core/os/pool_allocator.cpp
index f622e2c7c5..e7f2cff7c5 100644
--- a/core/os/pool_allocator.cpp
+++ b/core/os/pool_allocator.cpp
@@ -35,8 +35,6 @@
#include "core/os/os.h"
#include "core/string/print_string.h"
-#include <assert.h>
-
#define COMPACT_CHUNK(m_entry, m_to_pos) \
do { \
void *_dst = &((unsigned char *)pool)[m_to_pos]; \
@@ -169,11 +167,6 @@ bool PoolAllocator::find_entry_index(EntryIndicesPos *p_map_pos, const Entry *p_
PoolAllocator::ID PoolAllocator::alloc(int p_size) {
ERR_FAIL_COND_V(p_size < 1, POOL_ALLOCATOR_INVALID_ID);
-#ifdef DEBUG_ENABLED
- if (p_size > free_mem) {
- OS::get_singleton()->debug_break();
- }
-#endif
ERR_FAIL_COND_V(p_size > free_mem, POOL_ALLOCATOR_INVALID_ID);
mt_lock();
@@ -482,7 +475,6 @@ void *PoolAllocator::get(ID p_mem) {
ERR_FAIL_COND_V(!e, nullptr);
}
if (e->lock == 0) {
- //assert(0);
mt_unlock();
ERR_PRINT("e->lock == 0");
return nullptr;
diff --git a/doc/classes/QuadMesh.xml b/doc/classes/QuadMesh.xml
index 7469338ef9..b869774601 100644
--- a/doc/classes/QuadMesh.xml
+++ b/doc/classes/QuadMesh.xml
@@ -12,5 +12,6 @@
</tutorials>
<members>
<member name="orientation" type="int" setter="set_orientation" getter="get_orientation" overrides="PlaneMesh" enum="PlaneMesh.Orientation" default="2" />
+ <member name="size" type="Vector2" setter="set_size" getter="get_size" overrides="PlaneMesh" default="Vector2(1, 1)" />
</members>
</class>
diff --git a/drivers/unix/os_unix.cpp b/drivers/unix/os_unix.cpp
index ab298a0e49..c8a42e925e 100644
--- a/drivers/unix/os_unix.cpp
+++ b/drivers/unix/os_unix.cpp
@@ -51,7 +51,6 @@
#include <sys/sysctl.h>
#endif
-#include <assert.h>
#include <dlfcn.h>
#include <errno.h>
#include <poll.h>
@@ -104,10 +103,6 @@ static void _setup_clock() {
}
#endif
-void OS_Unix::debug_break() {
- assert(false);
-}
-
static void handle_interrupt(int sig) {
if (!EngineDebugger::is_active()) {
return;
diff --git a/drivers/unix/os_unix.h b/drivers/unix/os_unix.h
index 8ef650f28b..b35f161524 100644
--- a/drivers/unix/os_unix.h
+++ b/drivers/unix/os_unix.h
@@ -86,7 +86,6 @@ public:
virtual int get_processor_count() const override;
- virtual void debug_break() override;
virtual void initialize_debugging() override;
virtual String get_executable_path() const override;
diff --git a/main/main.cpp b/main/main.cpp
index fa7df8d705..aac77c1625 100644
--- a/main/main.cpp
+++ b/main/main.cpp
@@ -157,6 +157,7 @@ static bool show_help = false;
static bool auto_quit = false;
static OS::ProcessID editor_pid = 0;
#ifdef TOOLS_ENABLED
+static bool found_project = false;
static bool auto_build_solutions = false;
static String debug_server_uri;
static int converter_max_kb_file = 4 * 1024; // 4MB
@@ -707,9 +708,6 @@ Error Main::setup(const char *execpath, int argc, char *argv[], bool p_second_ph
Vector<String> breakpoints;
bool use_custom_res = true;
bool force_res = false;
-#ifdef TOOLS_ENABLED
- bool found_project = false;
-#endif
String default_renderer = "";
String renderer_hints = "";
@@ -1938,7 +1936,7 @@ Error Main::setup2(Thread::ID p_main_tid_override) {
#ifdef TOOLS_ENABLED
if (editor || project_manager || cmdline_tool) {
EditorPaths::create();
- if (EditorPaths::get_singleton()->is_self_contained()) {
+ if (found_project && EditorPaths::get_singleton()->is_self_contained()) {
if (ProjectSettings::get_singleton()->get_resource_path() == OS::get_singleton()->get_executable_path().get_base_dir()) {
ERR_PRINT("You are trying to run a self-contained editor at the same location as a project. This is not allowed, since editor files will mix with project files.");
OS::get_singleton()->set_exit_code(EXIT_FAILURE);
diff --git a/misc/dist/ios_xcode/godot_ios.xcodeproj/project.pbxproj b/misc/dist/ios_xcode/godot_ios.xcodeproj/project.pbxproj
index 467aa3ce83..b58f002f3c 100644
--- a/misc/dist/ios_xcode/godot_ios.xcodeproj/project.pbxproj
+++ b/misc/dist/ios_xcode/godot_ios.xcodeproj/project.pbxproj
@@ -249,7 +249,6 @@
GCC_DYNAMIC_NO_PIC = NO;
GCC_OPTIMIZATION_LEVEL = 0;
GCC_PREPROCESSOR_DEFINITIONS = (
- "DEBUG=1",
"$(inherited)",
);
GCC_SYMBOLS_PRIVATE_EXTERN = NO;
diff --git a/modules/denoise/SCsub b/modules/denoise/SCsub
index 97feea2b44..779ce165d2 100644
--- a/modules/denoise/SCsub
+++ b/modules/denoise/SCsub
@@ -103,9 +103,9 @@ env_oidn.Append(
"__STDC_LIMIT_MACROS",
"DISABLE_VERBOSE",
"MKLDNN_ENABLE_CONCURRENT_EXEC",
- "NDEBUG",
]
)
+env_oidn.AppendUnique(CPPDEFINES=["NDEBUG"]) # No assert() even in debug builds.
env_thirdparty = env_oidn.Clone()
env_thirdparty.disable_warnings()
diff --git a/modules/raycast/SCsub b/modules/raycast/SCsub
index 074795759a..0670c7f468 100644
--- a/modules/raycast/SCsub
+++ b/modules/raycast/SCsub
@@ -63,7 +63,8 @@ if env["builtin_embree"]:
thirdparty_sources = [thirdparty_dir + file for file in embree_src]
env_raycast.Prepend(CPPPATH=[thirdparty_dir, thirdparty_dir + "include"])
- env_raycast.Append(CPPDEFINES=["EMBREE_TARGET_SSE2", "EMBREE_LOWEST_ISA", "TASKING_INTERNAL", "NDEBUG"])
+ env_raycast.Append(CPPDEFINES=["EMBREE_TARGET_SSE2", "EMBREE_LOWEST_ISA", "TASKING_INTERNAL"])
+ env_raycast.AppendUnique(CPPDEFINES=["NDEBUG"]) # No assert() even in debug builds.
if not env.msvc:
if env["arch"] == "x86_64":
diff --git a/platform/android/detect.py b/platform/android/detect.py
index a31bba745f..2ff9cd3dc5 100644
--- a/platform/android/detect.py
+++ b/platform/android/detect.py
@@ -121,16 +121,12 @@ def configure(env):
# `-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, "-fomit-frame-pointer"])
+ env.Append(CCFLAGS=[opt])
elif env["optimize"] == "size": # optimize for size
env.Append(CCFLAGS=["-Oz"])
- env.Append(CPPDEFINES=["NDEBUG"])
- env.Append(CCFLAGS=["-ftree-vectorize"])
elif env["target"] == "debug":
env.Append(LINKFLAGS=["-O0"])
- env.Append(CCFLAGS=["-O0", "-g", "-fno-limit-debug-info"])
- env.Append(CPPDEFINES=["_DEBUG"])
- env.Append(CPPFLAGS=["-UNDEBUG"])
+ env.Append(CCFLAGS=["-O0", "-g"])
# LTO
diff --git a/platform/ios/detect.py b/platform/ios/detect.py
index d5e6ee4b46..0f277d6b3a 100644
--- a/platform/ios/detect.py
+++ b/platform/ios/detect.py
@@ -55,20 +55,19 @@ 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
diff --git a/platform/macos/detect.py b/platform/macos/detect.py
index 834ac935d8..58d9c0e99f 100644
--- a/platform/macos/detect.py
+++ b/platform/macos/detect.py
@@ -88,9 +88,9 @@ def configure(env):
if env["target"] == "release":
if env["optimize"] == "speed": # optimize for speed (default)
- env.Prepend(CCFLAGS=["-O3", "-fomit-frame-pointer", "-ftree-vectorize"])
+ env.Prepend(CCFLAGS=["-O3"])
elif env["optimize"] == "size": # optimize for size
- env.Prepend(CCFLAGS=["-Os", "-ftree-vectorize"])
+ env.Prepend(CCFLAGS=["-Os"])
if env["arch"] != "arm64":
env.Prepend(CCFLAGS=["-msse2"])
diff --git a/platform/windows/detect.py b/platform/windows/detect.py
index 52a959b34a..095d688213 100644
--- a/platform/windows/detect.py
+++ b/platform/windows/detect.py
@@ -350,7 +350,6 @@ def configure_msvc(env, vcvars_msvc_config):
elif env["target"] == "debug":
env.AppendUnique(CCFLAGS=["/Zi", "/FS", "/Od", "/EHsc"])
- # Allow big objects. Only needed for debug, see MinGW branch for rationale.
env.Append(LINKFLAGS=["/DEBUG"])
if env["debug_symbols"]:
diff --git a/scene/resources/primitive_meshes.h b/scene/resources/primitive_meshes.h
index 65823a8f7f..ee61f0ac55 100644
--- a/scene/resources/primitive_meshes.h
+++ b/scene/resources/primitive_meshes.h
@@ -271,6 +271,7 @@ class QuadMesh : public PlaneMesh {
public:
QuadMesh() {
set_orientation(FACE_Z);
+ set_size(Size2(1, 1));
}
};