Skip to content

Commit 4aaa2f5

Browse files
committed
Remove .dev suffix from builds. Warn on load when the GDExtension is loaded from a dev build.
1 parent 5eb6e6b commit 4aaa2f5

File tree

3 files changed

+12
-4
lines changed

3 files changed

+12
-4
lines changed

cmake/godotcpp.cmake

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -296,7 +296,6 @@ function( godotcpp_generate )
296296
string( CONCAT GODOT_SUFFIX
297297
"$<1:.${SYSTEM_NAME}>"
298298
"$<1:.${TARGET_ALIAS}>"
299-
"$<${IS_DEV_BUILD}:.dev>"
300299
"$<$<STREQUAL:${GODOT_PRECISION},double>:.double>"
301300
"$<1:.${ARCH_NAME}>"
302301
# TODO IOS_SIMULATOR

src/godot.cpp

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -526,6 +526,17 @@ void GDExtensionBinding::initialize_level(void *p_userdata, GDExtensionInitializ
526526
doc_data.load_data();
527527
}
528528
}
529+
530+
#ifdef DEV_ENABLED
531+
if ((ModuleInitializationLevel)p_level == MODULE_INITIALIZATION_LEVEL_SCENE) {
532+
callable_mp_static(+[]() {
533+
String library_path;
534+
internal::gdextension_interface_get_library_path(internal::library, library_path._native_ptr());
535+
536+
WARN_PRINT("GDExtension loaded from a development build: " + library_path);
537+
}).call_deferred();
538+
}
539+
#endif
529540
}
530541

531542
void GDExtensionBinding::deinitialize_level(void *p_userdata, GDExtensionInitializationLevel p_level) {

tools/godotcpp.py

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -485,8 +485,6 @@ def generate(env):
485485

486486
# Suffix
487487
suffix = ".{}.{}".format(env["platform"], env["target"])
488-
if env.dev_build:
489-
suffix += ".dev"
490488
if env["precision"] == "double":
491489
suffix += ".double"
492490
suffix += "." + env["arch"]
@@ -496,7 +494,7 @@ def generate(env):
496494
suffix += ".nothreads"
497495

498496
env["suffix"] = suffix # Exposed when included from another project
499-
env["OBJSUFFIX"] = suffix + env["OBJSUFFIX"]
497+
env["OBJSUFFIX"] = suffix + (".dev" if env.dev_build else "") + env["OBJSUFFIX"]
500498

501499
# compile_commands.json
502500
env.Tool("compilation_db")

0 commit comments

Comments
 (0)