mirror of
https://github.com/godotengine/webrtc-native.git
synced 2026-01-06 06:09:45 +03:00
Compare commits
15 Commits
1.0.0-beta
...
1.0.0-beta
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
35bdd5efa7 | ||
|
|
90aaa0b82e | ||
|
|
16f311844b | ||
|
|
dfb34df36e | ||
|
|
9715e73ae4 | ||
|
|
2e9a25bb39 | ||
|
|
6067addd96 | ||
|
|
a3fbd33464 | ||
|
|
d697901f81 | ||
|
|
3eb7d0aa3b | ||
|
|
ecec40f59e | ||
|
|
37a289addf | ||
|
|
1436024f59 | ||
|
|
690b31e7dd | ||
|
|
9b0a5d8b46 |
69
.github/workflows/build_release.yml
vendored
69
.github/workflows/build_release.yml
vendored
@@ -1,13 +1,17 @@
|
|||||||
name: 🔧 Build -> Package 📦
|
name: 🔧 Build -> Package 📦
|
||||||
on: [push, pull_request]
|
on: [push, pull_request]
|
||||||
|
|
||||||
|
env:
|
||||||
|
# Only used for the cache key. Increment version to force clean build.
|
||||||
|
GODOT_BASE_BRANCH: master
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
static-checks:
|
static-checks:
|
||||||
name: 📊 Static Checks (clang-format, black format, file format)
|
name: 📊 Static Checks (clang-format, black format, file format)
|
||||||
runs-on: ubuntu-20.04
|
runs-on: ubuntu-20.04
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout
|
- name: Checkout
|
||||||
uses: actions/checkout@v2
|
uses: actions/checkout@v3
|
||||||
|
|
||||||
- name: Install dependencies
|
- name: Install dependencies
|
||||||
run: |
|
run: |
|
||||||
@@ -42,24 +46,27 @@ jobs:
|
|||||||
gdnative_flags: 'android_arch=x86_64'
|
gdnative_flags: 'android_arch=x86_64'
|
||||||
sconsflags: ''
|
sconsflags: ''
|
||||||
os: 'ubuntu-20.04'
|
os: 'ubuntu-20.04'
|
||||||
|
cache-name: android-x86_64
|
||||||
- platform: android
|
- platform: android
|
||||||
arch: 'arm64'
|
arch: 'arm64'
|
||||||
gdnative_flags: 'android_arch=arm64v8'
|
gdnative_flags: 'android_arch=arm64v8'
|
||||||
sconsflags: ''
|
sconsflags: ''
|
||||||
os: 'ubuntu-20.04'
|
os: 'ubuntu-20.04'
|
||||||
|
cache-name: android-arm64
|
||||||
|
|
||||||
# iOS
|
# iOS
|
||||||
- platform: ios
|
- platform: ios
|
||||||
arch: 'x86_64'
|
arch: 'x86_64'
|
||||||
gdnative_flags: 'ios_arch=x86_64'
|
gdnative_flags: 'ios_arch=x86_64'
|
||||||
sconsflags: 'ios_simulator=true'
|
sconsflags: 'ios_simulator=true'
|
||||||
os: 'macos-latest'
|
os: 'macos-11'
|
||||||
|
cache-name: ios-x86_64-simulator
|
||||||
- platform: ios
|
- platform: ios
|
||||||
arch: 'arm64'
|
arch: 'arm64'
|
||||||
gdnative_flags: 'ios_arch=arm64'
|
gdnative_flags: 'ios_arch=arm64'
|
||||||
sconsflags: ''
|
sconsflags: ''
|
||||||
os: 'macos-11'
|
os: 'macos-11'
|
||||||
|
cache-name: ios-arm64
|
||||||
|
|
||||||
# Linux
|
# Linux
|
||||||
- platform: linux
|
- platform: linux
|
||||||
@@ -67,11 +74,13 @@ jobs:
|
|||||||
gdnative_flags: 'bits=32'
|
gdnative_flags: 'bits=32'
|
||||||
sconsflags: ''
|
sconsflags: ''
|
||||||
os: 'ubuntu-20.04'
|
os: 'ubuntu-20.04'
|
||||||
|
cache-name: linux-x86_32
|
||||||
- platform: linux
|
- platform: linux
|
||||||
arch: 'x86_64'
|
arch: 'x86_64'
|
||||||
gdnative_flags: 'bits=64'
|
gdnative_flags: 'bits=64'
|
||||||
sconsflags: ''
|
sconsflags: ''
|
||||||
os: 'ubuntu-20.04'
|
os: 'ubuntu-20.04'
|
||||||
|
cache-name: linux-x86_64
|
||||||
|
|
||||||
# macOS
|
# macOS
|
||||||
- platform: macos
|
- platform: macos
|
||||||
@@ -79,11 +88,13 @@ jobs:
|
|||||||
gdnative_flags: 'macos_arch=x86_64 bits=64'
|
gdnative_flags: 'macos_arch=x86_64 bits=64'
|
||||||
sconsflags: ''
|
sconsflags: ''
|
||||||
os: 'macos-11'
|
os: 'macos-11'
|
||||||
|
cache-name: macos-x86_64
|
||||||
- platform: macos
|
- platform: macos
|
||||||
gdnative_flags: 'macos_arch=arm64 bits=64'
|
gdnative_flags: 'macos_arch=arm64 bits=64'
|
||||||
arch: 'arm64'
|
arch: 'arm64'
|
||||||
sconsflags: ''
|
sconsflags: ''
|
||||||
os: 'macos-11'
|
os: 'macos-11'
|
||||||
|
cache-name: macos-arm64
|
||||||
|
|
||||||
# Windows
|
# Windows
|
||||||
- platform: windows
|
- platform: windows
|
||||||
@@ -92,14 +103,17 @@ jobs:
|
|||||||
sconsflags: 'use_mingw=yes'
|
sconsflags: 'use_mingw=yes'
|
||||||
os: 'ubuntu-20.04'
|
os: 'ubuntu-20.04'
|
||||||
msvc_arch: amd64_x86
|
msvc_arch: amd64_x86
|
||||||
|
cache-name: win-x86_32
|
||||||
- platform: windows
|
- platform: windows
|
||||||
arch: 'x86_64'
|
arch: 'x86_64'
|
||||||
gdnative_flags: 'bits=64'
|
gdnative_flags: 'bits=64'
|
||||||
sconsflags: 'use_mingw=yes'
|
sconsflags: 'use_mingw=yes'
|
||||||
os: 'ubuntu-20.04'
|
os: 'ubuntu-20.04'
|
||||||
msvc_arch: amd64
|
msvc_arch: amd64
|
||||||
|
cache-name: win-x86_64
|
||||||
|
|
||||||
env:
|
env:
|
||||||
|
SCONS_CACHE: ${{ github.workspace }}/.scons-cache/
|
||||||
SCONSFLAGS: ${{ matrix.sconsflags }} platform=${{ matrix.platform }} arch=${{ matrix.arch }} --jobs=2
|
SCONSFLAGS: ${{ matrix.sconsflags }} platform=${{ matrix.platform }} arch=${{ matrix.arch }} --jobs=2
|
||||||
|
|
||||||
defaults:
|
defaults:
|
||||||
@@ -107,10 +121,16 @@ jobs:
|
|||||||
shell: bash
|
shell: bash
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v2
|
- uses: actions/checkout@v3
|
||||||
with:
|
with:
|
||||||
submodules: recursive
|
submodules: recursive
|
||||||
|
|
||||||
|
- name: Setup Godot build cache
|
||||||
|
uses: ./godot-cpp/.github/actions/godot-cache
|
||||||
|
with:
|
||||||
|
cache-name: ${{ matrix.cache-name }}
|
||||||
|
continue-on-error: true
|
||||||
|
|
||||||
- name: Install Windows build dependencies
|
- name: Install Windows build dependencies
|
||||||
if: ${{ matrix.platform == 'windows' }}
|
if: ${{ matrix.platform == 'windows' }}
|
||||||
run: |
|
run: |
|
||||||
@@ -129,7 +149,7 @@ jobs:
|
|||||||
sudo apt-get install build-essential gcc-multilib g++-multilib
|
sudo apt-get install build-essential gcc-multilib g++-multilib
|
||||||
|
|
||||||
- name: Set up Python 3.x
|
- name: Set up Python 3.x
|
||||||
uses: actions/setup-python@v2
|
uses: actions/setup-python@v4
|
||||||
with:
|
with:
|
||||||
python-version: '3.x'
|
python-version: '3.x'
|
||||||
architecture: 'x64'
|
architecture: 'x64'
|
||||||
@@ -142,21 +162,17 @@ jobs:
|
|||||||
scons --version
|
scons --version
|
||||||
cmake --version
|
cmake --version
|
||||||
|
|
||||||
- name: Compile Extension - debug - ${{ matrix.platform }} - ${{ matrix.arch }}
|
- name: Compile Extension - template_debug - ${{ matrix.platform }} - ${{ matrix.arch }}
|
||||||
run: |
|
run: |
|
||||||
scons target=debug generate_bindings=yes
|
scons target=template_debug generate_bindings=yes
|
||||||
|
|
||||||
- name: Compile GDNative - debug - ${{ matrix.platform }} - ${{ matrix.arch }}
|
- name: Compile Extension - template_release - ${{ matrix.platform }} - ${{ matrix.arch }}
|
||||||
run: |
|
run: |
|
||||||
scons target=debug generate_bindings=yes ${{ matrix.gdnative_flags }} godot_version=3
|
scons target=template_release
|
||||||
|
|
||||||
- name: Compile Extension - release - ${{ matrix.platform }} - ${{ matrix.arch }}
|
|
||||||
run: |
|
|
||||||
scons target=release
|
|
||||||
|
|
||||||
- name: Compile GDNative - release ${{ matrix.platform }} - ${{ matrix.arch }}
|
- name: Compile GDNative - release ${{ matrix.platform }} - ${{ matrix.arch }}
|
||||||
run: |
|
run: |
|
||||||
scons target=release ${{ matrix.gdnative_flags }} godot_version=3
|
scons target=release generate_bindings=yes ${{ matrix.gdnative_flags }} godot_version=3
|
||||||
|
|
||||||
- uses: actions/upload-artifact@v3
|
- uses: actions/upload-artifact@v3
|
||||||
with:
|
with:
|
||||||
@@ -168,7 +184,7 @@ jobs:
|
|||||||
needs: build
|
needs: build
|
||||||
runs-on: "ubuntu-latest"
|
runs-on: "ubuntu-latest"
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v2
|
- uses: actions/checkout@v3
|
||||||
with:
|
with:
|
||||||
submodules: recursive
|
submodules: recursive
|
||||||
|
|
||||||
@@ -188,28 +204,15 @@ jobs:
|
|||||||
cp deps/libdatachannel/deps/plog/LICENSE artifacts/LICENSE.plog
|
cp deps/libdatachannel/deps/plog/LICENSE artifacts/LICENSE.plog
|
||||||
|
|
||||||
- name: Package artifacts for release
|
- name: Package artifacts for release
|
||||||
|
env:
|
||||||
|
DESTINATION: "release"
|
||||||
run: |
|
run: |
|
||||||
mkdir release
|
mkdir release
|
||||||
cd release
|
|
||||||
|
|
||||||
ls -R
|
VERSION="extension" TYPE="webrtc" ./misc/scripts/package_release.sh
|
||||||
|
VERSION="gdnative" TYPE="webrtc" ./misc/scripts/package_release.sh
|
||||||
|
|
||||||
for version in extension gdnative
|
ls -R release
|
||||||
do
|
|
||||||
for name in webrtc webrtc_debug
|
|
||||||
do
|
|
||||||
destdir="${version}/${name}"
|
|
||||||
mkdir -p ${destdir}/lib
|
|
||||||
find ../artifacts -wholename "*/${destdir}/lib/*" | xargs cp -t ${destdir}/lib/
|
|
||||||
find ../artifacts -wholename "*/${destdir}/${name}.tres" -or -wholename "*/${destdir}/${name}.gdextension" | head -n 1 | xargs cp -t ${destdir}/
|
|
||||||
find ../artifacts -wholename "*/LICENSE*" | xargs cp -t ${destdir}/
|
|
||||||
cd ${version}
|
|
||||||
zip -r ../godot-${version}-${name}.zip ${name}
|
|
||||||
cd ..
|
|
||||||
done
|
|
||||||
done
|
|
||||||
|
|
||||||
ls -R
|
|
||||||
|
|
||||||
- uses: actions/upload-artifact@v3
|
- uses: actions/upload-artifact@v3
|
||||||
with:
|
with:
|
||||||
|
|||||||
53
SConstruct
53
SConstruct
@@ -26,6 +26,11 @@ if env["godot_version"] == "3":
|
|||||||
if "platform" in ARGUMENTS and ARGUMENTS["platform"] == "macos":
|
if "platform" in ARGUMENTS and ARGUMENTS["platform"] == "macos":
|
||||||
ARGUMENTS["platform"] = "osx" # compatibility with old osx name
|
ARGUMENTS["platform"] = "osx" # compatibility with old osx name
|
||||||
|
|
||||||
|
scons_cache_path = os.environ.get("SCONS_CACHE")
|
||||||
|
if scons_cache_path is not None:
|
||||||
|
CacheDir(scons_cache_path)
|
||||||
|
Decider("MD5")
|
||||||
|
|
||||||
env = SConscript("godot-cpp-3.x/SConstruct")
|
env = SConscript("godot-cpp-3.x/SConstruct")
|
||||||
|
|
||||||
# Patch base env
|
# Patch base env
|
||||||
@@ -52,7 +57,7 @@ if env["godot_version"] == "3":
|
|||||||
if env["platform"] in ["windows", "linux"]:
|
if env["platform"] in ["windows", "linux"]:
|
||||||
env["arch"] = "x86_32" if env["bits"] == "32" else "x86_64"
|
env["arch"] = "x86_32" if env["bits"] == "32" else "x86_64"
|
||||||
env["arch_suffix"] = env["arch"]
|
env["arch_suffix"] = env["arch"]
|
||||||
elif env["platform"] == "osx":
|
elif env["platform"] == "macos":
|
||||||
env["arch"] = env["macos_arch"]
|
env["arch"] = env["macos_arch"]
|
||||||
env["arch_suffix"] = env["arch"]
|
env["arch_suffix"] = env["arch"]
|
||||||
elif env["platform"] == "ios":
|
elif env["platform"] == "ios":
|
||||||
@@ -66,10 +71,23 @@ if env["godot_version"] == "3":
|
|||||||
"x86_64": "x86_64",
|
"x86_64": "x86_64",
|
||||||
}[env["android_arch"]]
|
}[env["android_arch"]]
|
||||||
env["arch_suffix"] = env["arch"]
|
env["arch_suffix"] = env["arch"]
|
||||||
|
|
||||||
|
target_compat = "template_" + env["target"]
|
||||||
|
env["suffix"] = ".{}.{}.{}".format(env["platform"], target_compat, env["arch_suffix"])
|
||||||
|
env["debug_symbols"] = False
|
||||||
else:
|
else:
|
||||||
ARGUMENTS["ios_min_version"] = "11.0"
|
ARGUMENTS["ios_min_version"] = "11.0"
|
||||||
env = SConscript("godot-cpp/SConstruct").Clone()
|
env = SConscript("godot-cpp/SConstruct").Clone()
|
||||||
|
|
||||||
|
# Should probably go to upstream godot-cpp.
|
||||||
|
# We let SCons build its default ENV as it includes OS-specific things which we don't
|
||||||
|
# want to have to pull in manually.
|
||||||
|
# Then we prepend PATH to make it take precedence, while preserving SCons' own entries.
|
||||||
|
env.PrependENVPath("PATH", os.getenv("PATH"))
|
||||||
|
env.PrependENVPath("PKG_CONFIG_PATH", os.getenv("PKG_CONFIG_PATH"))
|
||||||
|
if "TERM" in os.environ: # Used for colored output.
|
||||||
|
env["ENV"]["TERM"] = os.environ["TERM"]
|
||||||
|
|
||||||
# Patch mingw SHLIBSUFFIX.
|
# Patch mingw SHLIBSUFFIX.
|
||||||
if env["platform"] == "windows" and env["use_mingw"]:
|
if env["platform"] == "windows" and env["use_mingw"]:
|
||||||
env["SHLIBSUFFIX"] = ".dll"
|
env["SHLIBSUFFIX"] = ".dll"
|
||||||
@@ -77,7 +95,10 @@ if env["platform"] == "windows" and env["use_mingw"]:
|
|||||||
opts.Update(env)
|
opts.Update(env)
|
||||||
|
|
||||||
target = env["target"]
|
target = env["target"]
|
||||||
result_path = os.path.join("bin", "gdnative" if env["godot_version"] == "3" else "extension", "webrtc" if env["target"] == "release" else "webrtc_debug")
|
if env["godot_version"] == "3":
|
||||||
|
result_path = os.path.join("bin", "gdnative", "webrtc" if env["target"] == "release" else "webrtc_debug")
|
||||||
|
else:
|
||||||
|
result_path = os.path.join("bin", "extension", "webrtc")
|
||||||
|
|
||||||
# Dependencies
|
# Dependencies
|
||||||
deps_source_dir = "deps"
|
deps_source_dir = "deps"
|
||||||
@@ -88,17 +109,20 @@ env.Append(BUILDERS={
|
|||||||
|
|
||||||
# SSL
|
# SSL
|
||||||
ssl = env.BuildOpenSSL(env.Dir(builders.get_ssl_build_dir(env)), env.Dir(builders.get_ssl_source_dir(env)))
|
ssl = env.BuildOpenSSL(env.Dir(builders.get_ssl_build_dir(env)), env.Dir(builders.get_ssl_source_dir(env)))
|
||||||
|
env.Depends(ssl, [env.File("builders.py"), env.File(builders.get_ssl_source_dir(env) + "/VERSION.dat")])
|
||||||
|
env.NoCache(ssl) # Needs refactoring to properly cache generated headers.
|
||||||
|
|
||||||
env.Prepend(CPPPATH=[builders.get_ssl_include_dir(env)])
|
env.Prepend(CPPPATH=[builders.get_ssl_include_dir(env)])
|
||||||
env.Prepend(LIBPATH=[builders.get_ssl_build_dir(env)])
|
env.Prepend(LIBPATH=[builders.get_ssl_build_dir(env)])
|
||||||
env.Append(LIBS=[ssl])
|
env.Append(LIBS=[builders.get_ssl_libs(env)])
|
||||||
|
|
||||||
# RTC
|
# RTC
|
||||||
rtc = env.BuildLibDataChannel(env.Dir(builders.get_rtc_build_dir(env)), [env.Dir(builders.get_rtc_source_dir(env))] + ssl)
|
rtc = env.BuildLibDataChannel(env.Dir(builders.get_rtc_build_dir(env)), [env.Dir(builders.get_rtc_source_dir(env))] + ssl)
|
||||||
|
env.Depends(rtc, [env.File("builders.py"), env.File(builders.get_rtc_source_dir(env) + "/CMakeLists.txt")])
|
||||||
|
|
||||||
env.Append(LIBPATH=[builders.get_rtc_build_dir(env)])
|
env.Append(LIBPATH=[builders.get_rtc_build_dir(env)])
|
||||||
env.Append(CPPPATH=[builders.get_rtc_include_dir(env)])
|
env.Append(CPPPATH=[builders.get_rtc_include_dir(env)])
|
||||||
env.Prepend(LIBS=[rtc])
|
env.Prepend(LIBS=[builders.get_rtc_libs(env)])
|
||||||
|
|
||||||
# Our includes and sources
|
# Our includes and sources
|
||||||
env.Append(CPPPATH=["src/"])
|
env.Append(CPPPATH=["src/"])
|
||||||
@@ -116,10 +140,10 @@ else:
|
|||||||
sources.append("src/init_gdnative.cpp")
|
sources.append("src/init_gdnative.cpp")
|
||||||
add_sources(sources, "src/net/", "cpp")
|
add_sources(sources, "src/net/", "cpp")
|
||||||
|
|
||||||
env.Depends(sources, [ssl, rtc])
|
env.Depends(sources, [builders.get_ssl_libs(env), builders.get_rtc_libs(env)])
|
||||||
|
|
||||||
# Make the shared library
|
# Make the shared library
|
||||||
result_name = "webrtc_native.{}.{}.{}{}".format(env["platform"], env["target"], env["arch_suffix"], env["SHLIBSUFFIX"])
|
result_name = "webrtc_native{}{}".format(env["suffix"], env["SHLIBSUFFIX"])
|
||||||
env.Depends(sources, ssl)
|
env.Depends(sources, ssl)
|
||||||
|
|
||||||
if env["platform"] == "windows" and env["use_mingw"]:
|
if env["platform"] == "windows" and env["use_mingw"]:
|
||||||
@@ -129,12 +153,13 @@ library = env.SharedLibrary(target=os.path.join(result_path, "lib", result_name)
|
|||||||
Default(library)
|
Default(library)
|
||||||
|
|
||||||
# GDNativeLibrary
|
# GDNativeLibrary
|
||||||
gdnlib = "webrtc"
|
if env["godot_version"] == "3":
|
||||||
if target != "release":
|
gdnlib = "webrtc" if target != "debug" else "webrtc_debug"
|
||||||
gdnlib += "_debug"
|
ext = ".tres"
|
||||||
ext = ".tres" if env["godot_version"] == "3" else ".gdextension"
|
extfile = env.Substfile(os.path.join(result_path, gdnlib + ext), "misc/webrtc" + ext, SUBST_DICT={
|
||||||
extfile = env.Substfile(os.path.join(result_path, gdnlib + ext), "misc/webrtc" + ext, SUBST_DICT={
|
"{GDNATIVE_PATH}": gdnlib,
|
||||||
"{GDNATIVE_PATH}": gdnlib,
|
"{TARGET}": "template_" + env["target"],
|
||||||
"{TARGET}": env["target"],
|
})
|
||||||
})
|
else:
|
||||||
|
extfile = env.InstallAs(os.path.join(result_path, "webrtc.gdextension"), "misc/webrtc.gdextension")
|
||||||
Default(extfile)
|
Default(extfile)
|
||||||
|
|||||||
59
builders.py
59
builders.py
@@ -1,4 +1,5 @@
|
|||||||
import os
|
import os
|
||||||
|
from SCons.Defaults import Mkdir
|
||||||
from SCons.Script import Environment
|
from SCons.Script import Environment
|
||||||
|
|
||||||
|
|
||||||
@@ -11,7 +12,7 @@ def get_deps_dir(env):
|
|||||||
|
|
||||||
|
|
||||||
def get_deps_build_dir(env):
|
def get_deps_build_dir(env):
|
||||||
return get_deps_dir(env) + "/build/{}.{}.{}.dir".format(env["platform"], env["target"], env["arch_suffix"])
|
return get_deps_dir(env) + "/build/build{}.{}.dir".format(env["suffix"], "RelWithDebInfo" if env["debug_symbols"] else "Release")
|
||||||
|
|
||||||
|
|
||||||
def get_rtc_source_dir(env):
|
def get_rtc_source_dir(env):
|
||||||
@@ -26,6 +27,17 @@ def get_rtc_include_dir(env):
|
|||||||
return get_rtc_source_dir(env) + "/include"
|
return get_rtc_source_dir(env) + "/include"
|
||||||
|
|
||||||
|
|
||||||
|
def get_rtc_libs(env):
|
||||||
|
bdir = get_rtc_build_dir(env)
|
||||||
|
libs = [
|
||||||
|
"libdatachannel-static.a",
|
||||||
|
"deps/libjuice/libjuice-static.a",
|
||||||
|
"deps/libsrtp/libsrtp2.a",
|
||||||
|
"deps/usrsctp/usrsctplib/libusrsctp.a"
|
||||||
|
]
|
||||||
|
return [env.File(bdir + "/" + lib) for lib in libs]
|
||||||
|
|
||||||
|
|
||||||
def get_ssl_source_dir(env):
|
def get_ssl_source_dir(env):
|
||||||
return get_deps_dir(env) + "/openssl"
|
return get_deps_dir(env) + "/openssl"
|
||||||
|
|
||||||
@@ -42,19 +54,20 @@ def get_ssl_include_dir(env):
|
|||||||
return get_ssl_install_dir(env) + "/include"
|
return get_ssl_install_dir(env) + "/include"
|
||||||
|
|
||||||
|
|
||||||
|
def get_ssl_libs(env):
|
||||||
|
bdir = get_ssl_build_dir(env)
|
||||||
|
return [env.File(bdir + "/" + lib) for lib in ["libssl.a", "libcrypto.a"]]
|
||||||
|
|
||||||
|
|
||||||
def ssl_emitter(target, source, env):
|
def ssl_emitter(target, source, env):
|
||||||
build_dir = get_ssl_build_dir(env)
|
return get_ssl_libs(env), source
|
||||||
libs = ["libssl.a", "libcrypto.a"]
|
|
||||||
install_dir = get_ssl_install_dir(env)
|
|
||||||
ssl_include = os.path.join(source[0].abspath, "include")
|
|
||||||
return [env.File(build_dir + "/" + l) for l in libs], source
|
|
||||||
|
|
||||||
|
|
||||||
def ssl_action(target, source, env):
|
def ssl_action(target, source, env):
|
||||||
build_dir = get_ssl_build_dir(env)
|
build_dir = get_ssl_build_dir(env)
|
||||||
source_dir = source[0].abspath
|
source_dir = source[0].abspath
|
||||||
|
|
||||||
ssl_env = Environment()
|
ssl_env = env.Clone()
|
||||||
install_dir = get_ssl_install_dir(env)
|
install_dir = get_ssl_install_dir(env)
|
||||||
args = [
|
args = [
|
||||||
"no-ssl3",
|
"no-ssl3",
|
||||||
@@ -63,7 +76,7 @@ def ssl_action(target, source, env):
|
|||||||
"--prefix=%s" % install_dir,
|
"--prefix=%s" % install_dir,
|
||||||
"--openssldir=%s" % install_dir,
|
"--openssldir=%s" % install_dir,
|
||||||
]
|
]
|
||||||
if env["target"] == "debug":
|
if env["debug_symbols"]:
|
||||||
args.append("-d")
|
args.append("-d")
|
||||||
|
|
||||||
if env["platform"] != "windows":
|
if env["platform"] != "windows":
|
||||||
@@ -126,8 +139,8 @@ def ssl_action(target, source, env):
|
|||||||
|
|
||||||
jobs = env.GetOption("num_jobs")
|
jobs = env.GetOption("num_jobs")
|
||||||
ssl_env.Execute([
|
ssl_env.Execute([
|
||||||
"mkdir -p " + build_dir, # TODO python?
|
Mkdir(build_dir),
|
||||||
("cd %s && %s/Configure " % (build_dir, source_dir)) + " ".join(args),
|
"cd %s && perl %s/Configure %s" % (build_dir, source_dir, " ".join(['"%s"' % a for a in args])),
|
||||||
"make -C %s -j%s" % (build_dir, jobs),
|
"make -C %s -j%s" % (build_dir, jobs),
|
||||||
"make -C %s install_sw install_ssldirs -j%s" % (build_dir, jobs),
|
"make -C %s install_sw install_ssldirs -j%s" % (build_dir, jobs),
|
||||||
]
|
]
|
||||||
@@ -136,34 +149,26 @@ def ssl_action(target, source, env):
|
|||||||
|
|
||||||
|
|
||||||
def rtc_emitter(target, source, env):
|
def rtc_emitter(target, source, env):
|
||||||
build_dir = get_rtc_build_dir(env)
|
return get_rtc_libs(env), source
|
||||||
libs = ["libdatachannel-static.a", "libjuice-static.a", "libsrtp2.a", "libusrsctp.a"]
|
|
||||||
lib_paths = [
|
|
||||||
build_dir,
|
|
||||||
os.path.join(build_dir, "deps/libjuice"),
|
|
||||||
os.path.join(build_dir, "deps/libsrtp"),
|
|
||||||
os.path.join(build_dir, "deps/usrsctp/usrsctplib"),
|
|
||||||
]
|
|
||||||
return [env.File(lib_paths[i] + "/" + libs[i]) for i in range(len(libs))], source
|
|
||||||
|
|
||||||
|
|
||||||
def rtc_action(target, source, env):
|
def rtc_action(target, source, env):
|
||||||
build_dir = get_rtc_build_dir(env)
|
build_dir = get_rtc_build_dir(env)
|
||||||
source_dir = source[0].abspath
|
source_dir = source[0].abspath
|
||||||
args = [
|
args = [
|
||||||
|
"cmake",
|
||||||
"-B",
|
"-B",
|
||||||
build_dir,
|
build_dir,
|
||||||
"-DUSE_NICE=0",
|
"-DUSE_NICE=0",
|
||||||
"-DNO_WEBSOCKET=1",
|
"-DNO_WEBSOCKET=1",
|
||||||
#"-DNO_MEDIA=1", # Windows builds fail without it.
|
#"-DNO_MEDIA=1", # Windows builds fail without it.
|
||||||
"-DNO_EXAMPLES=1",
|
"-DNO_EXAMPLES=1",
|
||||||
"-DNO_WEBSOCKET=1",
|
|
||||||
"-DNO_TESTS=1",
|
"-DNO_TESTS=1",
|
||||||
"-DOPENSSL_USE_STATIC_LIBS=1",
|
"-DOPENSSL_USE_STATIC_LIBS=1",
|
||||||
"-DOPENSSL_INCLUDE_DIR=%s" % get_ssl_include_dir(env),
|
"-DOPENSSL_INCLUDE_DIR=%s" % get_ssl_include_dir(env),
|
||||||
"-DOPENSSL_SSL_LIBRARY=%s/libssl.a" % get_ssl_build_dir(env),
|
"-DOPENSSL_SSL_LIBRARY=%s/libssl.a" % get_ssl_build_dir(env),
|
||||||
"-DOPENSSL_CRYPTO_LIBRARY=%s/libcrypto.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"),
|
"-DCMAKE_BUILD_TYPE=%s" % ("RelWithDebInfo" if env["debug_symbols"] else "Release"),
|
||||||
]
|
]
|
||||||
if env["platform"] == "android":
|
if env["platform"] == "android":
|
||||||
abi = {
|
abi = {
|
||||||
@@ -215,7 +220,8 @@ def rtc_action(target, source, env):
|
|||||||
if env["arch"] == "x86_32":
|
if env["arch"] == "x86_32":
|
||||||
if env["use_mingw"]:
|
if env["use_mingw"]:
|
||||||
args.extend([
|
args.extend([
|
||||||
"-G 'Unix Makefiles'",
|
"-G",
|
||||||
|
"Unix Makefiles",
|
||||||
"-DCMAKE_C_COMPILER=i686-w64-mingw32-gcc",
|
"-DCMAKE_C_COMPILER=i686-w64-mingw32-gcc",
|
||||||
"-DCMAKE_CXX_COMPILER=i686-w64-mingw32-g++",
|
"-DCMAKE_CXX_COMPILER=i686-w64-mingw32-g++",
|
||||||
"-DCMAKE_SYSTEM_NAME=Windows",
|
"-DCMAKE_SYSTEM_NAME=Windows",
|
||||||
@@ -223,7 +229,8 @@ def rtc_action(target, source, env):
|
|||||||
else:
|
else:
|
||||||
if env["use_mingw"]:
|
if env["use_mingw"]:
|
||||||
args.extend([
|
args.extend([
|
||||||
"-G 'Unix Makefiles'",
|
"-G",
|
||||||
|
"Unix Makefiles",
|
||||||
"-DCMAKE_C_COMPILER=x86_64-w64-mingw32-gcc",
|
"-DCMAKE_C_COMPILER=x86_64-w64-mingw32-gcc",
|
||||||
"-DCMAKE_CXX_COMPILER=x86_64-w64-mingw32-g++",
|
"-DCMAKE_CXX_COMPILER=x86_64-w64-mingw32-g++",
|
||||||
"-DCMAKE_SYSTEM_NAME=Windows"
|
"-DCMAKE_SYSTEM_NAME=Windows"
|
||||||
@@ -231,10 +238,10 @@ def rtc_action(target, source, env):
|
|||||||
|
|
||||||
args.append(source_dir)
|
args.append(source_dir)
|
||||||
jobs = env.GetOption("num_jobs")
|
jobs = env.GetOption("num_jobs")
|
||||||
rtc_env = Environment()
|
rtc_env = env.Clone()
|
||||||
rtc_env.Execute([
|
rtc_env.Execute([
|
||||||
"cmake " + " ".join(args),
|
" ".join(['"%s"' % a for a in args]),
|
||||||
"cmake --build %s -t datachannel-static -j%s" % (build_dir, jobs),
|
"cmake --build %s -t datachannel-static -j%s" % (build_dir, jobs)
|
||||||
]
|
]
|
||||||
)
|
)
|
||||||
return None
|
return None
|
||||||
|
|||||||
2
deps/libdatachannel
vendored
2
deps/libdatachannel
vendored
Submodule deps/libdatachannel updated: 93847128f1...1ec2a2f519
2
deps/openssl
vendored
2
deps/openssl
vendored
Submodule deps/openssl updated: ad4910fad2...19cc035b6c
Submodule godot-cpp updated: fa4d18f21c...576bd17285
32
misc/scripts/package_release.sh
Executable file
32
misc/scripts/package_release.sh
Executable file
@@ -0,0 +1,32 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
|
||||||
|
set -e
|
||||||
|
set -x
|
||||||
|
|
||||||
|
ARTIFACTS=${ARTIFACTS:-"artifacts"}
|
||||||
|
DESTINATION=${DESTIONATION:-"release"}
|
||||||
|
VERSION=${VERSION:-"extension"}
|
||||||
|
TYPE=${TYPE:-"webrtc"}
|
||||||
|
|
||||||
|
mkdir -p ${DESTINATION}
|
||||||
|
ls -R ${DESTINATION}
|
||||||
|
|
||||||
|
DESTDIR="${DESTINATION}/${VERSION}/${TYPE}"
|
||||||
|
|
||||||
|
mkdir -p ${DESTDIR}/lib
|
||||||
|
|
||||||
|
find "${ARTIFACTS}" -wholename "*/${VERSION}/${TYPE}/lib/*" | xargs cp -t "${DESTDIR}/lib/"
|
||||||
|
find "${ARTIFACTS}" -wholename "*/LICENSE*" | xargs cp -t "${DESTDIR}/"
|
||||||
|
|
||||||
|
if [ $VERSION = "extension" ]; then
|
||||||
|
find "${ARTIFACTS}" -wholename "*/${VERSION}/${TYPE}/${TYPE}.gdextension" | head -n 1 | xargs cp -t "${DESTDIR}/"
|
||||||
|
else
|
||||||
|
find "${ARTIFACTS}" -wholename "*/${VERSION}/${TYPE}/${TYPE}.tres" | head -n 1 | xargs cp -t "${DESTDIR}/"
|
||||||
|
fi
|
||||||
|
|
||||||
|
CURDIR=$(pwd)
|
||||||
|
cd "${DESTINATION}/${VERSION}"
|
||||||
|
zip -r ../godot-${VERSION}-${TYPE}.zip ${TYPE}
|
||||||
|
cd "$CURDIR"
|
||||||
|
|
||||||
|
ls -R ${DESTINATION}
|
||||||
@@ -4,13 +4,24 @@ entry_symbol = "webrtc_extension_init"
|
|||||||
|
|
||||||
[libraries]
|
[libraries]
|
||||||
|
|
||||||
linux.x86_64 = "res://{GDNATIVE_PATH}/lib/libwebrtc_native.linux.{TARGET}.x86_64.so"
|
linux.debug.x86_64 = "res://webrtc/lib/libwebrtc_native.linux.template_debug.x86_64.so"
|
||||||
linux.x86_32 = "res://{GDNATIVE_PATH}/lib/libwebrtc_native.linux.{TARGET}.x86_32.so"
|
linux.debug.x86_32 = "res://webrtc/lib/libwebrtc_native.linux.template_debug.x86_32.so"
|
||||||
osx.x86_64 = "res://{GDNATIVE_PATH}/lib/libwebrtc_native.osx.{TARGET}.x86_64.dylib"
|
macos.debug.x86_64 = "res://webrtc/lib/libwebrtc_native.macos.template_debug.x86_64.dylib"
|
||||||
osx.arm64 = "res://{GDNATIVE_PATH}/lib/libwebrtc_native.osx.{TARGET}.arm64.dylib"
|
macos.debug.arm64 = "res://webrtc/lib/libwebrtc_native.macos.template_debug.arm64.dylib"
|
||||||
windows.x86_64 = "res://{GDNATIVE_PATH}/lib/libwebrtc_native.windows.{TARGET}.x86_64.dll"
|
windows.debug.x86_64 = "res://webrtc/lib/libwebrtc_native.windows.template_debug.x86_64.dll"
|
||||||
windows.x86_32 = "res://{GDNATIVE_PATH}/lib/libwebrtc_native.windows.{TARGET}.x86_32.dll"
|
windows.debug.x86_32 = "res://webrtc/lib/libwebrtc_native.windows.template_debug.x86_32.dll"
|
||||||
android.arm64 = "res://{GDNATIVE_PATH}/lib/libwebrtc_native.android.{TARGET}.arm64.so"
|
android.debug.arm64 = "res://webrtc/lib/libwebrtc_native.android.template_debug.arm64.so"
|
||||||
android.x86_64 = "res://{GDNATIVE_PATH}/lib/libwebrtc_native.android.{TARGET}.x86_64.so"
|
android.debug.x86_64 = "res://webrtc/lib/libwebrtc_native.android.template_debug.x86_64.so"
|
||||||
ios.arm64 = "res://{GDNATIVE_PATH}/lib/libwebrtc_native.ios.{TARGET}.arm64.dylib"
|
ios.debug.arm64 = "res://webrtc/lib/libwebrtc_native.ios.template_debug.arm64.dylib"
|
||||||
ios.x86_64 = "res://{GDNATIVE_PATH}/lib/libwebrtc_native.ios.{TARGET}.x86_64.simulator.dylib"
|
ios.debug.x86_64 = "res://webrtc/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"
|
||||||
|
macos.release.x86_64 = "res://webrtc/lib/libwebrtc_native.macos.template_release.x86_64.dylib"
|
||||||
|
macos.release.arm64 = "res://webrtc/lib/libwebrtc_native.macos.template_release.arm64.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"
|
||||||
|
|||||||
@@ -40,6 +40,8 @@
|
|||||||
#define GDCLASS(arg1, arg2) GODOT_CLASS(arg1, arg2)
|
#define GDCLASS(arg1, arg2) GODOT_CLASS(arg1, arg2)
|
||||||
#endif
|
#endif
|
||||||
#else
|
#else
|
||||||
|
#include <godot_cpp/core/binder_common.hpp>
|
||||||
|
|
||||||
#include <godot_cpp/classes/global_constants_binds.hpp>
|
#include <godot_cpp/classes/global_constants_binds.hpp>
|
||||||
#include <godot_cpp/classes/web_rtc_data_channel_extension.hpp>
|
#include <godot_cpp/classes/web_rtc_data_channel_extension.hpp>
|
||||||
#endif
|
#endif
|
||||||
|
|||||||
@@ -40,6 +40,8 @@
|
|||||||
#define GDCLASS(arg1, arg2) GODOT_CLASS(arg1, arg2)
|
#define GDCLASS(arg1, arg2) GODOT_CLASS(arg1, arg2)
|
||||||
#endif
|
#endif
|
||||||
#else
|
#else
|
||||||
|
#include <godot_cpp/core/binder_common.hpp>
|
||||||
|
|
||||||
#include <godot_cpp/classes/global_constants_binds.hpp>
|
#include <godot_cpp/classes/global_constants_binds.hpp>
|
||||||
#include <godot_cpp/classes/web_rtc_peer_connection_extension.hpp>
|
#include <godot_cpp/classes/web_rtc_peer_connection_extension.hpp>
|
||||||
#endif
|
#endif
|
||||||
|
|||||||
Reference in New Issue
Block a user