diff options
author | RĂ©mi Verschelde <rverschelde@gmail.com> | 2019-08-21 18:03:03 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-08-21 18:03:03 +0200 |
commit | 99980d856bf2581ff7b86e50067a0f8814442834 (patch) | |
tree | 6c4a5fa5e52f7d8bd2d2a9101bb01a653c34bafc /core/crypto/SCsub | |
parent | 14c2f2fe28e6c639f4e3b15471c0f3f3e42890de (diff) | |
parent | fc411115f5ddb214c19b23499400f10266095e5f (diff) |
Merge pull request #29871 from Faless/crypto/initial_pr
More Crypto, SSL server, crt/key as Resource, HashingContext
Diffstat (limited to 'core/crypto/SCsub')
-rw-r--r-- | core/crypto/SCsub | 38 |
1 files changed, 38 insertions, 0 deletions
diff --git a/core/crypto/SCsub b/core/crypto/SCsub new file mode 100644 index 0000000000..0a3f05d87a --- /dev/null +++ b/core/crypto/SCsub @@ -0,0 +1,38 @@ +#!/usr/bin/env python + +Import('env') + +env_crypto = env.Clone() + +is_builtin = env["builtin_mbedtls"] +has_module = env["module_mbedtls_enabled"] + +if is_builtin or not has_module: + # Use our headers for builtin or if the module is not going to be compiled. + # We decided not to depend on system mbedtls just for these few files that can + # be easily extracted. + env_crypto.Prepend(CPPPATH=["#thirdparty/mbedtls/include"]) + +# MbedTLS core functions (for CryptoCore). +# If the mbedtls module is compiled we don't need to add the .c files with our +# custom config since they will be built by the module itself. +# Only if the module is not enabled, we must compile here the required sources +# to make a "light" build with only the necessary mbedtls files. +if not has_module: + env_thirdparty = env_crypto.Clone() + env_thirdparty.disable_warnings() + # Custom config file + env_thirdparty.Append(CPPDEFINES=[('MBEDTLS_CONFIG_FILE', '\\"thirdparty/mbedtls/include/godot_core_mbedtls_config.h\\"')]) + thirdparty_mbedtls_dir = "#thirdparty/mbedtls/library/" + thirdparty_mbedtls_sources = [ + "aes.c", + "base64.c", + "md5.c", + "sha1.c", + "sha256.c", + "godot_core_mbedtls_platform.c" + ] + thirdparty_mbedtls_sources = [thirdparty_mbedtls_dir + file for file in thirdparty_mbedtls_sources] + env_thirdparty.add_source_files(env.core_sources, thirdparty_mbedtls_sources) + +env_crypto.add_source_files(env.core_sources, "*.cpp") |