summaryrefslogtreecommitdiff
path: root/src/init_gdextension.cpp
diff options
context:
space:
mode:
authorFabio Alessandrelli <fabio.alessandrelli@gmail.com>2022-06-18 14:05:07 +0200
committerFabio Alessandrelli <fabio.alessandrelli@gmail.com>2022-06-18 14:35:51 +0200
commitf315912d8568d47c52f739807768629714981fdf (patch)
tree1004ade5bda98da37227913eb18e3812897fa202 /src/init_gdextension.cpp
parent62ab2e59f8781286724b1347a0bf97b88ccc63e6 (diff)
downloadfork-godot-webrtc-native-f315912d8568d47c52f739807768629714981fdf.tar.gz
fork-godot-webrtc-native-f315912d8568d47c52f739807768629714981fdf.tar.bz2
fork-godot-webrtc-native-f315912d8568d47c52f739807768629714981fdf.zip
[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.
Diffstat (limited to 'src/init_gdextension.cpp')
-rw-r--r--src/init_gdextension.cpp6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/init_gdextension.cpp b/src/init_gdextension.cpp
index c923881..b252379 100644
--- a/src/init_gdextension.cpp
+++ b/src/init_gdextension.cpp
@@ -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;