Compare commits

..

40 Commits

Author SHA1 Message Date
Fabio Alessandrelli
e34000653b Merge pull request #95 from Faless/bump/openssl_3.0.8_libdatachannel_0.18.4
[3rd Party] Bump to openssl 3.0.8 and libdatachannel 0.18.4
2023-05-24 20:16:15 +02:00
Fabio Alessandrelli
826a736176 [libdatachannel] Bump to version 0.18.4 2023-05-24 19:12:25 +02:00
Fabio Alessandrelli
b7098e7496 [OpenSSL] Bump to version 3.0.8 2023-05-24 16:40:47 +02:00
Fabio Alessandrelli
6de604ffee Merge pull request #94 from Faless/fix/macos_releases
[macOS] Add support for universal builds.
2023-05-24 16:28:34 +02:00
Fabio Alessandrelli
f0af5f9982 [macOS] Add support for universal builds.
Since the OpenSSL build system does not support macOS universal
binaries, we first need to build the two libraries separately, then we
join them together using lipo.
2023-05-24 00:53:28 +02:00
Fabio Alessandrelli
fbe4e06b9f Merge pull request #93 from Faless/bump/4.0-stable
Bump godot-cpp to 4.0-stable.
2023-05-23 12:53:57 +02:00
Fabio Alessandrelli
9a9fc0953b Bump godot-cpp to 4.0-stable. 2023-05-23 10:43:45 +02:00
Fabio Alessandrelli
c6b6f7e18c Merge pull request #87 from Faless/bump/rc1
Update to Godot 4.0 rc1.
2023-02-09 19:20:56 +01:00
Fabio Alessandrelli
00f952bcf1 Update to Godot 4.0 rc1. 2023-02-09 15:31:39 +01:00
Fabio Alessandrelli
d7032f7b85 Merge pull request #85 from Faless/fix/godot3_mingw
Workaround incorrect CC for 3.x mingw builds.
2023-02-07 23:14:09 +01:00
Fabio Alessandrelli
c9a1efc7a0 Workaround incorrect CC for 3.x mingw builds. 2023-02-06 19:08:45 +01:00
Fabio Alessandrelli
5bc4b79435 Merge pull request #83 from Faless/bump/beta14
Update to Godot 4.0 beta14.
2023-01-21 16:07:16 +01:00
Fabio Alessandrelli
b7b76dddab Update to Godot 4.0 beta14. 2023-01-21 10:00:01 +01:00
Fabio Alessandrelli
0b1c55ed83 Merge pull request #82 from Faless/bump/beta13
Update to Godot 4.0 beta13.
2023-01-20 12:27:43 +01:00
Fabio Alessandrelli
093ac7d489 Update to Godot 4.0 beta13. 2023-01-18 08:57:07 +01:00
Fabio Alessandrelli
84e9d6dd37 Merge pull request #81 from Faless/bump/beta12
Update to Godot 4.0 beta12.
2023-01-14 04:15:34 +01:00
Fabio Alessandrelli
a49a2b03e1 Revert "[Extension] Fix library resource waiting for Godot auto prefix."
This reverts commit 0c10a7f3e3.
2023-01-13 18:09:17 +01:00
Fabio Alessandrelli
656d3a9964 Update to Godot 4.0 beta12.
Also update thirdparty README with correct libdatachannel version.
2023-01-13 18:06:10 +01:00
Fabio Alessandrelli
2bc2a5d162 Merge pull request #80 from Faless/bump/beta11
Update to Godot 4.0-beta11, libdatachannel v0.18.1
2023-01-12 17:08:36 +01:00
Fabio Alessandrelli
7176344056 Update to Godot 4.0-beta11, libdatachannel v0.18.1
Also update godot-cpp-3.x for better cache support.
2023-01-12 15:59:48 +01:00
Fabio Alessandrelli
7d260b1b32 Merge pull request #79 from Faless/fix/template_debug
[Extension] Fix library resource waiting for Godot auto prefix.
2023-01-12 15:57:10 +01:00
Fabio Alessandrelli
0c10a7f3e3 [Extension] Fix library resource waiting for Godot auto prefix. 2023-01-12 15:12:09 +01:00
Fabio Alessandrelli
40962dbe19 Merge pull request #78 from Faless/build/split_deps
[SCons] Refactor build tools.
2023-01-09 21:48:09 +01:00
Fabio Alessandrelli
bdd9d50745 [SCons] Refactor build tools.
Split dependency builders into separate tools, optimize OpenSSL builds.
2022-12-30 14:34:15 +01:00
Fabio Alessandrelli
5348407de9 Merge pull request #77 from Faless/bump/beta10
Update to Godot 4.0-beta10.
2022-12-29 17:30:51 +01:00
Fabio Alessandrelli
5002991511 Update to Godot 4.0-beta10. 2022-12-29 15:38:48 +01:00
Fabio Alessandrelli
0fc992e0d5 Merge pull request #76 from Faless/bump/beta9
Update to Godot 4.0 beta9
2022-12-19 22:11:33 +01:00
Fabio Alessandrelli
fbadff454c Update to Godot 4.0 beta9 2022-12-19 20:42:56 +01:00
Fabio Alessandrelli
61a6d25c47 Merge pull request #75 from Faless/bump/beta8
Bump godot-cpp to beta8, libdatachannel to v0.18.0
2022-12-10 18:26:25 +01:00
Fabio Alessandrelli
dfaad6f5ba Bump godot-cpp to beta8, libdatachannel to v0.18.0
libdatachannel and libjuice are now released under MPL 2.0.

