summaryrefslogtreecommitdiff
path: root/tools/openssl.py
diff options
context:
space:
mode:
authorFabio Alessandrelli <fabio.alessandrelli@gmail.com>2023-06-20 17:30:14 +0200
committerFabio Alessandrelli <fabio.alessandrelli@gmail.com>2023-06-20 17:45:23 +0200
commit54c8586235f497cb080fcc6c2fae169460769aad (patch)
tree4fea8b1675014c255b0f5b13fb971c2fd4c54eb4 /tools/openssl.py
parentf19011f2fb794ab831b9cd53376fc52e8a5057db (diff)
downloadfork-godot-webrtc-native-54c8586235f497cb080fcc6c2fae169460769aad.tar.gz
fork-godot-webrtc-native-54c8586235f497cb080fcc6c2fae169460769aad.tar.bz2
fork-godot-webrtc-native-54c8586235f497cb080fcc6c2fae169460769aad.zip
[SCons] Fix regression causing unnecessary rebuilds.
The num_jobs (-j flag) was being tracked as part of the cmake and openssl build actions, thus causing a rebuild when compiling with different concurrently. This commit strip the -j flag from the signature of the actions so scons won't rebuild openssl/libdatachannel when changing the parallelism option.
Diffstat (limited to 'tools/openssl.py')
-rw-r--r--tools/openssl.py21
1 files changed, 12 insertions, 9 deletions
diff --git a/tools/openssl.py b/tools/openssl.py
index 936895d..8af782a 100644
--- a/tools/openssl.py
+++ b/tools/openssl.py
@@ -144,6 +144,17 @@ def build_openssl(env, jobs=None):
return ssl
+def ssl_generator(target, source, env, for_signature):
+ # Strip the -j option for signature to avoid rebuilding when num_jobs changes.
+ build = env["SSLBUILDCOM"].replace("-j$SSLBUILDJOBS", "") if for_signature else env["SSLBUILDCOM"]
+ return [
+ Mkdir("$SSL_BUILD"),
+ Mkdir("$SSL_INSTALL"),
+ SCons.Action.Action("$SSLCONFIGCOM", "$SSLCONFIGCOMSTR"),
+ SCons.Action.Action(build, "$SSLBUILDCOMSTR"),
+ ]
+
+
def options(opts):
opts.Add(PathVariable("openssl_source", "Path to the openssl sources.", "thirdparty/openssl"))
opts.Add("openssl_build", "Destination path of the openssl build.", "bin/thirdparty/openssl")
@@ -194,13 +205,5 @@ def generate(env):
if env["platform"] == "windows" and env.get("is_msvc", False):
env["SSLBUILDCOM"] = "cd ${TARGET.dir} && nmake install_sw install_ssldirs"
- env["BUILDERS"]["OpenSSLBuilder"] = SCons.Builder.Builder(
- action=[
- Mkdir("$SSL_BUILD"),
- Mkdir("$SSL_INSTALL"),
- SCons.Action.Action("$SSLCONFIGCOM", "$SSLCONFIGCOMSTR"),
- SCons.Action.Action("$SSLBUILDCOM", "$SSLBUILDCOMSTR"),
- ],
- emitter=ssl_emitter,
- )
+ env["BUILDERS"]["OpenSSLBuilder"] = SCons.Builder.Builder(generator=ssl_generator, emitter=ssl_emitter)
env.AddMethod(build_openssl, "OpenSSL")