Compare commits

...

85 Commits

Author SHA1 Message Date
e583c5ef6c Added module type and module configuration. 2025-06-19 16:43:53 +02:00
c3b5244eac Replaced --dump_env with --dump and --dump_format that allow dumping environment and config, both as text or json. And added _info() and env.Info() function for printing that reacts to SCons' -s flag. 2025-06-19 13:33:21 +02:00
88844ee5da Added small script for starting scons via IDE for debugging. 2025-06-19 13:32:18 +02:00
161f2e52d8 Give dependencies the option to add to CMAKE_PREFIX_PATH for compiling CMake dependencies against each other. 2025-04-03 16:29:36 +02:00
9436d2c48d Added JINJA_FILE_SEARCHPATH for Jinja file functions to make it easier for library projects to find their files. 2025-03-28 14:52:14 +01:00
2769fd801f Added file_size and file_content_hex Jinja filters.
Added check if Jinja module exists and appropriate error message to
project generation.
2025-03-28 11:35:59 +01:00
Patrick Wuttke
5f11d64744 Fixed generation of VSCode launch.json. 2025-03-18 09:45:21 +01:00
1401fdea90 Next attempt of adding build type to executable and library names. 2025-03-14 22:02:40 +01:00
Patrick Wuttke
3a3c79d240 Revert "Updated to include build type and variant in binary names, so they don't need to be rebuilt everytime the configuration is changed."
Modifying the suffix variables broke the library file detection, at least on Windows.

This reverts commit e6e7dbe642.
2025-03-14 09:49:21 +01:00
e6e7dbe642 Updated to include build type and variant in binary names, so they don't need to be rebuilt everytime the configuration is changed. 2025-03-13 23:42:58 +01:00
1edf745b39 Clone recipe repositories into a separate subfolder. 2025-03-13 23:01:09 +01:00
9e5fc05f4f Introduced recipe repositories. 2025-03-13 22:58:49 +01:00
d03b7097f7 Fixed SQLite build on Linux. 2025-03-13 18:36:17 +01:00
ba5def01b0 Fixed imgui-node-editor build when using GCC. 2025-03-13 18:36:07 +01:00
Patrick Wuttke
4082f8cb22 Added build type to object suffix so switching between configs is a lot quicker. 2025-03-13 15:00:24 +01:00
Patrick Wuttke
0bec9f7062 Added project template for VSCode (only Windows for now). 2025-03-13 10:42:48 +01:00
283aa0f99c Added way for dependencies to use options and fixed compilation of ImGui with SDL3 backend. 2025-03-13 09:57:39 +01:00
71f8631e48 Added recipe for portable-file-dialogs. 2025-03-12 15:50:16 +01:00
ae739b9946 Fixed Release and Release_Debug build on windows. 2025-03-11 17:46:57 +01:00
2cc3145669 Added recipe for ImGui Node Editor. 2025-03-11 17:46:39 +01:00
5159c80167 Added recipe for SQLite on Windows (still WIP). 2025-03-11 09:35:38 +01:00
748f8f229f (WIP) SQLite recipe. 2025-03-10 09:55:34 +01:00
b034e87aaf Properly disable exceptions in MSVC. 2025-03-07 11:00:17 +01:00
726d206f9a Disabled tests for fmt. 2025-03-07 10:59:41 +01:00
5debc6d334 Added recipe for icon font cpp headers. 2025-03-07 10:48:56 +01:00
5c6a8a1cc6 Fixed issue with dependency injection not working due to the 'add target via name in dependencies' shortcut :/. 2025-03-02 22:20:21 +01:00
9d3d52ffaf Added recipe for RAID. 2025-03-02 22:19:22 +01:00
c994752c32 Added option for ImGui recipe to build from a docking build and to provide backends to compile via options. 2025-03-02 16:00:48 +01:00
42dada23c9 Added CXX_NO_EXCEPTIONS config to disable exceptions. 2025-03-02 16:00:12 +01:00
0e22057fc4 Added recipe for sdlpp. 2025-02-14 22:37:27 +01:00
c883f3c1c7 Added DXC recipe. 2025-01-19 01:17:35 +01:00
bca2398828 Added recipes for some Linux system libraries. 2025-01-12 13:11:43 +01:00
10a5239b7f Fixed default value for enable_asan. 2025-01-09 17:56:28 +01:00
0b8d115907 Added option for address sanitization on MSVC. 2024-12-26 14:48:18 +01:00
134fb106a8 Added cxxflags to cmake version hash calculation. 2024-12-13 23:39:27 +01:00
b546931c09 Added libraries to automatic CLion project generation. 2024-12-13 00:52:10 +01:00
7c4e403747 Fixed up Clang warnings. 2024-12-08 22:38:52 +01:00
c24c864915 Disabled Clang 'missing-field-initializers' warning. 2024-12-06 20:36:37 +01:00
fe95a92cf6 Added GCC build script. 2024-12-06 09:46:54 +01:00
1bdc1ef7a0 Used latest compiler version. 2024-12-05 17:03:44 +01:00
ff219840ea Added chmod to make scripts executable. 2024-12-05 16:59:17 +01:00
ee55878b18 Added build script stuff. 2024-12-05 16:31:59 +01:00
55893909f0 Added requests to requirements. 2024-11-21 00:08:30 +01:00
349a08b084 Added force parameter when fixing git tags so stuff compiles even if tags are updated. Also added the (yet missing) nghttp2 lib as a dependency to CURL if a version >= 8.10.0 is compiled. 2024-11-20 20:23:14 +01:00
5490de84eb Fixed Lua compilation on Windows. 2024-11-14 10:02:14 +01:00
70fc36335a Added GSL recipe. 2024-11-09 21:36:32 +01:00
ca1466469f Fixed lua recipe. 2024-11-08 12:36:59 +01:00
42a433582c Added Lua recipe. 2024-11-05 10:08:42 +01:00
0dcd8b383c Added DX12 recipe. 2024-10-30 11:10:30 +01:00
946cfc57ce Fixed wrong project name used when generating CLion project. 2024-10-27 13:52:00 +01:00
28c1675b87 Fixed typo. 2024-10-25 09:46:09 +02:00
7345305a77 Fixed CURL and Boost compilation on Windows. 2024-10-25 09:42:03 +02:00
651c8770c3 Added recipe for json and updated yaml-cpp recipe. 2024-10-25 08:37:07 +02:00
071cd207a9 Removed some old code. 2024-10-23 23:55:59 +02:00
a479e90335 Fixed compilation with MSVC. 2024-10-23 23:48:46 +02:00
cdbec36b8f Added recipes for curl, libidn2, libpsl and libunistring. 2024-10-23 23:48:46 +02:00
f2dc9872f7 Automatically apply patch when compiling SDL3. 2024-10-13 13:36:01 +02:00
2b05834798 Allow specifying a library from the current project as a dependency. 2024-10-12 12:30:21 +02:00
e3b3fd8f7c Save and reuse UUIDs between project generations. 2024-10-11 16:57:31 +02:00
329278c5f5 Fixed generated CLion project for platforms that use PROGPREFIX or PROGSUFFIX (e.g. Windows). 2024-10-11 10:21:21 +02:00
a0bbb46e51 Cleaned up/updated CLion project generation code and templates. 2024-10-10 23:23:29 +02:00
c6bba0e440 Added generation of CLion projects. 2024-10-10 00:06:58 +02:00
0a29b41639 Fixed (hopefully) the depends functionality. 2024-09-20 00:14:17 +02:00
a7c736de56 Added recipe for rectpack2D. 2024-09-19 14:57:37 +02:00
b45fec7561 Added enable_hlsl option to glslang. 2024-09-16 09:50:38 +02:00
c74fbb8798 Added recipe for tinyobjloader. 2024-09-15 14:45:47 +02:00
fe8f329b38 Fixed library name for debug SDL3 on Windows. 2024-09-12 15:09:06 +02:00
ae870e798d Added SHOW_INCLUDES debug setting (only MSVC for now). 2024-09-12 15:09:06 +02:00
941f94a7b6 Adjusted SDL build script to work with SDL3 (kind of). 2024-09-11 09:00:26 +02:00
1b8d6e175b Added options to version specs and allow specifying a git ref to build instead of a version. 2024-09-11 09:00:03 +02:00
bdf063a16c Added openssl recipe. 2024-09-09 21:52:57 +02:00
6cd076394d Added recipe for winsock2 and target_os to dependency conditions. 2024-09-09 21:52:57 +02:00
0175b812a2 Fixed Catch2 recipe. 2024-09-09 21:52:57 +02:00
eb044b6d2f Fixed compilation with MSVC. 2024-09-09 21:52:56 +02:00
e6adeb3a20 Moved check of SYSTEM_CACHE_DIR accessibility to before it is used. 2024-09-09 21:52:13 +02:00
fa83ff4581 Adjusted error description to make more sense. 2024-09-09 21:51:45 +02:00
29791d2e9c Fixed zlib recipe on linux. 2024-09-09 21:51:45 +02:00
4e579121db Fixed compilation with MSVC. 2024-09-09 21:51:36 +02:00
cd727e5a1d Update to new recipe system (S++ 2.0). 2024-09-09 21:50:47 +02:00
6f83b68788 Some more work on the new dependency resolution system. 2024-09-09 21:50:47 +02:00
17ee9777ed Some tests. 2024-09-09 21:50:47 +02:00
ecb8ea9a74 Allow settings COMPILATIONDB_FILTER_FILES via config. 2024-08-18 11:15:32 +02:00
a3426f1132 Enable experimental library features (jthread) for clang. 2024-08-18 09:58:30 +02:00
e9438455ea Moved check of SYSTEM_CACHE_DIR accessibility to before it is used. 2024-08-18 09:51:04 +02:00
cc5fd2d668 Added CXXFLAGS and CFLAGS to config variables. 2024-08-18 09:47:24 +02:00
43 changed files with 1331 additions and 485 deletions

