1
0
mirror of https://github.com/trezor/trezor-firmware.git synced 2024-12-23 14:58:09 +00:00
trezor-firmware/core/site_scons/models
matejcik b35854471b build(core): improve CPPDEFINES quoting
Here we change all FOO=VALUE defines to be tuples ("FOO", "VALUE").
Also, VALUE is always the raw string you want to end up in the C file,
instead of attempting to shell-escape it while specifying.

By all rights scons _should_ be using shlex.quote() on the CPPDEFINES,
but it doesn't, so we hack it by specifying the define prefix as `-D'`
and suffix as `'`. That way the arguments in shell are '-escaped, and
we're (currently) not using ' in any argument value so this should work
fine.

At the same time, when passing the flags to cargo, we can shlex.quote
the whole thing and get the right strings passed all the way into
build.rs -- as long as no argument contains a comma, which is the split
character...
2024-11-21 14:33:52 +01:00
..
D001 build(core): improve CPPDEFINES quoting 2024-11-21 14:33:52 +01:00
D002 build(core): improve CPPDEFINES quoting 2024-11-21 14:33:52 +01:00
T2B1 build(core): improve CPPDEFINES quoting 2024-11-21 14:33:52 +01:00
T2T1 build(core): improve CPPDEFINES quoting 2024-11-21 14:33:52 +01:00
T3B1 build(core): improve CPPDEFINES quoting 2024-11-21 14:33:52 +01:00
T3T1 build(core): improve CPPDEFINES quoting 2024-11-21 14:33:52 +01:00
T3W1 build(core): improve CPPDEFINES quoting 2024-11-21 14:33:52 +01:00
__init__.py refactor(core): ui configuration in build scripts 2024-09-27 22:02:08 +02:00
stm32f4_common.py build(core): improve CPPDEFINES quoting 2024-11-21 14:33:52 +01:00
stm32u5_common.py build(core): improve CPPDEFINES quoting 2024-11-21 14:33:52 +01:00