mirror of
https://github.com/trezor/trezor-firmware.git
synced 2024-12-18 12:28:09 +00:00
build(core): improve path resolution in scons tools
[no changelog]
This commit is contained in:
parent
9d8cfbf680
commit
e5ed9d3df4
@ -1,8 +1,12 @@
|
|||||||
import os.path
|
from pathlib import Path
|
||||||
|
|
||||||
import subprocess
|
import subprocess
|
||||||
from boards import trezor_1, trezor_r_v3, trezor_r_v4, trezor_t
|
from boards import trezor_1, trezor_r_v3, trezor_r_v4, trezor_t
|
||||||
|
|
||||||
|
HERE = Path(__file__).parent.resolve()
|
||||||
|
|
||||||
|
# go up from site_scons to core/
|
||||||
|
PROJECT_ROOT = HERE.parent.resolve()
|
||||||
|
|
||||||
|
|
||||||
def add_font(font_name, font, defines, sources):
|
def add_font(font_name, font, defines, sources):
|
||||||
@ -48,9 +52,7 @@ def get_version(file):
|
|||||||
minor = 0
|
minor = 0
|
||||||
patch = 0
|
patch = 0
|
||||||
|
|
||||||
if not os.path.exists(file):
|
file = PROJECT_ROOT / file
|
||||||
file = os.path.join("..", "..", file)
|
|
||||||
|
|
||||||
with open(file, 'r') as f:
|
with open(file, 'r') as f:
|
||||||
for line in f:
|
for line in f:
|
||||||
if line.startswith('#define VERSION_MAJOR '):
|
if line.startswith('#define VERSION_MAJOR '):
|
||||||
|
Loading…
Reference in New Issue
Block a user