File diff suppressed because it is too large Load Diff

View File

@@ -9,7 +9,7 @@ _BUILT_STAMPFILE = '.spp_built'
Import('env')
def _autotools_project(env: Environment, project_root: str, config_args: 'list[str]' = [], build_args : 'list[str]' = [], install_args : 'list[str]' = []) -> dict:
def _autotools_project(env: Environment, project_root: str, config_args: 'list[str]' = [], build_args : 'list[str]' = [], install_args : 'list[str]' = [], configure_script_path: str = 'configure', skip_steps = ()) -> dict:
config = env['BUILD_TYPE']
build_dir = os.path.join(project_root, f'build_{config}')
install_dir = os.path.join(project_root, f'install_{config}')
@@ -27,15 +27,32 @@ def _autotools_project(env: Environment, project_root: str, config_args: 'list[s
jobs = env.GetOption('num_jobs')
env = os.environ.copy()
env['CFLAGS'] = cflags
config_script = os.path.join(project_root, configure_script_path)
if not os.path.exists(config_script) and os.path.exists(f'{config_script}.ac'):
subprocess.run(('autoreconf', '--install', '--force'), cwd=project_root)
subprocess.run((os.path.join(project_root, 'configure'), '--prefix', install_dir, *config_args), cwd=build_dir, env=env, stdout=sys.stdout, stderr=sys.stderr, check=True)
subprocess.run(('make', f'-j{jobs}', *build_args), cwd=build_dir, stdout=sys.stdout, stderr=sys.stderr, check=True)
subprocess.run(('make', 'install', *install_args), cwd=build_dir, stdout=sys.stdout, stderr=sys.stderr, check=True)
if 'configure' not in skip_steps:
subprocess.run((config_script, f'--prefix={install_dir}', *config_args), cwd=build_dir, env=env, stdout=sys.stdout, stderr=sys.stderr, check=True)
if 'build' not in skip_steps:
subprocess.run(('make', f'-j{jobs}', *build_args), cwd=build_dir, stdout=sys.stdout, stderr=sys.stderr, check=True)
if 'install' not in skip_steps:
subprocess.run(('make', 'install', *install_args), cwd=build_dir, stdout=sys.stdout, stderr=sys.stderr, check=True)
else:
# must still create the install dir for the stamp file
os.makedirs(install_dir, exist_ok=True)
pathlib.Path(install_dir, _BUILT_STAMPFILE).touch()
libpath = []
for lib_folder in ('lib', 'lib64'):
full_path = os.path.join(install_dir, lib_folder)
if os.path.exists(full_path):
libpath.append(full_path)
return {
'build_dir': build_dir,
'install_dir': install_dir,
'LIBPATH': [os.path.join(install_dir, 'lib')],
'LIBPATH': libpath,
'CPPPATH': [os.path.join(install_dir, 'include')]
}

View File

@@ -1,9 +1,12 @@
import os
import json
import pathlib
import shutil
from SCons.Script import *
_BUILT_STAMPFILE = '.spp_built'
_VERSION = 2 # bump if you change how the projects are build to trigger a clean build
Import('env')
@@ -11,11 +14,66 @@ def cmd_quote(s: str) -> str:
escaped = s.replace('\\', '\\\\')
return f'"{escaped}"'
def _cmake_project(env: Environment, project_root: str, generate_args: 'list[str]' = [], build_args : 'list[str]' = [], install_args : 'list[str]' = []) -> dict:
def _generate_cmake_c_flags(env, dependencies: 'list[dict]') -> str:
parts = env['DEPS_CFLAGS'].copy()
for dependency in dependencies:
for path in dependency.get('CPPPATH', []):
parts.append(f'-I{path}')
return cmd_quote(' '.join(parts))
def _generate_cmake_cxx_flags(env, dependencies: 'list[dict]') -> str:
parts = env['DEPS_CXXFLAGS'].copy()
for dependency in dependencies:
for path in dependency.get('CPPPATH', []):
parts.append(f'-I{path}')
return cmd_quote(' '.join(parts))
def _get_cmake_cxx_standard(env: Environment) -> str:
return env['CXX_STANDARD'][3:] # we use "C++XX", CMake just "XX"
def _get_cmake_prefix_path(dependencies: 'list[dict]') -> str:
parts = []
for dependency in dependencies:
for path in dependency.get('CMAKE_PREFIX_PATH', []):
parts.append(path)
return cmd_quote(';'.join(parts))
def _generate_cmake_args(env: Environment, dependencies: 'list[dict]') -> 'list[str]':
args = [f'-DCMAKE_C_FLAGS={_generate_cmake_c_flags(env, dependencies)}',
f'-DCMAKE_CXX_FLAGS={_generate_cmake_cxx_flags(env, dependencies)}',
f'-DCMAKE_CXX_STANDARD={_get_cmake_cxx_standard(env)}',
f'-DCMAKE_PREFIX_PATH={_get_cmake_prefix_path(dependencies)}']
for dependency in dependencies:
for name, value in dependency.get('CMAKE_VARS', {}).items():
args.append(f'-D{name}={cmd_quote(value)}')
return args
def _calc_version_hash(env, dependencies: 'list[dict]') -> str:
return json.dumps({
'version': _VERSION,
'dependencies': dependencies,
'cxxflags': env['DEPS_CXXFLAGS']
})
def _cmake_project(env: Environment, project_root: str, generate_args: 'list[str]' = [], build_args : 'list[str]' = [], install_args : 'list[str]' = [], dependencies: 'list[dict]' = []) -> dict:
config = env['BUILD_TYPE']
build_dir = os.path.join(project_root, f'build_{config}')
install_dir = os.path.join(project_root, f'install_{config}')
is_built = os.path.exists(os.path.join(install_dir, _BUILT_STAMPFILE))
version_hash = _calc_version_hash(env, dependencies)
stamp_file = pathlib.Path(install_dir, _BUILT_STAMPFILE)
is_built = stamp_file.exists()
if is_built:
with stamp_file.open('r') as f:
build_version = f.read()
if build_version != version_hash:
print(f'Rebuilding CMake project at {project_root} as the script version changed.')
is_built = False
if not is_built:
shutil.rmtree(build_dir)
shutil.rmtree(install_dir)
if not is_built or env['UPDATE_REPOSITORIES']:
print(f'Building {project_root}, config {config}')
os.makedirs(build_dir, exist_ok=True)
@@ -26,14 +84,19 @@ def _cmake_project(env: Environment, project_root: str, generate_args: 'list[str
'profile': 'RelWithDebInfo'
}.get(env['BUILD_TYPE'], 'RelWithDebInfo')
def run_cmd(args):
env.Execute(' '.join([str(s) for s in args]))
if env.Execute(' '.join([str(s) for s in args])):
Exit(1)
# TODO: is this a problem?
# environ = os.environ.copy()
# environ['CXXFLAGS'] = ' '.join(f'-D{define}' for define in env['CPPDEFINES']) # TODO: who cares about windows?
run_cmd(['cmake', '-G', 'Ninja', '-B', build_dir, f'-DCMAKE_BUILD_TYPE={build_type}', f'-DCMAKE_INSTALL_PREFIX={cmd_quote(install_dir)}', '-DBUILD_TESTING=OFF', *generate_args, project_root])
run_cmd(['cmake', '-G', 'Ninja', '-B', build_dir, f'-DCMAKE_BUILD_TYPE={build_type}',
f'-DCMAKE_INSTALL_PREFIX={cmd_quote(install_dir)}', '-DBUILD_TESTING=OFF',
*_generate_cmake_args(env, dependencies), *generate_args, project_root])
run_cmd(['cmake', '--build', *build_args, cmd_quote(build_dir)])
run_cmd(['cmake', '--install', *install_args, cmd_quote(build_dir)])
pathlib.Path(install_dir, _BUILT_STAMPFILE).touch()
with pathlib.Path(install_dir, _BUILT_STAMPFILE).open('w') as f:
f.write(version_hash)
libpath = []
for lib_folder in ('lib', 'lib64'):
@@ -43,6 +106,7 @@ def _cmake_project(env: Environment, project_root: str, generate_args: 'list[str
return {
'install_dir': install_dir,
'BINPATH': [os.path.join(install_dir, 'bin')],
'LIBPATH': libpath,
'CPPPATH': [os.path.join(install_dir, 'include')]
}

View File

@@ -2,12 +2,12 @@
from git import Repo
from git.exc import GitError
import hashlib
import os
import inspect
from SCons.Script import *
Import('env')
def _gitbranch(env: Environment, repo_name: str, remote_url: str, git_ref: str = "main") -> dict:
def _clone(env: Environment, repo_name: str, remote_url: str):
repo_dir = os.path.join(env['CLONE_DIR'], 'git', repo_name, '_bare')
try:
repo = Repo(repo_dir)
@@ -16,24 +16,114 @@ def _gitbranch(env: Environment, repo_name: str, remote_url: str, git_ref: str =
print(f'Initializing git repository at {repo_dir}.')
repo = Repo.init(repo_dir, bare=True)
origin = repo.create_remote('origin', remote_url)
return repo, origin
def _git_branch(env: Environment, repo_name: str, remote_url: str, git_ref: str = 'main') -> dict:
repo, origin = _clone(env, repo_name, remote_url)
worktree_dir = os.path.join(env['CLONE_DIR'], 'git', repo_name, hashlib.shake_128(git_ref.encode('utf-8')).hexdigest(6)) # TODO: commit hash would be better, right? -> not if it's a branch!
update_submodules = False
if not os.path.exists(worktree_dir):
print(f'Checking out into {worktree_dir}.')
origin.fetch(tags=True)
origin.fetch(tags=True, force=True)
os.makedirs(worktree_dir)
repo.git.worktree('add', worktree_dir, git_ref)
worktree_repo = Repo(worktree_dir)
update_submodules = True
elif env['UPDATE_REPOSITORIES']:
worktree_repo = Repo(worktree_dir)
if not worktree_repo.head.is_detached:
print(f'Updating git repository at {worktree_dir}')
worktree_origin = worktree_repo.remotes['origin']
worktree_origin.pull()
update_submodules = True
else:
print(f'Not updating git repository {worktree_dir} as it is not on a branch.')
if update_submodules:
for submodule in worktree_repo.submodules:
submodule.update(init=True)
return {
'checkout_root': worktree_dir
'checkout_root': worktree_dir,
'repo': repo,
'origin': origin
}
def _git_tags(env: Environment, repo_name: str, remote_url: str, force_fetch: bool = False) -> 'list[str]':
repo, origin = _clone(env, repo_name, remote_url)
if force_fetch or env['UPDATE_REPOSITORIES']:
origin.fetch(tags=True)
return [t.name for t in repo.tags]
env.AddMethod(_gitbranch, 'GitBranch')
def _make_callable(val):
if callable(val):
return val
else:
def _wrapped(*args, **kwargs):
return val
return _wrapped
def _git_recipe(env: Environment, globals: dict, repo_name, repo_url, cook_fn, versions = None, tag_pattern = None, tag_fn = None, ref_fn = None, dependencies: dict = {}) -> None:
_repo_name = _make_callable(repo_name)
_repo_url = _make_callable(repo_url)
_tag_pattern = _make_callable(tag_pattern)
versions_cb = versions and _make_callable(versions)
dependencies_cb = _make_callable(dependencies)
def _versions(env: Environment, update: bool = False, options: dict = {}):
if 'ref' in options:
return [(0, 0, 0)] # no versions if compiling from a branch
pattern_signature = inspect.signature(_tag_pattern)
kwargs = {}
if 'options' in pattern_signature.parameters:
kwargs['options'] = options
pattern = _tag_pattern(env, **kwargs)
if pattern:
tags = env.GitTags(repo_name = _repo_name(env), remote_url = _repo_url(env), force_fetch=update)
result = []
for tag in tags:
match = pattern.match(tag)
if match:
result.append(tuple(int(part) for part in match.groups() if part is not None))
if len(result) == 0 and not update:
return _versions(env, update=True)
return result
elif versions_cb:
return versions_cb(env)
else:
return [(0, 0, 0)]
def _dependencies(env: Environment, version, options: dict) -> 'dict':
dependencies_signature = inspect.signature(dependencies_cb)
kwargs = {}
if 'options' in dependencies_signature.parameters:
kwargs['options'] = options
return dependencies_cb(env, version, **kwargs)
def _cook(env: Environment, version, options: dict = {}) -> dict:
if 'ref' in options:
git_ref = options['ref']
elif tag_fn:
tag_signature = inspect.signature(tag_fn)
kwargs = {}
if 'options' in tag_signature.parameters:
kwargs['options'] = options
git_ref = f'refs/tags/{tag_fn(version, **kwargs)}'
else:
assert ref_fn
git_ref = ref_fn(env, version)
repo = env.GitBranch(repo_name = _repo_name(env), remote_url = _repo_url(env), git_ref = git_ref)
cook_signature = inspect.signature(cook_fn)
kwargs = {}
if 'options' in cook_signature.parameters:
kwargs['options'] = options
return cook_fn(env, repo, **kwargs)
globals['versions'] = _versions
globals['dependencies'] = _dependencies
globals['cook'] = _cook
env.AddMethod(_git_branch, 'GitBranch')
env.AddMethod(_git_tags, 'GitTags')
env.AddMethod(_git_recipe, 'GitRecipe')
Return('env')

View File

@@ -1,4 +1,5 @@
import os
import pathlib
Import('env')
@@ -31,8 +32,33 @@ def _wrap_jinja(orig_jinja):
return target
return _wrapped
def _find_file(env, fname):
for path in env['JINJA_FILE_SEARCHPATH']:
fullpath = os.path.join(path.abspath, fname)
if os.path.exists(fullpath):
return env.File(fullpath)
return None
def _file_size(env, fname: str) -> int:
file = _find_file(env, fname)
if not file:
env.Error(f'File does not exist: {fname}. Searched in: {[d.abspath for d in env["JINJA_FILE_SEARCHPATH"]]}')
return file.get_size()
def _file_content_hex(env, fname: str) -> str:
file = _find_file(env, fname)
if not file:
env.Error(f'File does not exist: {fname}. Searched in: {[d.abspath for d in env["JINJA_FILE_SEARCHPATH"]]}')
bytes = file.get_contents()
return ','.join([hex(byte) for byte in bytes])
env.AddMethod(_wrap_jinja(env.Jinja), 'Jinja')
env.Append(JINJA_FILTERS = {'load_config': _jinja_load_config})
env.Append(JINJA_GLOBALS = {
'file_size': lambda *args: _file_size(env, *args),
'file_content_hex': lambda *args: _file_content_hex(env, *args)
})
env.Append(JINJA_TEMPLATE_SEARCHPATH = ['data/jinja'])
env['JINJA_CONFIG_SEARCHPATH'] = [env.Dir('#data/config')]
env['JINJA_FILE_SEARCHPATH'] = [env.Dir('#')]
Return('env')

View File

@@ -0,0 +1,11 @@
import os
Import('env')
def _recipe_repository(env, repo_name: str, remote_url: str, git_ref: str = 'master') -> None:
repo = env.GitBranch(repo_name = os.path.join('recipe_repos', repo_name), remote_url = remote_url, git_ref = git_ref)
env.Append(SPP_RECIPES_FOLDERS = [os.path.join(repo['checkout_root'], 'recipes')])
env.AddMethod(_recipe_repository, 'RecipeRepo')
Return('env')

View File

@@ -0,0 +1,13 @@
FROM debian:sid-slim
RUN apt-get -y update && \
apt-get -y upgrade && \
apt-get -y install build-essential clang-19 gcc-14 g++-14 python3 python3-pip \
virtualenv python-is-python3 clang-tidy git ninja-build cmake
RUN ln -s /usr/bin/clang-19 /usr/local/bin/clang \
&& ln -s /usr/bin/clang++-19 /usr/local/bin/clang++ \
&& ln -s /usr/bin/clang-tidy-19 /usr/local/bin/clang-tidy \
&& ln -s /usr/bin/run-clang-tidy-19 /usr/local/bin/run-clang-tidy
COPY scripts /opt/scripts
RUN chmod a+x /opt/scripts/*.sh

View File

@@ -0,0 +1,9 @@
#!/bin/bash
set -xe
python -m virtualenv venv
source venv/bin/activate
pip install scons
pip install -r external/scons-plus-plus/requirements.txt
scons -j$(nproc) --build_type=debug --variant=linux_clang_debug --compiler=clang
scons -j$(nproc) --build_type=release_debug --variant=linux_clang_release_debug --compiler=clang
scons -j$(nproc) --build_type=release --variant=linux_clang_release --compiler=clang

View File

@@ -0,0 +1,9 @@
#!/bin/bash
set -xe
python -m virtualenv venv
source venv/bin/activate
pip install scons
pip install -r external/scons-plus-plus/requirements.txt
scons -j$(nproc) --build_type=debug --variant=linux_gcc_debug --compiler=gcc
scons -j$(nproc) --build_type=release_debug --variant=linux_gcc_release_debug --compiler=gcc
scons -j$(nproc) --build_type=release --variant=linux_gcc_release --compiler=gcc

6
contrib/run_scons.py Normal file
View File

@@ -0,0 +1,6 @@
# use this to start SCons from the IDE for debugging
import sys
from SCons.Script.Main import main
if __name__ == '__main__':
sys.exit(main())

View File

@@ -1,21 +0,0 @@
from SCons.Script import *
def cook(env: Environment, git_ref: str = 'master', own_main: bool = False) -> dict:
repo = env.GitBranch(repo_name = 'catch2', remote_url = 'https://github.com/catchorg/Catch2.git', git_ref = git_ref)
checkout_root = repo['checkout_root']
build_result = env.CMakeProject(project_root=checkout_root)
lib_name = {
'debug': 'Catch2d'
}.get(env['BUILD_TYPE'], 'Catch2')
libs = [lib_name]
if not own_main:
libs.append({
'debug': 'Catch2Maind'
}.get(env['BUILD_TYPE'], 'Catch2Main'))
return {
'LIBPATH': build_result['LIBPATH'],
'CPPPATH': build_result['CPPPATH'],
'LIBS': libs
}

View File

@@ -1,12 +0,0 @@
from SCons.Script import *
def cook(env: Environment, git_ref = 'main') -> dict:
repo = env.GitBranch(repo_name = 'ImageMagick', remote_url = 'https://github.com/ImageMagick/ImageMagick.git', git_ref = git_ref)
checkout_root = repo['checkout_root']
build_result = env.AutotoolsProject(checkout_root)
return {
'LIBPATH': build_result['LIBPATH'],
'CPPPATH': build_result['CPPPATH'],
'LIBS': ['backtrace']
}

View File

@@ -1,27 +0,0 @@
import os
import platform
from SCons.Script import *
def cook(env: Environment, git_ref: str = "main") -> dict:
repo = env.GitBranch(repo_name = 'SDL', remote_url = 'https://github.com/libsdl-org/SDL.git', git_ref = git_ref)
checkout_root = repo['checkout_root']
build_result = env.CMakeProject(project_root=checkout_root, generate_args = ['-DSDL_STATIC=ON', '-DSDL_SHARED=OFF'])
libs = []
if platform.system() == 'Windows':
if env['BUILD_TYPE'] == 'debug':
libs.append('SDL2-staticd')
else:
libs.append('SDL2-static')
libs.extend(('kernel32', 'user32', 'gdi32', 'winmm', 'imm32', 'ole32', 'oleaut32', 'version', 'uuid', 'advapi32', 'setupapi', 'shell32', 'dinput8'))
else:
if env['BUILD_TYPE'] == 'debug':
libs.append('SDL2d')
else:
libs.append('SDL2')
return {
'LIBPATH': build_result['LIBPATH'],
'CPPPATH': [os.path.join(build_result['install_dir'], 'include/SDL2')], # SDL is really weird about include paths ...
'LIBS': libs
}

View File

@@ -1,13 +0,0 @@
import os
from SCons.Script import *
def cook(env: Environment, remote: str = 'github', git_ref: str = 'main') -> dict:
if remote == 'mewin':
repo = env.GitBranch(repo_name = 'VulkanHeaders_mewin', remote_url = 'https://git.mewin.de/mewin/vulkan-headers.git', git_ref = git_ref)
else:
repo = env.GitBranch(repo_name = 'VulkanHeaders', remote_url = 'https://github.com/KhronosGroup/Vulkan-Headers.git', git_ref = git_ref)
checkout_root = repo['checkout_root']
return {
'CPPPATH': [os.path.join(checkout_root, 'include')]
}

View File

@@ -1,10 +0,0 @@
import os
from SCons.Script import *
def cook(env: Environment, git_ref: str = "master") -> dict:
repo = env.GitBranch(repo_name = 'argparse', remote_url = 'https://github.com/p-ranav/argparse.git', git_ref = git_ref)
checkout_root = repo['checkout_root']
return {
'CPPPATH': [os.path.join(checkout_root, 'include')]
}

View File

@@ -1,12 +0,0 @@
import os
from SCons.Script import *
def cook(env: Environment, version: str = "1.85.0") -> dict:
# TODO: build binaries?
url = f'https://archives.boost.io/release/{version}/source/boost_{version.replace(".", "_")}.tar.gz'
repo = env.DownloadAndExtract(f'boost_{version}', url = url, skip_folders = 1)
checkout_root = repo['extracted_root']
return {
'CPPPATH': [checkout_root]
}

View File

@@ -1,9 +0,0 @@
from SCons.Script import *
def cook(env: Environment, git_ref: str = "master") -> dict:
repo = env.GitBranch(repo_name = 'cgltf', remote_url = 'https://github.com/jkuhlmann/cgltf.git', git_ref = git_ref)
checkout_root = repo['checkout_root']
return {
'CPPPATH': [checkout_root]
}

View File

@@ -1,16 +0,0 @@
from SCons.Script import *
def cook(env: Environment, git_ref: str = 'master') -> dict:
repo = env.GitBranch(repo_name = 'fmt', remote_url = 'https://github.com/fmtlib/fmt.git', git_ref = git_ref)
checkout_root = repo['checkout_root']
build_result = env.CMakeProject(project_root=checkout_root, generate_args = ['-DFMT_TEST=OFF'])
lib_name = {
'debug': 'fmtd'
}.get(env['BUILD_TYPE'], 'fmt')
return {
'LIBPATH': build_result['LIBPATH'],
'CPPPATH': build_result['CPPPATH'],
'LIBS': [lib_name]
}

View File

@@ -1,13 +0,0 @@
from SCons.Script import *
def cook(env: Environment, remote: str = 'github', git_ref: str = "master") -> dict:
if remote == 'mewin':
repo = env.GitBranch(repo_name = 'glm_mewin', remote_url = 'https://git.mewin.de/mewin/glm.git', git_ref = git_ref)
else:
repo = env.GitBranch(repo_name = 'glm', remote_url = 'https://github.com/g-truc/glm.git', git_ref = git_ref)
checkout_root = repo['checkout_root']
return {
'CPPPATH': [checkout_root],
}

View File

@@ -1,83 +0,0 @@
from SCons.Script import *
import glob
import os
import pathlib
import platform
import shutil
import sys
_SCRIPT_STAMPFILE = '.spp_script_run'
def cook(env: Environment, remote: str = 'github', git_ref: str = '') -> dict:
if remote == 'mewin':
repo = env.GitBranch(repo_name = 'glslang_mewin', remote_url = 'https://git.mewin.de/mewin/glslang.git', git_ref = git_ref or 'master')
else:
repo = env.GitBranch(repo_name = 'glslang', remote_url = 'https://github.com/KhronosGroup/glslang.git', git_ref = git_ref or 'main')
checkout_root = repo['checkout_root']
# TODO: windows?
did_run_script = os.path.exists(os.path.join(repo['checkout_root'], _SCRIPT_STAMPFILE))
if not did_run_script or env['UPDATE_REPOSITORIES']:
python_exe = os.path.realpath(sys.executable)
script_file = os.path.join(repo['checkout_root'], 'update_glslang_sources.py')
prev_cwd = os.getcwd()
os.chdir(repo['checkout_root'])
if env.Execute(f'"{python_exe}" {script_file}'):
env.Exit(1)
os.chdir(prev_cwd)
pathlib.Path(repo['checkout_root'], _SCRIPT_STAMPFILE).touch()
# generate the build_info.h
generator_script = os.path.join(repo['checkout_root'], 'build_info.py')
generator_script_input = os.path.join(repo['checkout_root'], 'build_info.h.tmpl')
generator_script_output = os.path.join(repo['checkout_root'], 'glslang/build_info.h')
env.Command(
target = generator_script_output,
source = [generator_script, generator_script_input, os.path.join(repo['checkout_root'], 'CHANGES.md')],
action = f'"$PYTHON" "{generator_script}" "{repo["checkout_root"]}" -i "{generator_script_input}" -o "$TARGET"'
)
platform_source_dir = {
'Linux': 'Unix',
'Windows': 'Windows',
'Darwin': 'Unix'
}.get(platform.system(), 'Unix')
glslang_source_files = env.RGlob(os.path.join(repo['checkout_root'], 'glslang/GenericCodeGen/'), '*.cpp') \
+ env.RGlob(os.path.join(repo['checkout_root'], 'glslang/MachineIndependent/'), '*.cpp') \
+ env.RGlob(os.path.join(repo['checkout_root'], 'glslang/OGLCompilersDLL/'), '*.cpp') \
+ env.RGlob(os.path.join(repo['checkout_root'], 'glslang/ResourceLimits/'), '*.cpp') \
+ env.RGlob(os.path.join(repo['checkout_root'], 'SPIRV/'), '*.cpp') \
+ [os.path.join(repo['checkout_root'], f'glslang/OSDependent/{platform_source_dir}/ossource.cpp')]
# disable a few warnings when compiling with clang
additional_cxx_flags = {
'clang': ['-Wno-deprecated-copy', '-Wno-missing-field-initializers', '-Wno-gnu-redeclared-enum',
'-Wno-unused-but-set-variable', '-Wno-deprecated-enum-enum-conversion']
}.get(env['COMPILER_FAMILY'], [])
env.StaticLibrary(
CCFLAGS = env['CCFLAGS'] + additional_cxx_flags,
CPPPATH = repo['checkout_root'],
target = env['LIB_DIR'] + '/glslang_full',
source = glslang_source_files
)
# build the include folder
include_dir = os.path.join(checkout_root, 'include')
if not os.path.exists(include_dir) or env['UPDATE_REPOSITORIES']:
def copy_headers(dst, src):
os.makedirs(dst, exist_ok=True)
for file in glob.glob(os.path.join(src, '*.h')):
shutil.copy(file, dst)
copy_headers(os.path.join(include_dir, 'glslang/HLSL'), os.path.join(checkout_root, 'glslang/HLSL'))
copy_headers(os.path.join(include_dir, 'glslang/Include'), os.path.join(checkout_root, 'glslang/Include'))
copy_headers(os.path.join(include_dir, 'glslang/MachineIndependent'), os.path.join(checkout_root, 'glslang/MachineIndependent'))
copy_headers(os.path.join(include_dir, 'glslang/Public'), os.path.join(checkout_root, 'glslang/Public'))
copy_headers(os.path.join(include_dir, 'glslang/SPIRV'), os.path.join(checkout_root, 'SPIRV'))
return {
'CPPPATH': [include_dir],
'LIBS': ['glslang_full']
}

View File

@@ -1,30 +0,0 @@
from SCons.Script import *
import os
def cook(env: Environment, backends: list = [], git_ref: str = '') -> dict:
repo = env.GitBranch(repo_name = 'imgui', remote_url = 'https://github.com/ocornut/imgui.git', git_ref = git_ref or 'master')
imgui_source_files = [
os.path.join(repo['checkout_root'], 'imgui.cpp'),
os.path.join(repo['checkout_root'], 'imgui_draw.cpp'),
os.path.join(repo['checkout_root'], 'imgui_tables.cpp'),
os.path.join(repo['checkout_root'], 'imgui_widgets.cpp')
]
imgui_add_sources = []
backend_sources = {
'vulkan': os.path.join(repo['checkout_root'], 'backends/imgui_impl_vulkan.cpp'),
'sdl2': os.path.join(repo['checkout_root'], 'backends/imgui_impl_sdl2.cpp')
}
for backend in backends:
imgui_add_sources.append(backend_sources[backend])
lib_imgui = env.StaticLibrary(
CPPPATH = [repo['checkout_root']],
CPPDEFINES = ['IMGUI_IMPL_VULKAN_NO_PROTOTYPES=1'],
target = env['LIB_DIR'] + '/imgui',
source = imgui_source_files,
add_source = imgui_add_sources
)
return lib_imgui

View File

@@ -1,8 +0,0 @@
import os
from SCons.Script import *
def cook(env: Environment, git_ref: str = "master") -> dict:
repo = env.GitBranch(repo_name = 'iwa', remote_url = 'https://git.mewin.de/mewin/iwa.git', git_ref = git_ref)
checkout_root = repo['checkout_root']
return SConscript(os.path.join(checkout_root, 'LibConf'), exports = ['env'])

View File

@@ -1,14 +0,0 @@
from SCons.Script import *
def cook(env: Environment, git_ref = 'master') -> dict:
if env['COMPILER_FAMILY'] not in ('gcc', 'clang'):
env.Error('libbacktrace requires gcc or clang.')
repo = env.GitBranch(repo_name = 'libbacktrace', remote_url = 'https://github.com/ianlancetaylor/libbacktrace.git', git_ref = git_ref)
checkout_root = repo['checkout_root']
build_result = env.AutotoolsProject(checkout_root)
return {
'LIBPATH': build_result['LIBPATH'],
'CPPPATH': build_result['CPPPATH'],
'LIBS': ['backtrace']
}

View File

@@ -1,11 +0,0 @@
from SCons.Script import *
def cook(env: Environment, git_ref = 'main') -> dict:
repo = env.GitBranch(repo_name = 'libjpeg-turbo', remote_url = 'https://github.com/libjpeg-turbo/libjpeg-turbo.git', git_ref = git_ref)
checkout_root = repo['checkout_root']
build_result = env.CMakeProject(checkout_root)
return {
'CPPPATH': build_result['CPPPATH'],
'LIBS': [env.FindLib('jpeg', paths=build_result['LIBPATH'])],
}

View File

@@ -1,13 +0,0 @@
from SCons.Script import *
def cook(env: Environment, git_ref = 'master') -> dict:
lib_z = env.Cook('zlib')
repo = env.GitBranch(repo_name = 'libpng', remote_url = 'https://git.code.sf.net/p/libpng/code.git', git_ref = git_ref)
checkout_root = repo['checkout_root']
build_result = env.AutotoolsProject(checkout_root)
return {
'CPPPATH': build_result['CPPPATH'],
'LIBS': [env.FindLib('png16', paths=build_result['LIBPATH'])],
'DEPENDENCIES': [lib_z]
}

View File

@@ -1,10 +0,0 @@
import os
from SCons.Script import *
def cook(env: Environment, git_ref: str = "master") -> dict:
repo = env.GitBranch(repo_name = 'magic_enum', remote_url = 'https://github.com/Neargye/magic_enum.git', git_ref = git_ref)
checkout_root = repo['checkout_root']
return {
'CPPPATH': [os.path.join(checkout_root, 'include')]
}

View File

@@ -1,14 +0,0 @@
from SCons.Script import *
import os
def cook(env: Environment, git_ref = 'master') -> dict:
repo = env.GitBranch(repo_name = 'mecab', remote_url = 'https://github.com/taku910/mecab.git', git_ref = git_ref)
checkout_root = repo['checkout_root']
build_result = env.AutotoolsProject(os.path.join(checkout_root, 'mecab'))
return {
'LIBPATH': build_result['LIBPATH'],
'CPPPATH': build_result['CPPPATH'],
'LIBS': ['mecab']
}

View File

@@ -1,8 +0,0 @@
import os
from SCons.Script import *
def cook(env: Environment, git_ref: str = "master") -> dict:
repo = env.GitBranch(repo_name = 'mijin', remote_url = 'https://git.mewin.de/mewin/mijin2.git', git_ref = git_ref)
checkout_root = repo['checkout_root']
return SConscript(os.path.join(checkout_root, 'LibConf'), exports = ['env'])

View File

@@ -1,12 +0,0 @@
import os
from SCons.Script import *
def cook(env: Environment, git_ref: str = 'master') -> dict:
repo = env.GitBranch(repo_name = 'mikktspace', remote_url = 'https://github.com/mmikk/MikkTSpace.git', git_ref = git_ref)
lib_mikktspace = env.StaticLibrary(
CPPPATH = [repo['checkout_root']],
target = env['LIB_DIR'] + '/mikktspace',
source = [os.path.join(repo['checkout_root'], 'mikktspace.c')]
)
return lib_mikktspace

View File

@@ -1,22 +0,0 @@
from SCons.Script import *
def cook(env: Environment, git_ref: str = 'v1.x', use_external_libfmt = False) -> dict:
repo = env.GitBranch(repo_name = 'spdlog', remote_url = 'https://github.com/gabime/spdlog.git', git_ref = git_ref)
checkout_root = repo['checkout_root']
build_result = env.CMakeProject(project_root=checkout_root)
lib_name = {
'debug': 'spdlogd'
}.get(env['BUILD_TYPE'], 'spdlog')
cppdefines = ['SPDLOG_COMPILE_LIB=1']
if use_external_libfmt:
cppdefines.append('SPDLOG_FMT_EXTERNAL=1')
return {
'LIBPATH': build_result['LIBPATH'],
'CPPPATH': build_result['CPPPATH'],
'CPPDEFINES': cppdefines,
'LIBS': [lib_name]
}

View File

@@ -1,9 +0,0 @@
from SCons.Script import *
def cook(env: Environment, git_ref: str = "master") -> dict:
repo = env.GitBranch(repo_name = 'stb', remote_url = 'https://github.com/nothings/stb.git', git_ref = git_ref)
checkout_root = repo['checkout_root']
return {
'CPPPATH': [checkout_root]
}

View File

@@ -1,15 +0,0 @@
from SCons.Script import *
def cook(env: Environment, git_ref: str = "master") -> dict:
repo = env.GitBranch(repo_name = 'yaml-cpp', remote_url = 'https://github.com/jbeder/yaml-cpp', git_ref = git_ref)
checkout_root = repo['checkout_root']
build_result = env.CMakeProject(project_root=checkout_root)
lib_name = {
'debug': 'yaml-cppd'
}.get(env['BUILD_TYPE'], 'yaml-cpp')
return {
'LIBPATH': build_result['LIBPATH'],
'CPPPATH': build_result['CPPPATH'],
'LIBS': [lib_name]
}

View File

@@ -1,12 +0,0 @@
import os
from SCons.Script import *
def cook(env: Environment, git_ref: str = 'master') -> dict:
repo = env.GitBranch(repo_name = 'zlib', remote_url = 'https://github.com/madler/zlib.git', git_ref = git_ref)
extracted_root = repo['checkout_root']
build_result = env.CMakeProject(project_root=extracted_root)
return {
'CPPPATH': [os.path.join(build_result['install_dir'], 'install')],
'LIBS': [env.FindLib('z', paths=build_result['LIBPATH'])]
}

View File

@@ -1,2 +1,4 @@
GitPython
psutil
Jinja2
requests

View File

@@ -0,0 +1,8 @@
# Default ignored files
/shelf/
/workspace.xml
# Editor-based HTTP Client requests
/httpRequests/
# Datasource local storage ignored files
/dataSources/
/dataSources.local.xml

View File

@@ -0,0 +1,35 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="CLionExternalBuildManager">
{% for executable in project.executables %}
{% for build_type in project.build_types %}
{% set build_type_name = build_type | capitalize -%}
<target id="{{ generate_uuid('target_' + executable.name + '_' + build_type) }}" name="{{ executable.name }} {{ build_type_name }}" defaultType="TOOL">
<configuration id="{{ generate_uuid('configuration_' + executable.name + '_' + build_type) }}" name="{{ executable.name }} {{ build_type_name }}">
<build type="TOOL">
<tool actionId="Tool_External Tools_{{ executable.name }} {{ build_type_name }}" />
</build>
<clean type="TOOL">
<tool actionId="Tool_External Tools_{{ executable.name }} {{ build_type_name }} Clean" />
</clean>
</configuration>
</target>
{% endfor %}
{% endfor %}
{% for library in project.libraries %}
{% for build_type in project.build_types %}
{% set build_type_name = build_type | capitalize -%}
<target id="{{ generate_uuid('target_' + library.name + '_' + build_type) }}" name="{{ library.name }} {{ build_type_name }}" defaultType="TOOL">
<configuration id="{{ generate_uuid('configuration_' + library.name + '_' + build_type) }}" name="{{ library.name }} {{ build_type_name }}">
<build type="TOOL">
<tool actionId="Tool_External Tools_{{ library.name }} {{ build_type_name }}" />
</build>
<clean type="TOOL">
<tool actionId="Tool_External Tools_{{ library.name }} {{ build_type_name }} Clean" />
</clean>
</configuration>
</target>
{% endfor %}
{% endfor %}
</component>
</project>

View File

@@ -0,0 +1,17 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="CompDBSettings">
<option name="linkedExternalProjectsSettings">
<CompDBProjectSettings>
<option name="externalProjectPath" value="$PROJECT_DIR$" />
<option name="modules">
<set>
<option value="$PROJECT_DIR$" />
</set>
</option>
</CompDBProjectSettings>
</option>
</component>
<component name="CompDBWorkspace" PROJECT_DIR="$PROJECT_DIR$" />
<component name="ExternalStorageConfigurationManager" enabled="true" />
</project>

View File

@@ -0,0 +1,40 @@
<toolSet name="External Tools">
{% for executable in project.executables %}
{% for build_type in project.build_types %}
{% set build_type_name = build_type | capitalize -%}
<tool name="{{ executable.name }} {{ build_type_name }}" showInMainMenu="false" showInEditor="false" showInProject="false" showInSearchPopup="false" disabled="false" useConsole="true" showConsoleOnStdOut="false" showConsoleOnStdErr="false" synchronizeAfterRun="true">
<exec>
<option name="COMMAND" value="{{ scons_exe }}" />
<option name="PARAMETERS" value="-j{{ nproc }} --build_type={{ build_type }} --unity=disable {{ executable.filename(build_type) }} compile_commands.json" />
<option name="WORKING_DIRECTORY" value="$ProjectFileDir$" />
</exec>
</tool>
<tool name="{{ executable.name }} {{ build_type_name }} Clean" showInMainMenu="false" showInEditor="false" showInProject="false" showInSearchPopup="false" disabled="false" useConsole="true" showConsoleOnStdOut="false" showConsoleOnStdErr="false" synchronizeAfterRun="true">
<exec>
<option name="COMMAND" value="{{ scons_exe }}" />
<option name="PARAMETERS" value="--build_type={{ build_type }} --unity=disable {{ executable.filename(build_type) }} -c" />
<option name="WORKING_DIRECTORY" value="$ProjectFileDir$" />
</exec>
</tool>
{% endfor %}
{% endfor %}
{% for library in project.libraries %}
{% for build_type in project.build_types %}
{% set build_type_name = build_type | capitalize -%}
<tool name="{{ library.name }} {{ build_type_name }}" showInMainMenu="false" showInEditor="false" showInProject="false" showInSearchPopup="false" disabled="false" useConsole="true" showConsoleOnStdOut="false" showConsoleOnStdErr="false" synchronizeAfterRun="true">
<exec>
<option name="COMMAND" value="{{ scons_exe }}" />
<option name="PARAMETERS" value="-j{{ nproc }} --build_type={{ build_type }} --unity=disable {{ library.filename(build_type) }} compile_commands.json" />
<option name="WORKING_DIRECTORY" value="$ProjectFileDir$" />
</exec>
</tool>
<tool name="{{ library.name }} {{ build_type_name }} Clean" showInMainMenu="false" showInEditor="false" showInProject="false" showInSearchPopup="false" disabled="false" useConsole="true" showConsoleOnStdOut="false" showConsoleOnStdErr="false" synchronizeAfterRun="true">
<exec>
<option name="COMMAND" value="{{ scons_exe }}" />
<option name="PARAMETERS" value="--build_type={{ build_type }} --unity=disable {{ library.filename(build_type) }} -c" />
<option name="WORKING_DIRECTORY" value="$ProjectFileDir$" />
</exec>
</tool>
{% endfor %}
{% endfor %}
</toolSet>

View File

@@ -0,0 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="VcsDirectoryMappings">
<mapping directory="" vcs="Git" />
<mapping directory="$PROJECT_DIR$/external/scons-plus-plus" vcs="Git" />
</component>
</project>

View File

@@ -0,0 +1,109 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="AutoImportSettings">
<option name="autoReloadType" value="SELECTIVE" />
</component>
<component name="CMakeRunConfigurationManager">
<generated />
</component>
<component name="CMakeSettings">
<configurations>
<configuration PROFILE_NAME="Debug" ENABLED="true" CONFIG_NAME="Debug" />
</configurations>
</component>
<component name="ClangdSettings">
<option name="formatViaClangd" value="false" />
</component>
<component name="CompDBLocalSettings">
<option name="availableProjects">
<map>
<entry>
<key>
<ExternalProjectPojo>
<option name="name" value="{{ project.name }}" />
<option name="path" value="$PROJECT_DIR$" />
</ExternalProjectPojo>
</key>
<value>
<list>
<ExternalProjectPojo>
<option name="name" value="{{ project.name }}" />
<option name="path" value="$PROJECT_DIR$" />
</ExternalProjectPojo>
</list>
</value>
</entry>
</map>
</option>
<option name="projectSyncType">
<map>
<entry key="$PROJECT_DIR$" value="RE_IMPORT" />
</map>
</option>
</component>
<component name="ExternalProjectsData">
<projectState path="$PROJECT_DIR$">
<ProjectState />
</projectState>
</component>
<component name="Git.Settings">
<option name="RECENT_GIT_ROOT_PATH" value="$PROJECT_DIR$" />
</component>
<component name="ProjectColorInfo">{
&quot;associatedIndex&quot;: 5
}</component>
<component name="ProjectViewState">
<option name="hideEmptyMiddlePackages" value="true" />
<option name="showLibraryContents" value="true" />
</component>
<component name="PropertiesComponent"><![CDATA[{
"keyToString": {
{% for executable in project.executables -%}
{% for build_type in project.build_types -%}
{% set build_type_name = build_type | capitalize -%}
"Custom Build Application.{{ executable.name }} {{ build_type_name }}.executor": "Debug",
{% endfor -%}
{% endfor -%}
"RunOnceActivity.RadMigrateCodeStyle": "true",
"RunOnceActivity.ShowReadmeOnStart": "true",
"RunOnceActivity.cidr.known.project.marker": "true",
"RunOnceActivity.readMode.enableVisualFormatting": "true",
"cf.first.check.clang-format": "false",
"cidr.known.project.marker": "true",
"git-widget-placeholder": "master",
"node.js.detected.package.eslint": "true",
"node.js.detected.package.tslint": "true",
"node.js.selected.package.eslint": "(autodetect)",
"node.js.selected.package.tslint": "(autodetect)",
"nodejs_package_manager_path": "npm",
"settings.editor.selected.configurable": "CLionExternalConfigurable",
"vue.rearranger.settings.migration": "true"
}
}]]></component>
<component name="RunManager" selected="Custom Build Application.{{ project.executables[0].name }} {{ project.build_types[0] }}">
{% for executable in project.executables -%}
{% for build_type in project.build_types -%}
{% set build_type_name = build_type | capitalize -%}
<configuration name="{{ executable.name }} {{ build_type_name }}" type="CLionExternalRunConfiguration" factoryName="Application" REDIRECT_INPUT="false" ELEVATE="false" USE_EXTERNAL_CONSOLE="false" EMULATE_TERMINAL="false" WORKING_DIR="file://$ProjectFileDir$" PASS_PARENT_ENVS_2="true" PROJECT_NAME="{{ project.name }}" TARGET_NAME="{{ executable.name }} {{ build_type_name }}" CONFIG_NAME="{{ executable.name }} {{ build_type_name }}" RUN_PATH="$PROJECT_DIR$/{{ executable.filename(build_type) }}">
<method v="2">
<option name="CLION.EXTERNAL.BUILD" enabled="true" />
</method>
</configuration>
{% endfor -%}
{% endfor -%}
{% for library in project.libraries -%}
{% for build_type in project.build_types -%}
{% set build_type_name = build_type | capitalize -%}
<configuration name="{{ library.name }} {{ build_type_name }}" type="CLionExternalRunConfiguration" factoryName="Application" REDIRECT_INPUT="false" ELEVATE="false" USE_EXTERNAL_CONSOLE="false" EMULATE_TERMINAL="false" PASS_PARENT_ENVS_2="true" PROJECT_NAME="{{ project.name }}" TARGET_NAME="{{ library.name }} {{ build_type_name }}" CONFIG_NAME="{{ library.name }} {{ build_type_name }}">
<method v="2">
<option name="CLION.EXTERNAL.BUILD" enabled="true" />
</method>
</configuration>
{% endfor -%}
{% endfor -%}
</component>
<component name="SpellCheckerSettings" RuntimeDictionaries="0" Folders="0" CustomDictionaries="0" DefaultDictionary="application-level" UseSingleDictionary="true" transferred="true" />
<component name="TypeScriptGeneratedFilesManager">
<option name="version" value="3" />
</component>
</project>

View File

@@ -0,0 +1,6 @@
{
"recommendations": [
"ms-vscode.cpptools",
"llvm-vs-code-extensions.vscode-clangd"
]
}

View File

@@ -0,0 +1,20 @@
{
"configurations": [
{% for executable in project.executables %}
{% for build_type in project.build_types %}
{% set build_type_name = build_type | capitalize -%}
{
"name": "{{ executable.name }} ({{ build_type | capitalize }})",
"type": "cppvsdbg",
"request": "launch",
"program": "{{ executable.filename(build_type) | escape_path }}",
"args": [],
"stopAtEntry": false,
"cwd": "${workspaceFolder}",
"environment": [],
"console": "integratedTerminal"
}
{% endfor %}
{% endfor %}
]
}

View File

@@ -0,0 +1,69 @@
{
// See https://go.microsoft.com/fwlink/?LinkId=733558
// for the documentation about the tasks.json format
"version": "2.0.0",
"tasks": [
{% for executable in project.executables %}
{% for build_type in project.build_types %}
{% set build_type_name = build_type | capitalize -%}
{
"label": "{{ executable.name }} {{ build_type_name }}",
"type": "shell",
"command": "{{ scons_exe | escape_path }} -j{{ nproc }} --build_type={{ build_type }} --unity=disable {{ executable.filename(build_type) | escape_path }} compile_commands.json",
"options": {
"cwd": "${workspaceFolder}"
},
"problemMatcher": [],
"group": {
"kind": "build",
"isDefault": false
}
},
{
"label": "{{ executable.name }} {{ build_type_name }} Clean",
"type": "shell",
"command": "{{ scons_exe | escape_path }} --build_type={{ build_type }} --unity=disable {{ executable.filename(build_type) | escape_path }} -c",
"options": {
"cwd": "${workspaceFolder}"
},
"problemMatcher": [],
"group": {
"kind": "build",
"isDefault": false
}
},
{% endfor %}
{% endfor %}
{% for library in project.libraries %}
{% for build_type in project.build_types %}
{% set build_type_name = build_type | capitalize -%}
{
"label": "{{ library.name }} {{ build_type_name }}",
"type": "shell",
"command": "{{ scons_exe | escape_path }} -j{{ nproc }} --build_type={{ build_type }} --unity=disable {{ library.filename(build_type) | escape_path }} compile_commands.json",
"options": {
"cwd": "${workspaceFolder}"
},
"problemMatcher": [],
"group": {
"kind": "build",
"isDefault": false
}
},
{
"label": "{{ library.name }} {{ build_type_name }} Clean",
"type": "shell",
"command": "{{ scons_exe | escape_path }} --build_type={{ build_type }} --unity=disable {{ library.filename(build_type) | escape_path }} -c",
"options": {
"cwd": "${workspaceFolder}"
},
"problemMatcher": [],
"group": {
"kind": "build",
"isDefault": false
}
},
{% endfor %}
{% endfor %}
]
}