Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions binding_generator.py
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ def generate_virtual_version(argcount, const=False, returns=False, required=Fals

sproto = str(argcount)
method_info = ""
method_flags = "METHOD_FLAG_VIRTUAL"
method_flags = "::godot::MethodFlags::METHOD_FLAG_VIRTUAL"
if returns:
sproto += "R"
s = s.replace("$RET", "m_ret,")
Expand All @@ -110,14 +110,14 @@ def generate_virtual_version(argcount, const=False, returns=False, required=Fals

if const:
sproto += "C"
method_flags += " | METHOD_FLAG_CONST"
method_flags += " | ::godot::MethodFlags::METHOD_FLAG_CONST"
s = s.replace("$CONST", "const")
else:
s = s.replace("$CONST ", "")

if required:
sproto += "_REQUIRED"
method_flags += " | METHOD_FLAG_VIRTUAL_REQUIRED"
method_flags += " | ::godot::MethodFlags::METHOD_FLAG_VIRTUAL_REQUIRED"
s = s.replace(
"$REQCHECK",
'ERR_PRINT_ONCE("Required virtual method " + get_class() + "::" + #m_name + " must be overridden before calling.");',
Expand Down
6 changes: 3 additions & 3 deletions cmake/common_compiler_flags.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -66,9 +66,6 @@ function(common_compiler_flags)
# The public flag tells CMake that the following options are transient,
# and will propagate to consumers.
PUBLIC
# Disable exception handling. Godot doesn't use exceptions anywhere, and this
# saves around 20% of binary size and very significant build time.
$<${DISABLE_EXCEPTIONS}:$<${NOT_MSVC}:-fno-exceptions>>

# Enabling Debug Symbols
$<${DEBUG_SYMBOLS}:
Expand All @@ -95,6 +92,9 @@ function(common_compiler_flags)

# Warnings below, these do not need to propagate to consumers.
PRIVATE
# Disable exception handling. Godot doesn't use exceptions anywhere, and this
# saves around 20% of binary size and very significant build time.
$<${DISABLE_EXCEPTIONS}:$<${NOT_MSVC}:-fno-exceptions>>
$<${IS_MSVC}:
/W4 # Warning level 4 (informational) warnings that aren't off by default.

Expand Down
2 changes: 1 addition & 1 deletion cmake/linux.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ function(linux_options)
the docs (https://docs.godotengine.org/en/latest/tutorials/scripting/cpp/build_system/cmake.html)
for examples.
]]
option(GODOTCPP_USE_STATIC_CPP "Link libgcc and libstdc++ statically for better portability" ON)
option(GODOTCPP_USE_STATIC_CPP "Link libgcc and libstdc++ statically for better portability" OFF)
endfunction()

#[===========================[ Target Generation ]===========================]
Expand Down
3 changes: 2 additions & 1 deletion cmake/web.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ function(web_generate)
target_compile_options(
godot-cpp
PUBLIC #
-sSIDE_MODULE
-sSIDE_MODULE=1
-sSUPPORT_LONGJMP=wasm
$<${THREADS_ENABLED}:-sUSE_PTHREADS=1>
)
Expand All @@ -33,6 +33,7 @@ function(web_generate)
-sSUPPORT_LONGJMP=wasm
-fvisibility=hidden
-shared
$<${THREADS_ENABLED}:-sUSE_PTHREADS=1>
)

common_compiler_flags()
Expand Down
6 changes: 3 additions & 3 deletions include/godot_cpp/core/class_db.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ class ClassDB {

private:
// This may only contain custom classes, not Godot classes
static AHashMap<StringName, ClassInfo> classes;
static HashMap<StringName, ClassInfo> classes;
static AHashMap<StringName, const GDExtensionInstanceBindingCallbacks *> instance_binding_callbacks;
// Used to remember the custom class registration order.
static LocalVector<StringName> class_register_order;
Expand Down Expand Up @@ -231,7 +231,7 @@ void ClassDB::_register_class(bool p_virtual, bool p_exposed, bool p_runtime) {
cl.name = T::get_class_static();
cl.parent_name = T::get_parent_class_static();
cl.level = current_level;
AHashMap<StringName, ClassInfo>::Iterator parent_it = classes.find(cl.parent_name);
HashMap<StringName, ClassInfo>::Iterator parent_it = classes.find(cl.parent_name);
if (parent_it != classes.end()) {
// Assign parent if it is also a custom class
cl.parent_ptr = &parent_it->value;
Expand Down Expand Up @@ -328,7 +328,7 @@ MethodBind *ClassDB::bind_vararg_method(uint32_t p_flags, StringName p_name, M p

StringName instance_type = bind->get_instance_class();

AHashMap<StringName, ClassInfo>::Iterator type_it = classes.find(instance_type);
HashMap<StringName, ClassInfo>::Iterator type_it = classes.find(instance_type);
if (type_it == classes.end()) {
memdelete(bind);
ERR_FAIL_V_MSG(nullptr, String("Class '{0}' doesn't exist.").format(Array::make(instance_type)));
Expand Down
14 changes: 7 additions & 7 deletions src/core/class_db.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@

namespace godot {

AHashMap<StringName, ClassDB::ClassInfo> ClassDB::classes;
HashMap<StringName, ClassDB::ClassInfo> ClassDB::classes;
AHashMap<StringName, const GDExtensionInstanceBindingCallbacks *> ClassDB::instance_binding_callbacks;
LocalVector<StringName> ClassDB::class_register_order;
AHashMap<StringName, Object *> ClassDB::engine_singletons;
Expand Down Expand Up @@ -128,7 +128,7 @@ MethodBind *ClassDB::get_method(const StringName &p_class, const StringName &p_m
MethodBind *ClassDB::bind_methodfi(uint32_t p_flags, MethodBind *p_bind, const MethodDefinition &method_name, const void **p_defs, int p_defcount) {
StringName instance_type = p_bind->get_instance_class();

AHashMap<StringName, ClassInfo>::Iterator type_it = classes.find(instance_type);
HashMap<StringName, ClassInfo>::Iterator type_it = classes.find(instance_type);
if (type_it == classes.end()) {
memdelete(p_bind);
ERR_FAIL_V_MSG(nullptr, String("Class '{0}' doesn't exist.").format(Array::make(instance_type)));
Expand Down Expand Up @@ -233,7 +233,7 @@ void ClassDB::bind_method_godot(const StringName &p_class_name, MethodBind *p_me
}

void ClassDB::add_signal(const StringName &p_class, const MethodInfo &p_signal) {
AHashMap<StringName, ClassInfo>::Iterator type_it = classes.find(p_class);
HashMap<StringName, ClassInfo>::Iterator type_it = classes.find(p_class);

ERR_FAIL_COND_MSG(type_it == classes.end(), String("Class '{0}' doesn't exist.").format(Array::make(p_class)));

Expand Down Expand Up @@ -268,7 +268,7 @@ void ClassDB::add_signal(const StringName &p_class, const MethodInfo &p_signal)
}

void ClassDB::bind_integer_constant(const StringName &p_class_name, const StringName &p_enum_name, const StringName &p_constant_name, GDExtensionInt p_constant_value, bool p_is_bitfield) {
AHashMap<StringName, ClassInfo>::Iterator type_it = classes.find(p_class_name);
HashMap<StringName, ClassInfo>::Iterator type_it = classes.find(p_class_name);

ERR_FAIL_COND_MSG(type_it == classes.end(), String("Class '{0}' doesn't exist.").format(Array::make(p_class_name)));

Expand All @@ -290,7 +290,7 @@ GDExtensionClassCallVirtual ClassDB::get_virtual_func(void *p_userdata, GDExtens
const StringName *class_name = reinterpret_cast<const StringName *>(p_userdata);
const StringName *name = reinterpret_cast<const StringName *>(p_name);

AHashMap<StringName, ClassInfo>::Iterator type_it = classes.find(*class_name);
HashMap<StringName, ClassInfo>::Iterator type_it = classes.find(*class_name);
ERR_FAIL_COND_V_MSG(type_it == classes.end(), nullptr, String("Class '{0}' doesn't exist.").format(Array::make(*class_name)));

const ClassInfo *type = &type_it->value;
Expand Down Expand Up @@ -327,7 +327,7 @@ const GDExtensionInstanceBindingCallbacks *ClassDB::get_instance_binding_callbac
}

void ClassDB::bind_virtual_method(const StringName &p_class, const StringName &p_method, GDExtensionClassCallVirtual p_call, uint32_t p_hash) {
AHashMap<StringName, ClassInfo>::Iterator type_it = classes.find(p_class);
HashMap<StringName, ClassInfo>::Iterator type_it = classes.find(p_class);
ERR_FAIL_COND_MSG(type_it == classes.end(), String("Class '{0}' doesn't exist.").format(Array::make(p_class)));

ClassInfo &type = type_it->value;
Expand All @@ -342,7 +342,7 @@ void ClassDB::bind_virtual_method(const StringName &p_class, const StringName &p
}

void ClassDB::add_virtual_method(const StringName &p_class, const MethodInfo &p_method, const Vector<StringName> &p_arg_names) {
AHashMap<StringName, ClassInfo>::Iterator type_it = classes.find(p_class);
HashMap<StringName, ClassInfo>::Iterator type_it = classes.find(p_class);
ERR_FAIL_COND_MSG(type_it == classes.end(), String("Class '{0}' doesn't exist.").format(Array::make(p_class)));

GDExtensionClassVirtualMethodInfo mi;
Expand Down
2 changes: 1 addition & 1 deletion tools/linux.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

def options(opts):
opts.Add(BoolVariable("use_llvm", "Use the LLVM compiler - only effective when targeting Linux", False))
opts.Add(BoolVariable("use_static_cpp", "Link libgcc and libstdc++ statically for better portability", True))
opts.Add(BoolVariable("use_static_cpp", "Link libgcc and libstdc++ statically for better portability", False))


def exists(env):
Expand Down
Loading