Skip to content

Commit

Permalink
Merge pull request #154 from Faless/drop_4.0
Browse files Browse the repository at this point in the history
Drop Godot 4.0 support
  • Loading branch information
Faless authored Dec 4, 2024
2 parents 93e11a7 + 9afa5c3 commit 49de259
Show file tree
Hide file tree
Showing 9 changed files with 9 additions and 234 deletions.
25 changes: 5 additions & 20 deletions .github/workflows/build_release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -199,7 +199,6 @@ jobs:
- name: Patch godot-cpp to support build profile.
run: |
patch -p1 < misc/patches/build_profile.diff
patch -p1 < misc/patches/build_profile_4.0.diff
patch -p1 < misc/patches/build_profile_3.x.diff
- name: Print tools versions
Expand All @@ -210,19 +209,11 @@ jobs:
- name: Compile Extension (4.1+) - template_debug - ${{ matrix.platform }} - ${{ matrix.arch }}
run: |
scons target=template_debug godot_version=4.1
scons target=template_debug godot_version=4
- name: Compile Extension (4.1+) - template_release - ${{ matrix.platform }} - ${{ matrix.arch }}
run: |
scons target=template_release godot_version=4.1
- name: Compile Extension (4.0) - template_debug - ${{ matrix.platform }} - ${{ matrix.arch }}
run: |
scons target=template_debug godot_version=4.0
- name: Compile Extension (4.0) - template_release - ${{ matrix.platform }} - ${{ matrix.arch }}
run: |
scons target=template_release godot_version=4.0
scons target=template_release godot_version=4
- name: Compile GDNative (3.5+) - release ${{ matrix.platform }} - ${{ matrix.arch }}
run: |
Expand Down Expand Up @@ -265,21 +256,15 @@ jobs:
run: |
mkdir release
VERSION="extension-4.1" TYPE="webrtc" ./misc/scripts/package_release.sh
VERSION="extension-4.0" TYPE="webrtc" ./misc/scripts/package_release.sh
VERSION="extension" TYPE="webrtc" ./misc/scripts/package_release.sh
VERSION="gdnative" TYPE="webrtc" ./misc/scripts/package_release.sh
ls -R release
- uses: actions/upload-artifact@v4
with:
name: godot-webrtc-extension-4.1
path: release/*-extension-4.1-*.zip

- uses: actions/upload-artifact@v4
with:
name: godot-webrtc-extension-4.0
path: release/*-extension-4.0-*.zip
name: godot-webrtc-extension
path: release/*-extension-*.zip

- uses: actions/upload-artifact@v4
with:
Expand Down
3 changes: 0 additions & 3 deletions .gitmodules
Original file line number Diff line number Diff line change
@@ -1,9 +1,6 @@
[submodule "godot-cpp"]
path = godot-cpp
url = https://github.com/godotengine/godot-cpp.git
[submodule "godot-cpp-4.0"]
path = godot-cpp-4.0
url = https://github.com/godotengine/godot-cpp.git
[submodule "godot-cpp-3.x"]
path = godot-cpp-3.x
url = https://github.com/godotengine/godot-cpp.git
Expand Down
12 changes: 2 additions & 10 deletions SConstruct
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ def validate_godotcpp_dir(key, val, env):

env = Environment()
opts = Variables(["customs.py"], ARGUMENTS)
opts.Add(EnumVariable("godot_version", "The Godot target version", "4.1", ["3", "4.0", "4.1"]))
opts.Add(EnumVariable("godot_version", "The Godot target version", "4", ["3", "4"], {"4.1+": "4", "4.1": "4"}))
opts.Add(
PathVariable(
"godot_cpp",
Expand Down Expand Up @@ -122,10 +122,6 @@ if env["godot_version"] == "3":
if env["platform"] == "linux" and env["arch"] not in ("x86_32", "x86_64"):
for flags in (env["CCFLAGS"], env["LINKFLAGS"], cpp_env["CCFLAGS"], cpp_env["LINKFLAGS"]):
replace_flags(flags, {"-m32": None, "-m64": None})
elif env["godot_version"] == "4.0":
sconstruct = env.get("godot_cpp", "godot-cpp-4.0") + "/SConstruct"
cpp_env = SConscript(sconstruct)
env = cpp_env.Clone()
else:
sconstruct = env.get("godot_cpp", "godot-cpp") + "/SConstruct"
cpp_env = SConscript(sconstruct)
Expand Down Expand Up @@ -160,10 +156,8 @@ opts.Update(env)
target = env["target"]
if env["godot_version"] == "3":
result_path = os.path.join("bin", "gdnative", "webrtc" if env["target"] == "release" else "webrtc_debug")
elif env["godot_version"] == "4.0":
result_path = os.path.join("bin", "extension-4.0", "webrtc")
else:
result_path = os.path.join("bin", "extension-4.1", "webrtc")
result_path = os.path.join("bin", "extension", "webrtc")

# Our includes and sources
env.Append(CPPPATH=["src/"])
Expand All @@ -181,8 +175,6 @@ if env["godot_version"] == "3":
add_sources(sources, "src/net/", "cpp")
else:
sources.append("src/init_gdextension.cpp")
if env["godot_version"] == "4.0":
env.Append(CPPDEFINES=["GDEXTENSION_WEBRTC_40"])

# Add our build tools
for tool in ["openssl", "cmake", "rtc"]:
Expand Down
1 change: 0 additions & 1 deletion godot-cpp-4.0
Submodule godot-cpp-4.0 deleted from 9d1c39
180 changes: 0 additions & 180 deletions misc/patches/build_profile_4.0.diff

This file was deleted.

14 changes: 0 additions & 14 deletions misc/patches/scons_path.diff
Original file line number Diff line number Diff line change
@@ -1,17 +1,3 @@
diff --git a/godot-cpp-4.0/SConstruct b/godot-cpp-4.0/SConstruct
index 27ee137..32b425e 100644
--- a/godot-cpp-4.0/SConstruct
+++ b/godot-cpp-4.0/SConstruct
@@ -54,6 +54,8 @@ else:
# Default tools with no platform defaults to gnu toolchain.
# We apply platform specific toolchains via our custom tools.
env = Environment(tools=["default"], PLATFORM="")
+# Allows us to use Godot buildroot toolchain
+env.PrependENVPath("PATH", os.getenv("PATH"))

# Default num_jobs to local cpu count if not user specified.
# SCons has a peculiarity where user-specified options won't be overridden

diff --git a/godot-cpp-3.x/SConstruct b/godot-cpp-3.x/SConstruct
index f653d54..6f40377 100644
--- a/godot-cpp-3.x/SConstruct
Expand Down
2 changes: 1 addition & 1 deletion src/WebRTCLibPeerConnection.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -199,7 +199,7 @@ Error WebRTCLibPeerConnection::_initialize(const Dictionary &p_config) {
return _create_pc(config);
}

#if defined(GDNATIVE_WEBRTC) || defined(GDEXTENSION_WEBRTC_40)
#if defined(GDNATIVE_WEBRTC)
Object *WebRTCLibPeerConnection::_create_data_channel(const String &p_channel, const Dictionary &p_channel_config) try {
#else
Ref<WebRTCDataChannel> WebRTCLibPeerConnection::_create_data_channel(const String &p_channel, const Dictionary &p_channel_config) try {
Expand Down
2 changes: 1 addition & 1 deletion src/WebRTCLibPeerConnection.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ class WebRTCLibPeerConnection : public godot::WebRTCPeerConnectionExtension {
SignalingState _get_signaling_state() const override;

godot::Error _initialize(const godot::Dictionary &p_config) override;
#if defined(GDNATIVE_WEBRTC) || defined(GDEXTENSION_WEBRTC_40)
#if defined(GDNATIVE_WEBRTC)
godot::Object *_create_data_channel(const godot::String &p_channel, const godot::Dictionary &p_channel_config) override;
#else
godot::Ref<godot::WebRTCDataChannel> _create_data_channel(const godot::String &p_channel, const godot::Dictionary &p_channel_config) override;
Expand Down
4 changes: 0 additions & 4 deletions src/init_gdextension.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -66,11 +66,7 @@ void unregister_webrtc_extension_types(ModuleInitializationLevel p_level) {
}

extern "C" {
#ifdef GDEXTENSION_WEBRTC_40
GDExtensionBool GDE_EXPORT webrtc_extension_init(const GDExtensionInterface *p_interface, const GDExtensionClassLibraryPtr p_library, GDExtensionInitialization *r_initialization) {
#else
GDExtensionBool GDE_EXPORT webrtc_extension_init(const GDExtensionInterfaceGetProcAddress p_interface, const GDExtensionClassLibraryPtr p_library, GDExtensionInitialization *r_initialization) {
#endif
GDExtensionBinding::InitObject init_obj(p_interface, p_library, r_initialization);

init_obj.register_initializer(register_webrtc_extension_types);
Expand Down

0 comments on commit 49de259

Please sign in to comment.