Dependencies has been refactored under a `thirdparty` folder similar to
what we have in Godot, with a dedicated `thirdparty/README.md`
containing details information on dependencies upstreams, versions, and
licenses.
2022-12-10 17:13:59 +01:00
Fabio Alessandrelli
35bdd5efa7 Merge pull request #73 from Faless/bump/beta6
Update to Godot 4.0 beta6, and bump dependencies.
2022-11-28 20:19:47 +01:00
Fabio Alessandrelli
90aaa0b82e Update to libdatachannel v0.17.12+git. 2022-11-28 17:54:19 +01:00
Fabio Alessandrelli
16f311844b Update to OpenSSL 3.0.7. 2022-11-28 17:54:19 +01:00
Fabio Alessandrelli
dfb34df36e Update to Godot 4.0-beta6 2022-11-28 17:54:19 +01:00
Fabio Alessandrelli
9715e73ae4 Merge pull request #74 from Faless/build/cache_and_paths
[SCons] Fix caching and path detection.
2022-11-28 17:53:10 +01:00
Fabio Alessandrelli
2e9a25bb39 [SCons] Fix caching and path detection.
Add version file depenencies to SSL and RTC targets.

Disable OpenSSL caching since it causes issues as it doesn't properly
cache generated header files.

Add hack to prepend PATH and few other vars (should probably be added
to upstream godot-cpp), and clone scons envs when building ssl/rtc (so
that PATHs are properly setup).
2022-11-28 03:10:20 +01:00
Fabio Alessandrelli
6067addd96 Merge pull request #72 from JonathanPicques/patch-1
Rename osx to macos in webrtc.gdextension
2022-11-26 15:50:07 +01:00
Jonathan Picques
a3fbd33464 Rename osx to macos in webrtc.gdextension
The plugin wouldn't work with Godot beta 5 because it expects a macos key instead of an osx
2022-11-26 13:56:06 +01:00
Fabio Alessandrelli
d697901f81 Merge pull request #70 from Faless/bump/beta5
Update to Godot 4.0-beta5
2022-11-19 11:08:34 +01:00
Fabio Alessandrelli
3eb7d0aa3b Update to Godot 4.0-beta5 2022-11-19 01:43:24 +01:00
26 changed files with 444 additions and 342 deletions

View File

