Fixed target info dumping.

This commit is contained in:
Patrick Wuttke 2025-07-08 16:50:06 +02:00
parent 8371f96d4a
commit 18293fdcf7

View File

@ -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