From 18293fdcf7a8f152a35197a9dc3b3b373ca85b64 Mon Sep 17 00:00:00 2001
From: Patrick Wuttke
Date: Tue, 8 Jul 2025 16:50:06 +0200
Subject: [PATCH] Fixed target info dumping.
---
SConscript | 15 +++++++++++----
1 file changed, 11 insertions(+), 4 deletions(-)
diff --git a/SConscript b/SConscript
index c309e1c..b729ae6 100644
--- a/SConscript
+++ b/SConscript
@@ -522,8 +522,6 @@ def _version_to_string(version) -> str:
return '.'.join([str(v) for v in version])
def _finalize(env: Environment):
- if dump is not None:
- _dump()
if generate_project:
_generate_project(generate_project)
Exit(0)
@@ -546,6 +544,8 @@ def _finalize(env: Environment):
}
}, f)
+ if dump is not None:
+ _dump()
for target in env['SPP_TARGETS']:
_build_target(target)
@@ -731,8 +731,14 @@ def _generate_project(project_type: str) -> None:
def _get_target_property(build_type: str, target: str, path: str) -> Any:
import subprocess
- output = subprocess.check_output((shutil.which('scons'), '--silent', f'--build_type={build_type}', '--dump=targets', '--dump_format=json', f'--dump_path={target}/{path}'), text=True).strip()
- return json.loads(output)
+ cmd = (shutil.which('scons'), '--silent', f'--build_type={build_type}', '--dump=targets', '--dump_format=json', f'--dump_path={target}/{path}')
+ output = subprocess.check_output(cmd, text=True).strip()
+ try:
+ return json.loads(output)
+ except json.JSONDecodeError as e:
+ env.Warn(f'Command: {cmd}')
+ env.Warn(f'Output: {output}')
+ raise e
executables = _get_executables()
@@ -1135,6 +1141,7 @@ env.Append(CXXFLAGS = [])
env.Append(CPPPATH = [])
env.Append(CPPDEFINES = [])
env.Append(LINKFLAGS = [])
+env.Append(LIBS = [])
# init SPP environment variables
env['SPP_DIR'] = _spp_dir.abspath