From 28b30128deec29287c428a351a01389c5da9665e Mon Sep 17 00:00:00 2001 From: M1nd3r Date: Thu, 14 Nov 2024 10:46:47 +0100 Subject: [PATCH] chore(core): adjust build scripts for THP [no changelog] --- core/Makefile | 2 +- core/SConscript.firmware | 14 +++++++------- core/SConscript.unix | 5 +++-- 3 files changed, 11 insertions(+), 10 deletions(-) diff --git a/core/Makefile b/core/Makefile index ca474e5467..6653740355 100644 --- a/core/Makefile +++ b/core/Makefile @@ -304,7 +304,7 @@ build_unix: templates ## build unix port build_unix_frozen: templates build_cross ## build unix port with frozen modules $(SCONS) CFLAGS="$(CFLAGS)" $(UNIX_BUILD_DIR)/trezor-emu-core $(UNIX_PORT_OPTS) \ - TREZOR_MODEL="$(TREZOR_MODEL)" CMAKELISTS="$(CMAKELISTS)" \ + TREZOR_MODEL="$(TREZOR_MODEL)" CMAKELISTS="$(CMAKELISTS)" THP="$(THP)"\ PYOPT="$(PYOPT)" BITCOIN_ONLY="$(BITCOIN_ONLY)" TREZOR_EMULATOR_ASAN="$(ADDRESS_SANITIZER)" \ TREZOR_MEMPERF="$(TREZOR_MEMPERF)" TREZOR_EMULATOR_FROZEN=1 \ BENCHMARK="$(BENCHMARK)" diff --git a/core/SConscript.firmware b/core/SConscript.firmware index ad2a3b6ef3..41187ba53f 100644 --- a/core/SConscript.firmware +++ b/core/SConscript.firmware @@ -25,7 +25,7 @@ if BENCHMARK and PYOPT != '0': FEATURE_FLAGS = { "RDI": True, "SECP256K1_ZKP": True, # required for trezor.crypto.curve.bip340 (BIP340/Taproot) - "AES_GCM": BENCHMARK, + "AES_GCM": BENCHMARK or THP, } FEATURES_WANTED = ["input", "sbu", "sd_card", "rgb_led", "dma2d", "consumption_mask", "usb" ,"optiga", "haptic"] @@ -606,6 +606,12 @@ if FROZEN: ]) ) + if BENCHMARK: + SOURCE_PY.extend(Glob(SOURCE_PY_DIR + 'apps/benchmark/*.py')) + + if THP: + SOURCE_PY.extend(Glob(SOURCE_PY_DIR + 'apps/thp/*.py')) + if EVERYTHING: SOURCE_PY.extend(Glob(SOURCE_PY_DIR + 'apps/binance/*.py')) SOURCE_PY.extend(Glob(SOURCE_PY_DIR + 'trezor/enums/Binance*.py')) @@ -647,9 +653,6 @@ if FROZEN: SOURCE_PY.extend(Glob(SOURCE_PY_DIR + 'apps/tezos/*.py')) SOURCE_PY.extend(Glob(SOURCE_PY_DIR + 'trezor/enums/Tezos*.py')) - if THP: - SOURCE_PY.extend(Glob(SOURCE_PY_DIR + 'apps/thp/*.py')) - SOURCE_PY.extend(Glob(SOURCE_PY_DIR + 'apps/zcash/*.py')) SOURCE_PY.extend(Glob(SOURCE_PY_DIR + 'apps/webauthn/*.py')) @@ -660,9 +663,6 @@ if FROZEN: SOURCE_PY.extend(Glob(SOURCE_PY_DIR + 'apps/bitcoin/sign_tx/zcash_v4.py')) SOURCE_PY.extend(Glob(SOURCE_PY_DIR + 'trezor/enums/Zcash*.py')) - if BENCHMARK: - SOURCE_PY.extend(Glob(SOURCE_PY_DIR + 'apps/benchmark/*.py')) - source_mpy = env.FrozenModule( source=SOURCE_PY, source_dir=SOURCE_PY_DIR, diff --git a/core/SConscript.unix b/core/SConscript.unix index 46e89be20c..fed7afd3ec 100644 --- a/core/SConscript.unix +++ b/core/SConscript.unix @@ -666,6 +666,9 @@ if FROZEN: if BENCHMARK: SOURCE_PY.extend(Glob(SOURCE_PY_DIR + 'apps/benchmark/*.py')) + if THP: + SOURCE_PY.extend(Glob(SOURCE_PY_DIR + 'apps/thp/*.py')) + if EVERYTHING: SOURCE_PY.extend(Glob(SOURCE_PY_DIR + 'apps/binance/*.py')) SOURCE_PY.extend(Glob(SOURCE_PY_DIR + 'trezor/enums/Binance*.py')) @@ -707,8 +710,6 @@ if FROZEN: SOURCE_PY.extend(Glob(SOURCE_PY_DIR + 'apps/tezos/*.py')) SOURCE_PY.extend(Glob(SOURCE_PY_DIR + 'trezor/enums/Tezos*.py')) - if THP: - SOURCE_PY.extend(Glob(SOURCE_PY_DIR + 'apps/thp/*.py')) SOURCE_PY.extend(Glob(SOURCE_PY_DIR + 'apps/zcash/*.py'))