Compare commits

..

4 Commits

Author SHA1 Message Date
Fabio Alessandrelli
e41d2903ad Merge pull request #54 from Faless/fix/win32_mingw
[Windows] Fix windows build with mingw.
2022-06-18 16:46:06 +02:00
Fabio Alessandrelli
f315912d85 [Windows] Fix windows build with mingw.
Forces ".dll" extension for library when building with mingw.

Override GDN_EXPORT which is incorrectly defined in the upstream
gdnative headers (3.x) and godot-cpp include (4.0) when building for
windows with mingw.
2022-06-18 14:35:51 +02:00
Fabio Alessandrelli
62ab2e59f8 Merge pull request #53 from Faless/fix/build_deps_target
[SCons] Apply "target" to dependencies.
2022-06-18 03:00:48 +02:00
Fabio Alessandrelli
a2fc27f646 [SCons] Apply "target" to dependencies.
Dependencies used to be built with the default option (release for
OpenSSL, debug for libdachannel).
They now follow the desired target (producing smaller binaries in
release, and bigger in debug).
2022-06-18 02:00:18 +02:00
4 changed files with 20 additions and 0 deletions

View File

@@ -67,6 +67,10 @@ else:
})
env = env.Clone()
# Patch mingw SHLIBSUFFIX.
if env["platform"] == "windows" and env["use_mingw"]:
env["SHLIBSUFFIX"] = ".dll"
opts.Update(env)
target = env["target"]

View File

@@ -63,6 +63,9 @@ def ssl_action(target, source, env):
"--prefix=%s" % install_dir,
"--openssldir=%s" % install_dir,
]
if env["target"] == "debug":
args.append("-d")
if env["platform"] != "windows":
args.append("no-shared") # Windows "app" doesn't like static-only builds.
if env["platform"] == "linux":
@@ -160,6 +163,7 @@ def rtc_action(target, source, env):
"-DOPENSSL_INCLUDE_DIR=%s" % get_ssl_include_dir(env),
"-DOPENSSL_SSL_LIBRARY=%s/libssl.a" % get_ssl_build_dir(env),
"-DOPENSSL_CRYPTO_LIBRARY=%s/libcrypto.a" % get_ssl_build_dir(env),
"-DCMAKE_BUILD_TYPE=%s" % ("Release" if env["target"] == "release" else "Debug"),
]
if env["platform"] == "android":
abi = {

View File

@@ -37,6 +37,12 @@
#include "WebRTCLibDataChannel.hpp"
#include "WebRTCLibPeerConnection.hpp"
#ifdef _WIN32
// See upstream godot-cpp GH-771.
#undef GDN_EXPORT
#define GDN_EXPORT __declspec(dllexport)
#endif
using namespace godot;
using namespace godot_webrtc;

View File

@@ -34,6 +34,12 @@
#include <gdnative_api_struct.gen.h>
#include <net/godot_net.h>
#ifdef _WIN32
// See upstream godot GH-62173.
#undef GDN_EXPORT
#define GDN_EXPORT __declspec(dllexport)
#endif
/* Singleton */
static bool _singleton = false;
static const godot_object *_singleton_lib = NULL;