Skip to content

Commit

Permalink
Merge pull request #54 from Faless/fix/win32_mingw
Browse files Browse the repository at this point in the history
[Windows] Fix windows build with mingw.
  • Loading branch information
Faless authored Jun 18, 2022
2 parents 62ab2e5 + f315912 commit e41d290
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 0 deletions.
4 changes: 4 additions & 0 deletions SConstruct
Original file line number Diff line number Diff line change
Expand Up @@ -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"]
Expand Down
6 changes: 6 additions & 0 deletions src/init_gdextension.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down
6 changes: 6 additions & 0 deletions src/init_gdnative.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit e41d290

Please sign in to comment.