@@ -84,17 +84,11 @@ jobs:
# macOS
- platform: macos
arch: 'x86_64'
gdnative_flags: 'macos_arch=x86_64 bits=64'
arch: 'universal'
gdnative_flags: 'macos_arch=universal bits=64'
sconsflags: ''
os: 'macos-11'
cache-name: macos-x86_64
- platform: macos
gdnative_flags: 'macos_arch=arm64 bits=64'
arch: 'arm64'
sconsflags: ''
os: 'macos-11'
cache-name: macos-arm64
cache-name: macos-universal
# Windows
- platform: windows
@@ -164,7 +158,7 @@ jobs:
- name: Compile Extension - template_debug - ${{ matrix.platform }} - ${{ matrix.arch }}
run: |
scons target=template_debug generate_bindings=yes
scons target=template_debug
- name: Compile Extension - template_release - ${{ matrix.platform }} - ${{ matrix.arch }}
run: |
@@ -177,7 +171,9 @@ jobs:
- uses: actions/upload-artifact@v3
with:
name: ${{ github.job }}-${{ matrix.platform }}-${{ matrix.arch }}
path: bin/*
path: |
bin/
!bin/thirdparty/
package:
name: 📦 Package
@@ -195,13 +191,13 @@ jobs:
- name: Bundle licenses.
run: |
cp LICENSE artifacts/LICENSE.webrtc-native
cp deps/libdatachannel/LICENSE artifacts/LICENSE.libdatachannel
cp deps/openssl/LICENSE.txt artifacts/LICENSE.openssl
cp deps/libdatachannel/deps/libjuice/LICENSE artifacts/LICENSE.libjuice
cp deps/libdatachannel/deps/usrsctp/LICENSE.md artifacts/LICENSE.usrsctp
cp deps/libdatachannel/deps/libsrtp/LICENSE artifacts/LICENSE.libsrtp
cp deps/libdatachannel/deps/json/LICENSE.MIT artifacts/LICENSE.json
cp deps/libdatachannel/deps/plog/LICENSE artifacts/LICENSE.plog
cp thirdparty/libdatachannel/LICENSE artifacts/LICENSE.libdatachannel
cp thirdparty/openssl/LICENSE.txt artifacts/LICENSE.openssl
cp thirdparty/libdatachannel/deps/libjuice/LICENSE artifacts/LICENSE.libjuice
cp thirdparty/libdatachannel/deps/usrsctp/LICENSE.md artifacts/LICENSE.usrsctp
cp thirdparty/libdatachannel/deps/libsrtp/LICENSE artifacts/LICENSE.libsrtp
cp thirdparty/libdatachannel/deps/json/LICENSE.MIT artifacts/LICENSE.json
cp thirdparty/libdatachannel/deps/plog/LICENSE artifacts/LICENSE.plog
- name: Package artifacts for release
env:

2
.gitignore vendored
View File

@@ -5,3 +5,5 @@ bin/*
.sconsign.dblite
*.obj
*.swp
__pycache__/*
*.pyc

4
.gitmodules vendored
View File

@@ -5,8 +5,8 @@
path = godot-cpp
url = https://github.com/godotengine/godot-cpp.git
[submodule "libdatachannel"]
path = deps/libdatachannel
path = thirdparty/libdatachannel
url = https://github.com/paullouisageneau/libdatachannel.git
[submodule "openssl"]
path = deps/openssl
path = thirdparty/openssl
url = https://github.com/openssl/openssl.git

View File

@@ -45,6 +45,4 @@ You simply need to copy that folder to the root folder of your project. Note tha
### License
The `webrtc-native` plugin is licensed under the MIT license (see [LICENSE](https://github.com/godotengine/webrtc-native/blob/master/LICENSE)), while `libdatachannel` and one of its dependencies (`libjuice`) are licensed under LGPLv2.1 or later, see [libdatachannel LICENSE](https://github.com/paullouisageneau/libdatachannel/blob/master/LICENSE) and [libjuice LICENSE](https://github.com/paullouisageneau/libjuice/blob/master/LICENSE).
Make sure you understand and comply with the LGPLv2.1 license when redistributing this plugin.
The `webrtc-native` plugin is licensed under the MIT license (see [LICENSE](https://github.com/godotengine/webrtc-native/blob/master/LICENSE)), while `libdatachannel` and its dependencies are licensed under other permissive open source licences. Please see [`thirdparty/README.md`](thirdparty/README.md) for more informations.

View File

@@ -1,8 +1,7 @@
#!python
import os, sys, platform, json, subprocess
import builders
import SCons
def add_sources(sources, dirpath, extension):
@@ -26,11 +25,6 @@ if env["godot_version"] == "3":
if "platform" in ARGUMENTS and ARGUMENTS["platform"] == "macos":
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")
# Patch base env
@@ -75,10 +69,27 @@ if env["godot_version"] == "3":
target_compat = "template_" + env["target"]
env["suffix"] = ".{}.{}.{}".format(env["platform"], target_compat, env["arch_suffix"])
env["debug_symbols"] = False
# Set missing CC for MinGW from upstream build module.
if env["platform"] == "windows" and sys.platform != "win32" and sys.platform != "msys":
# Cross-compilation using MinGW
if env["bits"] == "64":
env["CC"] = "x86_64-w64-mingw32-gcc"
elif env["bits"] == "32":
env["CC"] = "i686-w64-mingw32-gcc"
else:
ARGUMENTS["ios_min_version"] = "11.0"
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.
if env["platform"] == "windows" and env["use_mingw"]:
env["SHLIBSUFFIX"] = ".dll"
@@ -91,31 +102,9 @@ if env["godot_version"] == "3":
else:
result_path = os.path.join("bin", "extension", "webrtc")
# Dependencies
deps_source_dir = "deps"
env.Append(BUILDERS={
"BuildOpenSSL": env.Builder(action=builders.ssl_action, emitter=builders.ssl_emitter),
"BuildLibDataChannel": env.Builder(action=builders.rtc_action, emitter=builders.rtc_emitter),
})
# SSL
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.Prepend(CPPPATH=[builders.get_ssl_include_dir(env)])
env.Prepend(LIBPATH=[builders.get_ssl_build_dir(env)])
env.Append(LIBS=[ssl])
# RTC
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.Append(LIBPATH=[builders.get_rtc_build_dir(env)])
env.Append(CPPPATH=[builders.get_rtc_include_dir(env)])
env.Prepend(LIBS=[rtc])
# Our includes and sources
env.Append(CPPPATH=["src/"])
env.Append(CPPDEFINES=["RTC_STATIC"])
sources = []
sources.append(
[
@@ -130,17 +119,48 @@ else:
sources.append("src/init_gdnative.cpp")
add_sources(sources, "src/net/", "cpp")
env.Depends(sources, [ssl, rtc])
# Since the OpenSSL build system does not support macOS universal binaries, we first need to build the two libraries
# separately, then we join them together using lipo.
mac_universal = env["platform"] == "macos" and env["arch"] == "universal"
build_targets = []
build_envs = [env]
# Make the shared library
result_name = "webrtc_native{}{}".format(env["suffix"], env["SHLIBSUFFIX"])
env.Depends(sources, ssl)
# For macOS universal builds, setup one build environment per architecture.
if mac_universal:
build_envs = []
for arch in ["x86_64", "arm64"]:
benv = env.Clone()
benv["arch"] = arch
benv["CCFLAGS"] = SCons.Util.CLVar(str(benv["CCFLAGS"]).replace("-arch x86_64 -arch arm64", "-arch " + arch))
benv["LINKFLAGS"] = SCons.Util.CLVar(str(benv["LINKFLAGS"]).replace("-arch x86_64 -arch arm64", "-arch " + arch))
benv["suffix"] = benv["suffix"].replace("universal", arch)
benv["SHOBJSUFFIX"] = benv["suffix"] + benv["SHOBJSUFFIX"]
build_envs.append(benv)
if env["platform"] == "windows" and env["use_mingw"]:
env.Append(LIBS=["iphlpapi", "ws2_32", "bcrypt"])
# Build our library and its dependencies.
for benv in build_envs:
# Dependencies
for tool in ["cmake", "common", "ssl", "rtc"]:
benv.Tool(tool, toolpath=["tools"])
library = env.SharedLibrary(target=os.path.join(result_path, "lib", result_name), source=sources)
Default(library)
ssl = benv.BuildOpenSSL()
benv.NoCache(ssl) # Needs refactoring to properly cache generated headers.
rtc = benv.BuildLibDataChannel()
benv.Depends(sources, [ssl, rtc])
# Make the shared library
result_name = "webrtc_native{}{}".format(benv["suffix"], benv["SHLIBSUFFIX"])
library = benv.SharedLibrary(target=os.path.join(result_path, "lib", result_name), source=sources)
build_targets.append(library)
Default(build_targets)
# For macOS universal builds, join the libraries using lipo.
if mac_universal:
result_name = "libwebrtc_native{}{}".format(env["suffix"], env["SHLIBSUFFIX"])
universal_target = env.Command(os.path.join(result_path, "lib", result_name), build_targets, "lipo $SOURCES -output $TARGETS -create")
Default(universal_target)
# GDNativeLibrary
if env["godot_version"] == "3":
@@ -152,4 +172,5 @@ if env["godot_version"] == "3":
})
else:
extfile = env.InstallAs(os.path.join(result_path, "webrtc.gdextension"), "misc/webrtc.gdextension")
Default(extfile)

View File

@@ -1,240 +0,0 @@
import os
from SCons.Script import Environment
def get_android_api(env):
return env["android_api_level"] if int(env["android_api_level"]) > 28 else "28"
def get_deps_dir(env):
return env.Dir("#deps").abspath
def get_deps_build_dir(env):
return get_deps_dir(env) + "/build/build{}.{}.dir".format(env["suffix"], "RelWithDebInfo" if env["debug_symbols"] else "Release")
def get_rtc_source_dir(env):
return get_deps_dir(env) + "/libdatachannel"
def get_rtc_build_dir(env):
return get_deps_build_dir(env) + "/libdatachannel"
def get_rtc_include_dir(env):
return get_rtc_source_dir(env) + "/include"
def get_ssl_source_dir(env):
return get_deps_dir(env) + "/openssl"
def get_ssl_build_dir(env):
return get_deps_build_dir(env) + "/openssl"
def get_ssl_install_dir(env):
return get_ssl_build_dir(env) + "/dest"
def get_ssl_include_dir(env):
return get_ssl_install_dir(env) + "/include"
def ssl_emitter(target, source, env):
build_dir = get_ssl_build_dir(env)
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):
build_dir = get_ssl_build_dir(env)
source_dir = source[0].abspath
ssl_env = Environment()
install_dir = get_ssl_install_dir(env)
args = [
"no-ssl3",
"no-weak-ssl-ciphers",
"no-legacy",
"--prefix=%s" % install_dir,
"--openssldir=%s" % install_dir,
]
if env["debug_symbols"]:
args.append("-d")
if env["platform"] != "windows":
args.append("no-shared") # Windows "app" doesn't like static-only builds.
if env["platform"] == "linux":
if env["arch"] == "x86_32":
args.extend(["linux-x86"])
else:
args.extend(["linux-x86_64"])
elif env["platform"] == "android":
args.extend([
{
"arm64": "android-arm64",
"arm32": "android-arm",
"x86_32": "android-x86",
"x86_64": "android-x86_64",
}[env["arch"]],
"-D__ANDROID_API__=%s" % get_android_api(env),
])
# Setup toolchain path.
ssl_env.PrependENVPath("PATH", os.path.dirname(env["CC"]))
ssl_env["ENV"]["ANDROID_NDK_ROOT"] = os.environ.get("ANDROID_NDK_ROOT", "")
elif env["platform"] == "macos":
if env["arch"] == "x86_64":
args.extend(["darwin64-x86_64"])
elif env["arch"] == "arm64":
args.extend(["darwin64-arm64"])
else:
raise ValueError("macOS architecture not supported: %s" % env["arch"])
elif env["platform"] == "ios":
if env["ios_simulator"]:
args.extend(["iossimulator-xcrun"])
elif env["arch"] == "arm32":
args.extend(["ios-xcrun"])
elif env["arch"] == "arm64":
args.extend(["ios64-xcrun"])
else:
raise ValueError("iOS architecture not supported: %s" % env["arch"])
elif env["platform"] == "windows":
if env["arch"] == "x86_32":
if env["use_mingw"]:
args.extend([
"mingw",
"--cross-compile-prefix=i686-w64-mingw32-",
])
else:
args.extend(["VC-WIN32"])
else:
if env["use_mingw"]:
args.extend([
"mingw64",
"--cross-compile-prefix=x86_64-w64-mingw32-",
])
else:
args.extend(["VC-WIN64A"])
jobs = env.GetOption("num_jobs")
ssl_env.Execute([
"mkdir -p " + build_dir, # TODO python?
("cd %s && %s/Configure " % (build_dir, source_dir)) + " ".join(args),
"make -C %s -j%s" % (build_dir, jobs),
"make -C %s install_sw install_ssldirs -j%s" % (build_dir, jobs),
]
)
return None
def rtc_emitter(target, source, env):
build_dir = get_rtc_build_dir(env)
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):
build_dir = get_rtc_build_dir(env)
source_dir = source[0].abspath
args = [
"-B",
build_dir,
"-DUSE_NICE=0",
"-DNO_WEBSOCKET=1",
#"-DNO_MEDIA=1", # Windows builds fail without it.
"-DNO_EXAMPLES=1",
"-DNO_WEBSOCKET=1",
"-DNO_TESTS=1",
"-DOPENSSL_USE_STATIC_LIBS=1",
"-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" % ("RelWithDebInfo" if env["debug_symbols"] else "Release"),
]
if env["platform"] == "android":
abi = {
"arm64": "arm64-v8a",
"arm32": "armeabi-v7a",
"x86_32": "x86",
"x86_64": "x86_64",
}[env["arch"]]
args.extend([
"-DCMAKE_SYSTEM_NAME=Android",
"-DCMAKE_SYSTEM_VERSION=%s" % get_android_api(env),
"-DCMAKE_ANDROID_ARCH_ABI=%s" % abi,
"-DANDROID_ABI=%s" % abi,
"-DCMAKE_TOOLCHAIN_FILE=%s/build/cmake/android.toolchain.cmake" % os.environ.get("ANDROID_NDK_ROOT", ""),
"-DCMAKE_ANDROID_STL_TYPE=c++_static",
])
elif env["platform"] == "linux":
if env["arch"] == "x86_32":
args.extend([
"-DCMAKE_C_FLAGS=-m32",
"-DCMAKE_CXX_FLAGS=-m32"
])
else:
args.extend([
"-DCMAKE_C_FLAGS=-m64",
"-DCMAKE_CXX_FLAGS=-m64"
])
elif env["platform"] == "macos":
if env["macos_deployment_target"] != "default":
args.extend(["-DCMAKE_OSX_DEPLOYMENT_TARGET=%s" % env["macos_deployment_target"]])
if env["arch"] == "x86_64":
args.extend(["-DCMAKE_OSX_ARCHITECTURES=x86_64"])
elif env["arch"] == "arm64":
args.extend(["-DCMAKE_OSX_ARCHITECTURES=arm64"])
else:
raise ValueError("OSX architecture not supported: %s" % env["arch"])
elif env["platform"] == "ios":
if env["arch"] == "universal":
raise ValueError("iOS architecture not supported: %s" % env["arch"])
args.extend([
"-DCMAKE_SYSTEM_NAME=iOS",
"-DCMAKE_OSX_DEPLOYMENT_TARGET=11.0",
"-DCMAKE_OSX_ARCHITECTURES=%s" % env["arch"],
])
if env["ios_simulator"]:
args.extend(["-DCMAKE_OSX_SYSROOT=iphonesimulator"])
elif env["platform"] == "windows":
args.extend(["-DOPENSSL_ROOT_DIR=%s" % get_ssl_build_dir(env)])
if env["arch"] == "x86_32":
if env["use_mingw"]:
args.extend([
"-G 'Unix Makefiles'",
"-DCMAKE_C_COMPILER=i686-w64-mingw32-gcc",
"-DCMAKE_CXX_COMPILER=i686-w64-mingw32-g++",
"-DCMAKE_SYSTEM_NAME=Windows",
])
else:
if env["use_mingw"]:
args.extend([
"-G 'Unix Makefiles'",
"-DCMAKE_C_COMPILER=x86_64-w64-mingw32-gcc",
"-DCMAKE_CXX_COMPILER=x86_64-w64-mingw32-g++",
"-DCMAKE_SYSTEM_NAME=Windows"
])
args.append(source_dir)
jobs = env.GetOption("num_jobs")
rtc_env = Environment()
rtc_env.Execute([
"cmake " + " ".join(args),
"cmake --build %s -t datachannel-static -j%s" % (build_dir, jobs),
]
)
return None

1
deps/libdatachannel vendored

Submodule deps/libdatachannel deleted from 93847128f1

1
deps/openssl vendored

Submodule deps/openssl deleted from ad4910fad2

View File

@@ -6,8 +6,7 @@ entry_symbol = "webrtc_extension_init"
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"
osx.debug.x86_64 = "res://webrtc/lib/libwebrtc_native.osx.template_debug.x86_64.dylib"
osx.debug.arm64 = "res://webrtc/lib/libwebrtc_native.osx.template_debug.arm64.dylib"
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"
@@ -17,8 +16,7 @@ ios.debug.x86_64 = "res://webrtc/lib/libwebrtc_native.ios.template_debug.x86_64.
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"
osx.release.x86_64 = "res://webrtc/lib/libwebrtc_native.osx.template_release.x86_64.dylib"
osx.release.arm64 = "res://webrtc/lib/libwebrtc_native.osx.template_release.arm64.dylib"
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"

View File

@@ -3,8 +3,7 @@
[resource]
singleton = true
reloadable = false
entry/OSX.64 = "res://{GDNATIVE_PATH}/lib/libwebrtc_native.osx.{TARGET}.x86_64.dylib"
entry/OSX.arm64 = "res://{GDNATIVE_PATH}/lib/libwebrtc_native.osx.{TARGET}.arm64.dylib"
entry/OSX.64 = "res://{GDNATIVE_PATH}/lib/libwebrtc_native.macos.{TARGET}.universal.dylib"
entry/Windows.64 = "res://{GDNATIVE_PATH}/lib/libwebrtc_native.windows.{TARGET}.x86_64.dll"
entry/Windows.32 = "res://{GDNATIVE_PATH}/lib/libwebrtc_native.windows.{TARGET}.x86_32.dll"
entry/X11.64 = "res://{GDNATIVE_PATH}/lib/libwebrtc_native.linux.{TARGET}.x86_64.so"
@@ -16,11 +15,3 @@ entry/Android.x64 = "res://{GDNATIVE_PATH}/lib/libwebrtc_native.android.{TARGET}
entry/iOS.armv7 = "res://{GDNATIVE_PATH}/lib/libwebrtc_native.ios.{TARGET}.armv32.dylib"
entry/iOS.arm64 = "res://{GDNATIVE_PATH}/lib/libwebrtc_native.ios.{TARGET}.arm64.dylib"
entry/iOS.x86_64 = "res://{GDNATIVE_PATH}/lib/libwebrtc_native.ios.{TARGET}.x86_64.simulator.dylib"
dependency/Windows.64 = [ ]
dependency/Windows.32 = [ ]
dependency/X11.64 = [ ]
dependency/X11.32 = [ ]
dependency/Server.64 = [ ]
dependency/Server.32 = [ ]
dependency/Android.armeabi-v7a = [ ]
dependency/Android.arm64-v8a = [ ]

View File

@@ -136,17 +136,17 @@ bool WebRTCLibDataChannel::_is_ordered() const {
return channel->reliability().unordered == false;
}
int64_t WebRTCLibDataChannel::_get_id() const {
int32_t WebRTCLibDataChannel::_get_id() const {
ERR_FAIL_COND_V(!channel, -1);
return channel->id().value_or(-1);
}
int64_t WebRTCLibDataChannel::_get_max_packet_life_time() const {
int32_t WebRTCLibDataChannel::_get_max_packet_life_time() const {
ERR_FAIL_COND_V(!channel, 0);
return channel->reliability().type == rtc::Reliability::Type::Timed ? std::get<std::chrono::milliseconds>(channel->reliability().rexmit).count() : -1;
}
int64_t WebRTCLibDataChannel::_get_max_retransmits() const {
int32_t WebRTCLibDataChannel::_get_max_retransmits() const {
ERR_FAIL_COND_V(!channel, 0);
return channel->reliability().type == rtc::Reliability::Type::Rexmit ? std::get<int>(channel->reliability().rexmit) : -1;
}
@@ -161,7 +161,7 @@ bool WebRTCLibDataChannel::_is_negotiated() const {
return negotiated;
}
int64_t WebRTCLibDataChannel::_get_buffered_amount() const {
int32_t WebRTCLibDataChannel::_get_buffered_amount() const {
ERR_FAIL_COND_V(!channel, 0);
return channel->bufferedAmount();
}
@@ -194,7 +194,7 @@ Error WebRTCLibDataChannel::_get_packet(const uint8_t **r_buffer, int32_t *r_len
return OK;
}
Error WebRTCLibDataChannel::_put_packet(const uint8_t *p_buffer, int64_t p_len) try {
Error WebRTCLibDataChannel::_put_packet(const uint8_t *p_buffer, int32_t p_len) try {
ERR_FAIL_COND_V(!channel, FAILED);
ERR_FAIL_COND_V(channel->isClosed(), FAILED);
if (write_mode == WRITE_MODE_TEXT) {
@@ -212,11 +212,11 @@ Error WebRTCLibDataChannel::_put_packet(const uint8_t *p_buffer, int64_t p_len)
ERR_FAIL_V(FAILED);
}
int64_t WebRTCLibDataChannel::_get_available_packet_count() const {
int32_t WebRTCLibDataChannel::_get_available_packet_count() const {
return packet_queue.size();
}
int64_t WebRTCLibDataChannel::_get_max_packet_size() const {
int32_t WebRTCLibDataChannel::_get_max_packet_size() const {
return 16384; // See RFC-8831 section 6.6: https://datatracker.ietf.org/doc/rfc8831/
}

View File

@@ -79,9 +79,9 @@ public:
/* PacketPeer */
virtual godot::Error _get_packet(const uint8_t **r_buffer, int32_t *r_len) override;
virtual godot::Error _put_packet(const uint8_t *p_buffer, int64_t p_len) override;
virtual int64_t _get_available_packet_count() const override;
virtual int64_t _get_max_packet_size() const override;
virtual godot::Error _put_packet(const uint8_t *p_buffer, int32_t p_len) override;
virtual int32_t _get_available_packet_count() const override;
virtual int32_t _get_max_packet_size() const override;
/* WebRTCDataChannel */
godot::Error _poll() override;
@@ -94,12 +94,12 @@ public:
ChannelState _get_ready_state() const override;
godot::String _get_label() const override;
bool _is_ordered() const override;
int64_t _get_id() const override;
int64_t _get_max_packet_life_time() const override;
int64_t _get_max_retransmits() const override;
int32_t _get_id() const override;
int32_t _get_max_packet_life_time() const override;
int32_t _get_max_retransmits() const override;
godot::String _get_protocol() const override;
bool _is_negotiated() const override;
int64_t _get_buffered_amount() const override;
int32_t _get_buffered_amount() const override;
WebRTCLibDataChannel();
~WebRTCLibDataChannel();

