File: SCsub

package info (click to toggle)
godot 3.2.3-stable-1
  • links: PTS, VCS
  • area: main
  • in suites: bookworm, bullseye
  • size: 121,308 kB
  • sloc: cpp: 804,285; ansic: 597,434; xml: 77,823; asm: 17,127; cs: 13,535; lisp: 12,017; python: 9,376; java: 7,474; sh: 973; javascript: 659; perl: 264; pascal: 203; objc: 116; makefile: 105
file content (40 lines) | stat: -rw-r--r-- 1,501 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
#!/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")