Compare commits
4 Commits
75c626c235
...
7fc8518db4
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
7fc8518db4 | ||
|
|
8b5d66dbec | ||
|
|
6326454729 | ||
|
|
18293fdcf7 |
18
SConscript
18
SConscript
@ -535,8 +535,6 @@ def _version_to_string(version) -> str:
|
|||||||
return '.'.join([str(v) for v in version])
|
return '.'.join([str(v) for v in version])
|
||||||
|
|
||||||
def _finalize(env: Environment):
|
def _finalize(env: Environment):
|
||||||
if dump is not None:
|
|
||||||
_dump()
|
|
||||||
if generate_project:
|
if generate_project:
|
||||||
_generate_project(generate_project)
|
_generate_project(generate_project)
|
||||||
Exit(0)
|
Exit(0)
|
||||||
@ -559,6 +557,8 @@ def _finalize(env: Environment):
|
|||||||
}
|
}
|
||||||
}, f)
|
}, f)
|
||||||
|
|
||||||
|
if dump is not None:
|
||||||
|
_dump()
|
||||||
|
|
||||||
for target in env['SPP_TARGETS']:
|
for target in env['SPP_TARGETS']:
|
||||||
_build_target(target)
|
_build_target(target)
|
||||||
@ -744,8 +744,14 @@ def _generate_project(project_type: str) -> None:
|
|||||||
|
|
||||||
def _get_target_property(build_type: str, target: str, path: str) -> Any:
|
def _get_target_property(build_type: str, target: str, path: str) -> Any:
|
||||||
import subprocess
|
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()
|
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)
|
return json.loads(output)
|
||||||
|
except json.JSONDecodeError as e:
|
||||||
|
env.Warn(f'Command: {cmd}')
|
||||||
|
env.Warn(f'Output: {output}')
|
||||||
|
raise e
|
||||||
|
|
||||||
|
|
||||||
executables = _get_executables()
|
executables = _get_executables()
|
||||||
@ -901,7 +907,10 @@ def _dump() -> None:
|
|||||||
'args': target.args,
|
'args': target.args,
|
||||||
# 'kwargs': kwargs, <- circular dependency here and the json encoder doesn't like that
|
# 'kwargs': kwargs, <- circular dependency here and the json encoder doesn't like that
|
||||||
'CPPDEFINES': kwargs.get('CPPDEFINES', env['CPPDEFINES']),
|
'CPPDEFINES': kwargs.get('CPPDEFINES', env['CPPDEFINES']),
|
||||||
'CPPPATH': kwargs.get('CPPPATH', env['CPPPATH'])
|
'CPPPATH': kwargs.get('CPPPATH', env['CPPPATH']),
|
||||||
|
'CFLAGS': kwargs.get('CFLAGS', env['CFLAGS']),
|
||||||
|
'CCFLAGS': kwargs.get('CCFLAGS', env['CCFLAGS']),
|
||||||
|
'CXXFLAGS': kwargs.get('CXXFLAGS', env['CXXFLAGS'])
|
||||||
}
|
}
|
||||||
return result
|
return result
|
||||||
|
|
||||||
@ -1148,6 +1157,7 @@ env.Append(CXXFLAGS = [])
|
|||||||
env.Append(CPPPATH = [])
|
env.Append(CPPPATH = [])
|
||||||
env.Append(CPPDEFINES = [])
|
env.Append(CPPDEFINES = [])
|
||||||
env.Append(LINKFLAGS = [])
|
env.Append(LINKFLAGS = [])
|
||||||
|
env.Append(LIBS = [])
|
||||||
|
|
||||||
# init SPP environment variables
|
# init SPP environment variables
|
||||||
env['SPP_DIR'] = _spp_dir.abspath
|
env['SPP_DIR'] = _spp_dir.abspath
|
||||||
|
|||||||
@ -1,9 +1,9 @@
|
|||||||
{%- set ms_cxx_standard = {
|
{%- set ms_cxx_standard = {
|
||||||
'c++14': 'stdcpp14',
|
'c++14': 'c++14',
|
||||||
'c++17': 'stdcpp17',
|
'c++17': 'c++17',
|
||||||
'c++20': 'stdcpp20',
|
'c++20': 'c++20',
|
||||||
'c++23': 'stdcpplatest',
|
'c++23': 'c++latest',
|
||||||
'c++26': 'stdcpplatest'}[project.cxx_standard] | default('stdcpp14')
|
'c++26': 'c++latest'}[project.cxx_standard] | default('c++14')
|
||||||
-%}
|
-%}
|
||||||
<?xml version="1.0" encoding="utf-8"?>
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
<Project DefaultTargets="Build" ToolsVersion="17.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
<Project DefaultTargets="Build" ToolsVersion="17.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||||
@ -59,7 +59,7 @@
|
|||||||
<GenerateDebugInformation>{{ build_type != 'release' and 'true' or 'false' }}</GenerateDebugInformation>
|
<GenerateDebugInformation>{{ build_type != 'release' and 'true' or 'false' }}</GenerateDebugInformation>
|
||||||
<AdditionalIncludeDirectories>{{ get_target_property(build_type, target.name, 'CPPPATH') | join(';') }};%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
<AdditionalIncludeDirectories>{{ get_target_property(build_type, target.name, 'CPPPATH') | join(';') }};%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||||
<MsExtensions>false</MsExtensions>
|
<MsExtensions>false</MsExtensions>
|
||||||
<CppLanguageStd>{{ ms_cxx_standard }}</CppLanguageStd>
|
<AdditionalOptions>{{ get_target_property(build_type, target.name, 'CCFLAGS') | join(' ') }}</AdditionalOptions> {# + get_target_property(build_type, target.name, 'CXXFLAGS')) #}
|
||||||
</ClCompile>
|
</ClCompile>
|
||||||
</ItemDefinitionGroup>
|
</ItemDefinitionGroup>
|
||||||
{%- endfor %}
|
{%- endfor %}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user