View File

@@ -234,7 +234,11 @@ Error WebRTCLibPeerConnection::_set_local_description(const String &p_type, cons
return OK;
}
#ifdef GDNATIVE_WEBRTC
Error WebRTCLibPeerConnection::_add_ice_candidate(const String &sdpMidName, int64_t sdpMlineIndexName, const String &sdpName) try {
#else
Error WebRTCLibPeerConnection::_add_ice_candidate(const String &sdpMidName, int32_t sdpMlineIndexName, const String &sdpName) try {
#endif
ERR_FAIL_COND_V(!peer_connection, ERR_UNCONFIGURED);
rtc::Candidate candidate(sdpName.utf8().get_data(), sdpMidName.utf8().get_data());
peer_connection->addRemoteCandidate(candidate);

View File

@@ -83,7 +83,11 @@ public:
godot::Error _create_offer() override;
godot::Error _set_remote_description(const godot::String &type, const godot::String &sdp) override;
godot::Error _set_local_description(const godot::String &type, const godot::String &sdp) override;
#ifdef GDNATIVE_WEBRTC
godot::Error _add_ice_candidate(const godot::String &sdpMidName, int64_t sdpMlineIndexName, const godot::String &sdpName) override;
#else
godot::Error _add_ice_candidate(const godot::String &sdpMidName, int32_t sdpMlineIndexName, const godot::String &sdpName) override;
#endif
godot::Error _poll() override;
void _close() override;

View File

@@ -28,7 +28,7 @@
/* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */
/*************************************************************************/
#include <godot/gdnative_interface.h>
#include <gdextension_interface.h>
#include <godot_cpp/core/class_db.hpp>
#include <godot_cpp/core/defs.hpp>
@@ -66,7 +66,7 @@ void unregister_webrtc_extension_types(ModuleInitializationLevel p_level) {
}
extern "C" {
GDNativeBool GDN_EXPORT webrtc_extension_init(const GDNativeInterface *p_interface, const GDNativeExtensionClassLibraryPtr p_library, GDNativeInitialization *r_initialization) {
GDExtensionBool GDE_EXPORT webrtc_extension_init(const GDExtensionInterface *p_interface, const GDExtensionClassLibraryPtr p_library, GDExtensionInitialization *r_initialization) {
GDExtensionBinding::InitObject init_obj(p_interface, p_library, r_initialization);
init_obj.register_initializer(register_webrtc_extension_types);

View File

@@ -119,21 +119,21 @@ public:
virtual ChannelState _get_ready_state() const = 0;
virtual godot::String _get_label() const = 0;
virtual bool _is_ordered() const = 0;
virtual int64_t _get_id() const = 0;
virtual int64_t _get_max_packet_life_time() const = 0;
virtual int64_t _get_max_retransmits() const = 0;
virtual int32_t _get_id() const = 0;
virtual int32_t _get_max_packet_life_time() const = 0;
virtual int32_t _get_max_retransmits() const = 0;
virtual godot::String _get_protocol() const = 0;
virtual bool _is_negotiated() const = 0;
virtual int64_t _get_buffered_amount() const = 0;
virtual int32_t _get_buffered_amount() const = 0;
virtual godot::Error _poll() = 0;
virtual void _close() = 0;
/* PacketPeer */
virtual godot::Error _get_packet(const uint8_t **r_buffer, int32_t *r_len) = 0;
virtual godot::Error _put_packet(const uint8_t *p_buffer, int64_t p_len) = 0;
virtual int64_t _get_available_packet_count() const = 0;
virtual int64_t _get_max_packet_size() const = 0;
virtual godot::Error _put_packet(const uint8_t *p_buffer, int32_t p_len) = 0;
virtual int32_t _get_available_packet_count() const = 0;
virtual int32_t _get_max_packet_size() const = 0;
~WebRTCDataChannelNative();
};

82
thirdparty/README.md vendored Normal file
View File

@@ -0,0 +1,82 @@
# Third party libraries
Please keep categories (`##` level) listed alphabetically and matching their
respective folder names. Use two empty lines to separate categories for
readability.
## json
- Upstream: https://github.com/nlohmann/json
- Version: 3.10.5 (4f8fba14066156b73f1189a2b8bd568bde5284c5, 2022)
- License: MIT
Module location:
- thirdparty/libdatachannel/deps/json
## libdatachannel
- Upstream: https://github.com/paullouisageneau/libdatachannel
- Version: 0.18.4 (4dd6c2117684c3d7d13c0d02b5aee8d4c2b661b0, 2023)
- License: MPL 2.0
Module location:
- thirdparty/libdatachannel
# libjuice
- Upstream: https://github.com/paullouisageneau/libjuice
- Version: 1.2.3 (8c23cc88c6d41e5ccbc44ea0ad3d79b22cf02361, 2023)
- License: MPL 2.0
Module location:
- thirdparty/libdatachannel/deps/libjuice
## libsrtp
- Upstream: https://github.com/cisco/libsrtp
- Version: 2.5.0 (a566a9cfcd619e8327784aa7cff4a1276dc1e895, 2023)
- License: BSD-3-Clause
Module location:
- thirdparty/libdatachannel/deps/libsrtp
## openssl
- Upstream: git://git.openssl.org/openssl.git
- Version: 3.0.8 (31157bc0b46e04227b8468d3e6915e4d0332777c, 2023)
- License: Apache 2.0
Module location:
- thirdparty/openssl
## plog
- Upstream: https://github.com/SergiusTheBest/plog
- Version: git (d8461e9d473e59fbcc1f79eee021550dcf81e618, 2021)
- License: MPL 2.0
Module location:
- thirdparty/libdatachannel/deps/plog
## usrsctp
- Upstream: https://github.com/sctplab/usrsctp
- Version: git (7c31bd35c79ba67084ce029511193a19ceb97447, 2021)
- License: BSD-3-Clause
Module location:
- thirdparty/libdatachannel/deps/usrsctp

1
thirdparty/libdatachannel vendored Submodule

1
thirdparty/openssl vendored Submodule

Submodule thirdparty/openssl added at 31157bc0b4

27
tools/cmake.py Normal file
View File

@@ -0,0 +1,27 @@
def exists(env):
return True
def generate(env):
env.AddMethod(cmake_configure, "CMakeConfigure")
env.AddMethod(cmake_build, "CMakeBuild")
def cmake_configure(env, source, target, opt_args):
args = [
"-B",
target,
]
if env["platform"] == "windows" and env["use_mingw"]:
args.extend(["-G", "Unix Makefiles"])
for arg in opt_args:
args.append(arg)
args.append(source)
return env.Execute("cmake " + " ".join(['"%s"' % a for a in args]))
def cmake_build(env, source, target=""):
jobs = env.GetOption("num_jobs")
env = env.Clone()
return env.Execute("cmake --build %s %s -j%s" % (source, "-t %s" % target if target else "", jobs))

8
tools/common.py Normal file
View File

@@ -0,0 +1,8 @@
def exists(env):
return True
def generate(env):
env["DEPS_SOURCE"] = env.Dir("#thirdparty").abspath
env["DEPS_BUILD"] = env.Dir("#bin/thirdparty").abspath + "/{}.{}.dir".format(env["suffix"][1:], "RelWithDebInfo" if env["debug_symbols"] else "Release")

96
tools/rtc.py Normal file
View File

@@ -0,0 +1,96 @@
import os
def rtc_cmake_config(env):
config = {
"USE_NICE": 0,
"NO_WEBSOCKET": 1,
"NO_EXAMPLES": 1,
"NO_TESTS": 1,
"OPENSSL_USE_STATIC_LIBS": 1,
"OPENSSL_INCLUDE_DIR": env["SSL_INCLUDE"],
"OPENSSL_SSL_LIBRARY": env["SSL_LIBRARY"],
"OPENSSL_CRYPTO_LIBRARY": env["SSL_CRYPTO_LIBRARY"],
"OPENSSL_ROOT_DIR": env["SSL_BUILD"],
"CMAKE_BUILD_TYPE": "%s" % ("RelWithDebInfo" if env["debug_symbols"] else "Release"),
}
if "CC" in env:
config["CMAKE_C_COMPILER"] = env["CC"]
if "CXX" in env:
config["CMAKE_CXX_COMPILER"] = env["CXX"]
if env["platform"] == "android":
api = env["android_api_level"] if int(env["android_api_level"]) > 28 else "28"
abi = {
"arm64": "arm64-v8a",
"arm32": "armeabi-v7a",
"x86_32": "x86",
"x86_64": "x86_64",
}[env["arch"]]
config["CMAKE_SYSTEM_NAME"] = "Android"
config["CMAKE_SYSTEM_VERSION"] = api
config["CMAKE_ANDROID_ARCH_ABI"] = abi
config["ANDROID_ABI"] = abi
config["CMAKE_TOOLCHAIN_FILE"] = "%s/build/cmake/android.toolchain.cmake" % os.environ.get("ANDROID_NDK_ROOT", "")
config["CMAKE_ANDROID_STL_TYPE"] = "c++_static"
elif env["platform"] == "linux":
march = "-m32" if env["arch"] == "x86_32" else "-m64"
config["CMAKE_C_FLAGS"] = march
config["CMAKE_CXX_FLAGS"] = march
elif env["platform"] == "macos":
if env["arch"] == "universal":
raise ValueError("OSX architecture not supported: %s" % env["arch"])
config["CMAKE_OSX_ARCHITECTURES"] = env["arch"]
if env["macos_deployment_target"] != "default":
config["CMAKE_OSX_DEPLOYMENT_TARGET"] = env["macos_deployment_target"]
elif env["platform"] == "ios":
if env["arch"] == "universal":
raise ValueError("iOS architecture not supported: %s" % env["arch"])
config["CMAKE_SYSTEM_NAME"] = "iOS"
config["CMAKE_OSX_DEPLOYMENT_TARGET"] = "11.0"
config["CMAKE_OSX_ARCHITECTURES"] = env["arch"]
if env["ios_simulator"]:
config["CMAKE_OSX_SYSROOT"] = "iphonesimulator"
elif env["platform"] == "windows":
config["CMAKE_SYSTEM_NAME"] = "Windows"
config["BUILD_WITH_WARNINGS"] = "0" # Disables werror in libsrtp.
return config
def rtc_emitter(target, source, env):
env.Depends(env["RTC_LIBS"], env["SSL_LIBS"])
env.Depends(env["RTC_LIBS"], [env.File(__file__), env.Dir(env["RTC_SOURCE"]), env.File(env["RTC_SOURCE"] + "/CMakeLists.txt")])
return env["RTC_LIBS"], env.Dir(env["RTC_SOURCE"])
def rtc_action(target, source, env):
rtc_env = env.Clone()
build_dir = env["RTC_BUILD"]
source_dir = env["RTC_SOURCE"]
opts = rtc_cmake_config(rtc_env)
rtc_env.CMakeConfigure(source_dir, build_dir, ["-D%s=%s" % it for it in opts.items()])
rtc_env.CMakeBuild(build_dir, "datachannel-static")
return None
def exists(env):
return "CMakeConfigure" in env and "CMakeBuild" in env
def generate(env):
env["RTC_SOURCE"] = env["DEPS_SOURCE"] + "/libdatachannel"
env["RTC_BUILD"] = env["DEPS_BUILD"] + "/libdatachannel"
env["RTC_INCLUDE"] = env["RTC_SOURCE"] + "/include"
env["RTC_LIBS"] = [env.File(env["RTC_BUILD"] + "/" + lib) for lib in [
"libdatachannel-static.a",
"deps/libjuice/libjuice-static.a",
"deps/libsrtp/libsrtp2.a",
"deps/usrsctp/usrsctplib/libusrsctp.a"
]]
env.Append(BUILDERS={
"BuildLibDataChannel": env.Builder(action=rtc_action, emitter=rtc_emitter)
})
env.Append(LIBPATH=[env["RTC_BUILD"]])
env.Append(CPPPATH=[env["RTC_INCLUDE"]])
env.Prepend(LIBS=env["RTC_LIBS"])
if env["platform"] == "windows":
env.AppendUnique(LIBS=["iphlpapi", "bcrypt"])

115
tools/ssl.py Normal file
View File

@@ -0,0 +1,115 @@
import os
from SCons.Defaults import Mkdir
def ssl_emitter(target, source, env):
env.Depends(env["SSL_LIBS"], env.File(__file__))
return env["SSL_LIBS"], [env.Dir(env["SSL_SOURCE"]), env.File(env["SSL_SOURCE"] + "/VERSION.dat")]
def ssl_action(target, source, env):
build_dir = env["SSL_BUILD"]
source_dir = env["SSL_SOURCE"]
install_dir = env["SSL_INSTALL"]
ssl_env = env.Clone()
args = [
"no-ssl2",
"no-ssl3",
"no-weak-ssl-ciphers",
"no-legacy",
"no-shared",
"no-tests",
"--prefix=%s" % install_dir,
"--openssldir=%s" % install_dir,
]
if env["debug_symbols"]:
args.append("-d")
if env["platform"] == "linux":
if env["arch"] == "x86_32":
args.extend(["linux-x86"])
else:
args.extend(["linux-x86_64"])
elif env["platform"] == "android":
api = env["android_api_level"] if int(env["android_api_level"]) > 28 else "28"
args.extend([
{
"arm64": "android-arm64",
"arm32": "android-arm",
"x86_32": "android-x86",
"x86_64": "android-x86_64",
}[env["arch"]],
"-D__ANDROID_API__=%s" % api,
])
# Setup toolchain path.
ssl_env.PrependENVPath("PATH", os.path.dirname(env["CC"]))
ssl_env["ENV"]["ANDROID_NDK_ROOT"] = os.environ.get("ANDROID_NDK_ROOT", "")
elif env["platform"] == "macos":
if env["arch"] == "x86_64":
args.extend(["darwin64-x86_64"])
elif env["arch"] == "arm64":
args.extend(["darwin64-arm64"])
else:
raise ValueError("macOS architecture not supported: %s" % env["arch"])
elif env["platform"] == "ios":
if env["ios_simulator"]:
args.extend(["iossimulator-xcrun"])
elif env["arch"] == "arm32":
args.extend(["ios-xcrun"])
elif env["arch"] == "arm64":
args.extend(["ios64-xcrun"])
else:
raise ValueError("iOS architecture not supported: %s" % env["arch"])
elif env["platform"] == "windows":
if env["arch"] == "x86_32":
if env["use_mingw"]:
args.extend([
"mingw",
"--cross-compile-prefix=i686-w64-mingw32-",
])
else:
args.extend(["VC-WIN32"])
else:
if env["use_mingw"]:
args.extend([
"mingw64",
"--cross-compile-prefix=x86_64-w64-mingw32-",
])
else:
args.extend(["VC-WIN64A"])
jobs = env.GetOption("num_jobs")
ssl_env.Execute([
Mkdir(build_dir),
"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 install_sw install_ssldirs -j%s" % (build_dir, jobs),
]
)
return None
def exists(env):
return True
def generate(env):
env["SSL_SOURCE"] = env["DEPS_SOURCE"] + "/openssl"
env["SSL_BUILD"] = env["DEPS_BUILD"] + "/openssl"
env["SSL_INSTALL"] = env["SSL_BUILD"] + "/dest"
env["SSL_INCLUDE"] = env["SSL_INSTALL"] + "/include"
env["SSL_LIBRARY"] = env.File(env["SSL_BUILD"] + "/libssl.a")
env["SSL_CRYPTO_LIBRARY"] = env.File(env["SSL_BUILD"] + "/libcrypto.a")
env["SSL_LIBS"] = [env["SSL_LIBRARY"], env["SSL_CRYPTO_LIBRARY"]]
env.Append(BUILDERS={
"BuildOpenSSL": env.Builder(action=ssl_action, emitter=ssl_emitter)
})
env.Prepend(CPPPATH=[env["SSL_INCLUDE"]])
env.Prepend(LIBPATH=[env["SSL_BUILD"]])
env.Append(LIBS=env["SSL_LIBS"])
if env["platform"] == "windows":
env.AppendUnique(LIBS=["ws2_32", "gdi32", "advapi32", "crypt32", "user32"])