mirror of
https://github.com/godotengine/webrtc-native.git
synced 2026-01-01 05:48:15 +03:00
Compare commits
16 Commits
1.0.2-stab
...
1.0.4-stab
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
fa28efa51d | ||
|
|
6e33e43f36 | ||
|
|
81239d820d | ||
|
|
b0efc17d3b | ||
|
|
ec0ededcde | ||
|
|
308db19120 | ||
|
|
724910c734 | ||
|
|
7a4e27e5f0 | ||
|
|
d768508435 | ||
|
|
fb2c9c3687 | ||
|
|
cf23e5e740 | ||
|
|
668d0250a7 | ||
|
|
121ed5664d | ||
|
|
67a378a667 | ||
|
|
023c42d3b3 | ||
|
|
6d96092f88 |
45
SConstruct
45
SConstruct
@@ -120,18 +120,6 @@ if env["platform"] == "macos" and os.environ.get("OSXCROSS_ROOT", ""):
|
||||
if env["macos_deployment_target"] != "default":
|
||||
env["ENV"]["MACOSX_DEPLOYMENT_TARGET"] = env["macos_deployment_target"]
|
||||
|
||||
# Patch linux flags to statically link libgcc and libstdc++
|
||||
if env["platform"] == "linux":
|
||||
env.Append(
|
||||
LINKFLAGS=[
|
||||
"-Wl,--no-undefined",
|
||||
"-static-libgcc",
|
||||
"-static-libstdc++",
|
||||
]
|
||||
)
|
||||
# And add some linux dependencies.
|
||||
env.Append(LIBS=["pthread", "dl"])
|
||||
|
||||
opts.Update(env)
|
||||
|
||||
target = env["target"]
|
||||
@@ -175,9 +163,40 @@ rtc = env.BuildLibDataChannel(ssl)
|
||||
# but it's better to be safe in case of indirect inclusions by one of our other dependencies.
|
||||
env.Depends(sources, ssl + rtc)
|
||||
|
||||
# We want to statically link against libstdc++ on Linux to maximize compatibility, but we must restrict the exported
|
||||
# symbols using a GCC version script, or we might end up overriding symbols from other libraries.
|
||||
# Using "-fvisibility=hidden" will not work, since libstdc++ explicitly exports its symbols.
|
||||
symbols_file = None
|
||||
if env["platform"] == "linux":
|
||||
if env["godot_version"] == "3":
|
||||
symbols_file = env.File("misc/dist/linux/symbols-gdnative.map")
|
||||
else:
|
||||
symbols_file = env.File("misc/dist/linux/symbols-extension.map")
|
||||
env.Append(
|
||||
LINKFLAGS=[
|
||||
"-Wl,--no-undefined,--version-script=" + symbols_file.abspath,
|
||||
"-static-libgcc",
|
||||
"-static-libstdc++",
|
||||
]
|
||||
)
|
||||
env.Depends(sources, symbols_file)
|
||||
|
||||
# Make the shared library
|
||||
result_name = "libwebrtc_native{}{}".format(env["suffix"], env["SHLIBSUFFIX"])
|
||||
library = env.SharedLibrary(target=os.path.join(result_path, "lib", result_name), source=sources)
|
||||
if env["godot_version"] != "3" and env["platform"] == "macos":
|
||||
framework_path = os.path.join(
|
||||
result_path, "lib", "libwebrtc_native.macos.{}.{}.framework".format(env["target"], env["arch"])
|
||||
)
|
||||
library_file = env.SharedLibrary(target=os.path.join(framework_path, result_name), source=sources)
|
||||
plist_file = env.Substfile(
|
||||
os.path.join(framework_path, "Resources", "Info.plist"),
|
||||
"misc/dist/macos/Info.plist",
|
||||
SUBST_DICT={"{LIBRARY_NAME}": result_name, "{DISPLAY_NAME}": "libwebrtc_native" + env["suffix"]},
|
||||
)
|
||||
library = [library_file, plist_file]
|
||||
else:
|
||||
library = env.SharedLibrary(target=os.path.join(result_path, "lib", result_name), source=sources)
|
||||
|
||||
Default(library)
|
||||
|
||||
# GDNativeLibrary
|
||||
|
||||
6
misc/dist/linux/symbols-extension.map
vendored
Normal file
6
misc/dist/linux/symbols-extension.map
vendored
Normal file
@@ -0,0 +1,6 @@
|
||||
{
|
||||
global:
|
||||
webrtc_extension_init;
|
||||
local:
|
||||
*;
|
||||
};
|
||||
9
misc/dist/linux/symbols-gdnative.map
vendored
Normal file
9
misc/dist/linux/symbols-gdnative.map
vendored
Normal file
@@ -0,0 +1,9 @@
|
||||
{
|
||||
global:
|
||||
godot_gdnative_singleton;
|
||||
godot_gdnative_init;
|
||||
godot_gdnative_terminate;
|
||||
godot_nativescript_init;
|
||||
local:
|
||||
*;
|
||||
};
|
||||
28
misc/dist/macos/Info.plist
vendored
Normal file
28
misc/dist/macos/Info.plist
vendored
Normal file
@@ -0,0 +1,28 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
|
||||
<plist version="1.0">
|
||||
<dict>
|
||||
<key>CFBundleExecutable</key>
|
||||
<string>{LIBRARY_NAME}</string>
|
||||
<key>CFBundleIdentifier</key>
|
||||
<string>org.godotengine.webrtc-native</string>
|
||||
<key>CFBundleInfoDictionaryVersion</key>
|
||||
<string>6.0</string>
|
||||
<key>CFBundleDisplayName</key>
|
||||
<string>{DISPLAY_NAME}</string>
|
||||
<key>CFBundleName</key>
|
||||
<string>webrtc_native</string>
|
||||
<key>CFBundlePackageType</key>
|
||||
<string>FMWK</string>
|
||||
<key>CFBundleShortVersionString</key>
|
||||
<string>1.0.0</string>
|
||||
<key>CFBundleSupportedPlatforms</key>
|
||||
<array>
|
||||
<string>MacOSX</string>
|
||||
</array>
|
||||
<key>CFBundleVersion</key>
|
||||
<string>1.0.0</string>
|
||||
<key>LSMinimumSystemVersion</key>
|
||||
<string>11.0</string>
|
||||
</dict>
|
||||
</plist>
|
||||
@@ -16,7 +16,7 @@ DESTDIR="${DESTINATION}/${VERSION}/${TYPE}"
|
||||
|
||||
mkdir -p ${DESTDIR}/lib
|
||||
|
||||
find "${ARTIFACTS}" -wholename "*/${VERSION}/${TYPE}/lib/*" | xargs cp -t "${DESTDIR}/lib/"
|
||||
find "${ARTIFACTS}" -maxdepth 5 -wholename "*/${VERSION}/${TYPE}/lib/*" | xargs cp -r -t "${DESTDIR}/lib/"
|
||||
find "${ARTIFACTS}" -wholename "*/LICENSE*" | xargs cp -t "${DESTDIR}/"
|
||||
|
||||
if [ $VERSION = "gdnative" ]; then
|
||||
|
||||
@@ -5,26 +5,26 @@ compatibility_minimum = {GODOT_VERSION}
|
||||
|
||||
[libraries]
|
||||
|
||||
linux.debug.x86_64 = "res://webrtc/lib/libwebrtc_native.linux.template_debug.x86_64.so"
|
||||
linux.debug.x86_32 = "res://webrtc/lib/libwebrtc_native.linux.template_debug.x86_32.so"
|
||||
linux.debug.arm64 = "res://webrtc/lib/libwebrtc_native.linux.template_debug.arm64.so"
|
||||
linux.debug.arm32 = "res://webrtc/lib/libwebrtc_native.linux.template_debug.arm32.so"
|
||||
macos.debug = "res://webrtc/lib/libwebrtc_native.macos.template_debug.universal.dylib"
|
||||
windows.debug.x86_64 = "res://webrtc/lib/libwebrtc_native.windows.template_debug.x86_64.dll"
|
||||
windows.debug.x86_32 = "res://webrtc/lib/libwebrtc_native.windows.template_debug.x86_32.dll"
|
||||
android.debug.arm64 = "res://webrtc/lib/libwebrtc_native.android.template_debug.arm64.so"
|
||||
android.debug.x86_64 = "res://webrtc/lib/libwebrtc_native.android.template_debug.x86_64.so"
|
||||
ios.debug.arm64 = "res://webrtc/lib/libwebrtc_native.ios.template_debug.arm64.dylib"
|
||||
ios.debug.x86_64 = "res://webrtc/lib/libwebrtc_native.ios.template_debug.x86_64.simulator.dylib"
|
||||
linux.debug.x86_64 = "lib/libwebrtc_native.linux.template_debug.x86_64.so"
|
||||
linux.debug.x86_32 = "lib/libwebrtc_native.linux.template_debug.x86_32.so"
|
||||
linux.debug.arm64 = "lib/libwebrtc_native.linux.template_debug.arm64.so"
|
||||
linux.debug.arm32 = "lib/libwebrtc_native.linux.template_debug.arm32.so"
|
||||
macos.debug = "lib/libwebrtc_native.macos.template_debug.universal.framework"
|
||||
windows.debug.x86_64 = "lib/libwebrtc_native.windows.template_debug.x86_64.dll"
|
||||
windows.debug.x86_32 = "lib/libwebrtc_native.windows.template_debug.x86_32.dll"
|
||||
android.debug.arm64 = "lib/libwebrtc_native.android.template_debug.arm64.so"
|
||||
android.debug.x86_64 = "lib/libwebrtc_native.android.template_debug.x86_64.so"
|
||||
ios.debug.arm64 = "lib/libwebrtc_native.ios.template_debug.arm64.dylib"
|
||||
ios.debug.x86_64 = "lib/libwebrtc_native.ios.template_debug.x86_64.simulator.dylib"
|
||||
|
||||
linux.release.x86_64 = "res://webrtc/lib/libwebrtc_native.linux.template_release.x86_64.so"
|
||||
linux.release.x86_32 = "res://webrtc/lib/libwebrtc_native.linux.template_release.x86_32.so"
|
||||
linux.release.arm64 = "res://webrtc/lib/libwebrtc_native.linux.template_release.arm64.so"
|
||||
linux.release.arm32 = "res://webrtc/lib/libwebrtc_native.linux.template_release.arm32.so"
|
||||
macos.release = "res://webrtc/lib/libwebrtc_native.macos.template_release.universal.dylib"
|
||||
windows.release.x86_64 = "res://webrtc/lib/libwebrtc_native.windows.template_release.x86_64.dll"
|
||||
windows.release.x86_32 = "res://webrtc/lib/libwebrtc_native.windows.template_release.x86_32.dll"
|
||||
android.release.arm64 = "res://webrtc/lib/libwebrtc_native.android.template_release.arm64.so"
|
||||
android.release.x86_64 = "res://webrtc/lib/libwebrtc_native.android.template_release.x86_64.so"
|
||||
ios.release.arm64 = "res://webrtc/lib/libwebrtc_native.ios.template_release.arm64.dylib"
|
||||
ios.release.x86_64 = "res://webrtc/lib/libwebrtc_native.ios.template_release.x86_64.simulator.dylib"
|
||||
linux.release.x86_64 = "lib/libwebrtc_native.linux.template_release.x86_64.so"
|
||||
linux.release.x86_32 = "lib/libwebrtc_native.linux.template_release.x86_32.so"
|
||||
linux.release.arm64 = "lib/libwebrtc_native.linux.template_release.arm64.so"
|
||||
linux.release.arm32 = "lib/libwebrtc_native.linux.template_release.arm32.so"
|
||||
macos.release = "lib/libwebrtc_native.macos.template_release.universal.framework"
|
||||
windows.release.x86_64 = "lib/libwebrtc_native.windows.template_release.x86_64.dll"
|
||||
windows.release.x86_32 = "lib/libwebrtc_native.windows.template_release.x86_32.dll"
|
||||
android.release.arm64 = "lib/libwebrtc_native.android.template_release.arm64.so"
|
||||
android.release.x86_64 = "lib/libwebrtc_native.android.template_release.x86_64.so"
|
||||
ios.release.arm64 = "lib/libwebrtc_native.ios.template_release.arm64.dylib"
|
||||
ios.release.x86_64 = "lib/libwebrtc_native.ios.template_release.x86_64.simulator.dylib"
|
||||
|
||||
@@ -74,6 +74,10 @@ private:
|
||||
protected:
|
||||
static void _bind_methods() {}
|
||||
|
||||
godot::String _to_string() const {
|
||||
return "WebRTCLibDataChannel";
|
||||
}
|
||||
|
||||
public:
|
||||
static WebRTCLibDataChannel *new_data_channel(std::shared_ptr<rtc::DataChannel> p_channel, bool p_negotiated);
|
||||
|
||||
|
||||
@@ -48,6 +48,7 @@ void WebRTCLibPeerConnection::initialize_signaling() {
|
||||
}
|
||||
|
||||
void WebRTCLibPeerConnection::deinitialize_signaling() {
|
||||
rtc::Cleanup();
|
||||
}
|
||||
|
||||
Error WebRTCLibPeerConnection::_parse_ice_server(rtc::Configuration &r_config, Dictionary p_server) {
|
||||
|
||||
@@ -67,6 +67,10 @@ private:
|
||||
protected:
|
||||
static void _bind_methods() {}
|
||||
|
||||
godot::String _to_string() const {
|
||||
return "WebRTCLibPeerConnection";
|
||||
}
|
||||
|
||||
public:
|
||||
static void _register_methods() {}
|
||||
static void initialize_signaling();
|
||||
|
||||
14
thirdparty/README.md
vendored
14
thirdparty/README.md
vendored
@@ -8,7 +8,7 @@ readability.
|
||||
## json
|
||||
|
||||
- Upstream: https://github.com/nlohmann/json
|
||||
- Version: 3.10.5 (4f8fba14066156b73f1189a2b8bd568bde5284c5, 2022)
|
||||
- Version: 3.11.2 (bc889afb4c5bf1c0d8ee29ef35eaaf4c8bef8a5d, 2022)
|
||||
- License: MIT
|
||||
|
||||
Module location:
|
||||
@@ -19,7 +19,7 @@ Module location:
|
||||
## libdatachannel
|
||||
|
||||
- Upstream: https://github.com/paullouisageneau/libdatachannel
|
||||
- Version: 0.18.6 (bf8d8bd86afaffed89ba763107bcd8957c8cc319, 2023)
|
||||
- Version: 0.19.4 (cb77870cde2c78007a336eae3aacd234dccda161, 2023)
|
||||
- License: MPL 2.0
|
||||
|
||||
Module location:
|
||||
@@ -30,7 +30,7 @@ Module location:
|
||||
# libjuice
|
||||
|
||||
- Upstream: https://github.com/paullouisageneau/libjuice
|
||||
- Version: 1.2.3 (8c23cc88c6d41e5ccbc44ea0ad3d79b22cf02361, 2023)
|
||||
- Version: 1.3.3 (5f753cad49059cea4eb492eb5c11a3bbb4dd6324, 2023)
|
||||
- License: MPL 2.0
|
||||
|
||||
Module location:
|
||||
@@ -52,7 +52,7 @@ Module location:
|
||||
## openssl
|
||||
|
||||
- Upstream: git://git.openssl.org/openssl.git
|
||||
- Version: 3.0.10 (245cb0291e0db99d9ccf3692fa76f440b2b054c2, 2023)
|
||||
- Version: 3.0.12 (c3cc0f1386b0544383a61244a4beeb762b67498f, 2023)
|
||||
- License: Apache 2.0
|
||||
|
||||
Module location:
|
||||
@@ -63,8 +63,8 @@ Module location:
|
||||
## plog
|
||||
|
||||
- Upstream: https://github.com/SergiusTheBest/plog
|
||||
- Version: git (d8461e9d473e59fbcc1f79eee021550dcf81e618, 2021)
|
||||
- License: MPL 2.0
|
||||
- Version: 1.1.10 (e21baecd4753f14da64ede979c5a19302618b752, 2023)
|
||||
- License: MIT
|
||||
|
||||
Module location:
|
||||
|
||||
@@ -74,7 +74,7 @@ Module location:
|
||||
## usrsctp
|
||||
|
||||
- Upstream: https://github.com/sctplab/usrsctp
|
||||
- Version: git (7c31bd35c79ba67084ce029511193a19ceb97447, 2021)
|
||||
- Version: git (5ca29ac7d8055802c7657191325c06386640ac24, 2023)
|
||||
- License: BSD-3-Clause
|
||||
|
||||
Module location:
|
||||
|
||||
2
thirdparty/libdatachannel
vendored
2
thirdparty/libdatachannel
vendored
Submodule thirdparty/libdatachannel updated: bf8d8bd86a...cb77870cde
2
thirdparty/openssl
vendored
2
thirdparty/openssl
vendored
Submodule thirdparty/openssl updated: 245cb0291e...c3cc0f1386
@@ -125,6 +125,8 @@ def build_openssl(env, jobs=None):
|
||||
env.Prepend(LIBPATH=[env["SSL_BUILD"]])
|
||||
if env["platform"] == "windows":
|
||||
env.PrependUnique(LIBS=["crypt32", "ws2_32", "advapi32", "user32"])
|
||||
if env["platform"] == "linux":
|
||||
env.PrependUnique(LIBS=["pthread", "dl"])
|
||||
env.Prepend(LIBS=env["SSL_LIBS"])
|
||||
return [env["SSL_CRYPTO_LIBRARY"], env["SSL_LIBRARY"]]
|
||||
|
||||
@@ -169,6 +171,8 @@ def build_openssl(env, jobs=None):
|
||||
env.Prepend(LIBPATH=[env["SSL_BUILD"]])
|
||||
if env["platform"] == "windows":
|
||||
env.PrependUnique(LIBS=["crypt32", "ws2_32", "advapi32", "user32"])
|
||||
if env["platform"] == "linux":
|
||||
env.PrependUnique(LIBS=["pthread", "dl"])
|
||||
env.Prepend(LIBS=env["SSL_LIBS"])
|
||||
|
||||
return ssl
|
||||
|
||||
@@ -37,6 +37,8 @@ def build_library(env, ssl):
|
||||
# Configure env.
|
||||
if env["platform"] == "windows":
|
||||
env.PrependUnique(LIBS=["iphlpapi", "bcrypt"])
|
||||
if env["platform"] == "linux":
|
||||
env.PrependUnique(LIBS=["pthread"])
|
||||
env.Prepend(LIBS=list(filter(lambda f: str(f).endswith(lib_ext), rtc)))
|
||||
env.Append(CPPPATH=["#thirdparty/libdatachannel/include"])
|
||||
|
||||
|
||||
Reference in New Issue
Block a user