diff --git a/SConscript b/SConscript index b983cc3..096e938 100644 --- a/SConscript +++ b/SConscript @@ -433,8 +433,8 @@ env.AddMethod(_wrap_builder(env.UnitySharedLibrary, is_lib = True), 'UnityShared if hasattr(env, 'Gch'): env.AddMethod(_wrap_builder(env.Gch), 'Gch') -if hasattr(env, 'Jinja'): - env = SConscript('addons/jinja.py', exports = 'env') +for addon_file in env.Glob('addons/*.py'): + env = SConscript(addon_file, exports = 'env') if dump_env: print('==== Begin Environment Dump =====') diff --git a/recipes/AutotoolsProject/recipe.py b/addons/autotools_project.py similarity index 85% rename from recipes/AutotoolsProject/recipe.py rename to addons/autotools_project.py index af420c9..0de5681 100644 --- a/recipes/AutotoolsProject/recipe.py +++ b/addons/autotools_project.py @@ -7,7 +7,9 @@ from SCons.Script import * _BUILT_STAMPFILE = '.spp_built' -def cook(env: Environment, project_root: str, config_args: 'list[str]' = [], build_args : 'list[str]' = [], install_args : 'list[str]' = []) -> dict: +Import('env') + +def _autotools_project(env: Environment, project_root: str, config_args: 'list[str]' = [], build_args : 'list[str]' = [], install_args : 'list[str]' = []) -> 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}') @@ -37,3 +39,5 @@ def cook(env: Environment, project_root: str, config_args: 'list[str]' = [], bui 'CPPPATH': [os.path.join(install_dir, 'include')] } +env.AddMethod(_autotools_project, 'AutotoolsProject') +Return('env') \ No newline at end of file diff --git a/recipes/CMakeProject/recipe.py b/addons/cmake_project.py similarity index 88% rename from recipes/CMakeProject/recipe.py rename to addons/cmake_project.py index a62655e..c7ccc23 100644 --- a/recipes/CMakeProject/recipe.py +++ b/addons/cmake_project.py @@ -5,11 +5,13 @@ from SCons.Script import * _BUILT_STAMPFILE = '.spp_built' +Import('env') + def cmd_quote(s: str) -> str: escaped = s.replace('\\', '\\\\') return f'"{escaped}"' -def cook(env: Environment, project_root: str, generate_args: 'list[str]' = [], build_args : 'list[str]' = [], install_args : 'list[str]' = []) -> dict: +def _cmake_project(env: Environment, project_root: str, generate_args: 'list[str]' = [], build_args : 'list[str]' = [], install_args : 'list[str]' = []) -> 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}') @@ -45,3 +47,5 @@ def cook(env: Environment, project_root: str, generate_args: 'list[str]' = [], b 'CPPPATH': [os.path.join(install_dir, 'include')] } +env.AddMethod(_cmake_project, 'CMakeProject') +Return('env') \ No newline at end of file diff --git a/recipes/DownloadAndExtract/recipe.py b/addons/download_and_extract.py similarity index 92% rename from recipes/DownloadAndExtract/recipe.py rename to addons/download_and_extract.py index c1977b7..3cd58ea 100644 --- a/recipes/DownloadAndExtract/recipe.py +++ b/addons/download_and_extract.py @@ -7,6 +7,8 @@ import zipfile import urllib.request from SCons.Script import * +Import('env') + class ArchiveType(Enum): TAR_GZ = 0 ZIP = 1 @@ -54,7 +56,7 @@ def _extract_file(path: pathlib.Path, output_dir: str, archive_type: ArchiveType else: raise Exception('invalid archive type') -def cook(env: Environment, repo_name: str, url: str, skip_folders: int = 0) -> dict: +def _download_and_extract(env: Environment, repo_name: str, url: str, skip_folders: int = 0) -> dict: archive_type = _detect_archive_type(url) ext = _archive_type_ext(archive_type) path = pathlib.Path(env['DOWNLOAD_DIR'], f'{hashlib.shake_128(url.encode("utf-8")).hexdigest(6)}.{ext}') @@ -70,3 +72,5 @@ def cook(env: Environment, repo_name: str, url: str, skip_folders: int = 0) -> d 'extracted_root': str(output_dir) } +env.AddMethod(_download_and_extract, 'DownloadAndExtract') +Return('env') \ No newline at end of file diff --git a/recipes/GitBranch/recipe.py b/addons/gitbranch.py similarity index 88% rename from recipes/GitBranch/recipe.py rename to addons/gitbranch.py index 79a78cd..f4061a6 100644 --- a/recipes/GitBranch/recipe.py +++ b/addons/gitbranch.py @@ -5,7 +5,9 @@ import hashlib import os from SCons.Script import * -def cook(env: Environment, repo_name: str, remote_url: str, git_ref: str = "main") -> dict: +Import('env') + +def _gitbranch(env: Environment, repo_name: str, remote_url: str, git_ref: str = "main") -> dict: repo_dir = os.path.join(env['CLONE_DIR'], 'git', repo_name, '_bare') try: repo = Repo(repo_dir) @@ -32,3 +34,6 @@ def cook(env: Environment, repo_name: str, remote_url: str, git_ref: str = "main 'checkout_root': worktree_dir } + +env.AddMethod(_gitbranch, 'GitBranch') +Return('env') \ No newline at end of file diff --git a/addons/jinja.py b/addons/jinja.py index a38d824..ff7349a 100644 --- a/addons/jinja.py +++ b/addons/jinja.py @@ -3,6 +3,9 @@ import pathlib Import('env') +if not hasattr(env, 'Jinja'): + Return('env') + def _jinja_load_config(env, config_name): searched_paths = [] for scons_path in env['JINJA_CONFIG_SEARCHPATH']: diff --git a/recipes/Catch2/recipe.py b/recipes/Catch2/recipe.py index 3f42f77..08a0543 100644 --- a/recipes/Catch2/recipe.py +++ b/recipes/Catch2/recipe.py @@ -2,9 +2,9 @@ from SCons.Script import * def cook(env: Environment, git_ref: str = 'master', own_main: bool = False) -> dict: - repo = env.Cook('GitBranch', repo_name = 'catch2', remote_url = 'https://github.com/catchorg/Catch2.git', git_ref = git_ref) + 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.Cook('CMakeProject', project_root=checkout_root) + build_result = env.CMakeProject(project_root=checkout_root) lib_name = { 'debug': 'Catch2d' diff --git a/recipes/ImageMagick/recipe.py b/recipes/ImageMagick/recipe.py index 7adc0a1..8d53aca 100644 --- a/recipes/ImageMagick/recipe.py +++ b/recipes/ImageMagick/recipe.py @@ -2,9 +2,9 @@ from SCons.Script import * def cook(env: Environment, git_ref = 'main') -> dict: - repo = env.Cook('GitBranch', repo_name = 'ImageMagick', remote_url = 'https://github.com/ImageMagick/ImageMagick.git', git_ref = git_ref) + 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.Cook('AutotoolsProject', checkout_root) + build_result = env.AutotoolsProject(checkout_root) return { 'LIBPATH': build_result['LIBPATH'], 'CPPPATH': build_result['CPPPATH'], diff --git a/recipes/SDL/recipe.py b/recipes/SDL/recipe.py index 070522f..2a1fef4 100644 --- a/recipes/SDL/recipe.py +++ b/recipes/SDL/recipe.py @@ -4,9 +4,9 @@ import platform from SCons.Script import * def cook(env: Environment, git_ref: str = "main") -> dict: - repo = env.Cook('GitBranch', repo_name = 'SDL', remote_url = 'https://github.com/libsdl-org/SDL.git', git_ref = git_ref) + 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.Cook('CMakeProject', project_root=checkout_root, generate_args = ['-DSDL_STATIC=ON', '-DSDL_SHARED=OFF']) + 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': diff --git a/recipes/VulkanHeaders/recipe.py b/recipes/VulkanHeaders/recipe.py index 2f402e0..954954a 100644 --- a/recipes/VulkanHeaders/recipe.py +++ b/recipes/VulkanHeaders/recipe.py @@ -4,9 +4,9 @@ from SCons.Script import * def cook(env: Environment, remote: str = 'github', git_ref: str = 'main') -> dict: if remote == 'mewin': - repo = env.Cook('GitBranch', repo_name = 'VulkanHeaders_mewin', remote_url = 'https://git.mewin.de/mewin/vulkan-headers.git', git_ref = git_ref) + repo = env.GitBranch(repo_name = 'VulkanHeaders_mewin', remote_url = 'https://git.mewin.de/mewin/vulkan-headers.git', git_ref = git_ref) else: - repo = env.Cook('GitBranch', repo_name = 'VulkanHeaders', remote_url = 'https://github.com/KhronosGroup/Vulkan-Headers.git', git_ref = git_ref) + 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')] diff --git a/recipes/argparse/recipe.py b/recipes/argparse/recipe.py index 7ed1ffe..5b862ab 100644 --- a/recipes/argparse/recipe.py +++ b/recipes/argparse/recipe.py @@ -3,7 +3,7 @@ import os from SCons.Script import * def cook(env: Environment, git_ref: str = "master") -> dict: - repo = env.Cook('GitBranch', repo_name = 'argparse', remote_url = 'https://github.com/p-ranav/argparse.git', git_ref = git_ref) + 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')] diff --git a/recipes/boost/recipe.py b/recipes/boost/recipe.py index 9595f0d..226e4ae 100644 --- a/recipes/boost/recipe.py +++ b/recipes/boost/recipe.py @@ -5,7 +5,7 @@ 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.Cook('DownloadAndExtract', f'boost_{version}', url = url, skip_folders = 1) + repo = env.DownloadAndExtract(f'boost_{version}', url = url, skip_folders = 1) checkout_root = repo['extracted_root'] return { 'CPPPATH': [checkout_root] diff --git a/recipes/cgltf/recipe.py b/recipes/cgltf/recipe.py index 475784d..7b4c184 100644 --- a/recipes/cgltf/recipe.py +++ b/recipes/cgltf/recipe.py @@ -2,7 +2,7 @@ from SCons.Script import * def cook(env: Environment, git_ref: str = "master") -> dict: - repo = env.Cook('GitBranch', repo_name = 'cgltf', remote_url = 'https://github.com/jkuhlmann/cgltf.git', git_ref = git_ref) + 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] diff --git a/recipes/fmt/recipe.py b/recipes/fmt/recipe.py index 5838972..48f3284 100644 --- a/recipes/fmt/recipe.py +++ b/recipes/fmt/recipe.py @@ -2,9 +2,9 @@ from SCons.Script import * def cook(env: Environment, git_ref: str = 'master') -> dict: - repo = env.Cook('GitBranch', repo_name = 'fmt', remote_url = 'https://github.com/fmtlib/fmt.git', git_ref = git_ref) + 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.Cook('CMakeProject', project_root=checkout_root, generate_args = ['-DFMT_TEST=OFF']) + build_result = env.CMakeProject(project_root=checkout_root, generate_args = ['-DFMT_TEST=OFF']) lib_name = { 'debug': 'fmtd' diff --git a/recipes/glm/recipe.py b/recipes/glm/recipe.py index 61d3399..2d6ccf3 100644 --- a/recipes/glm/recipe.py +++ b/recipes/glm/recipe.py @@ -3,9 +3,9 @@ from SCons.Script import * def cook(env: Environment, remote: str = 'github', git_ref: str = "master") -> dict: if remote == 'mewin': - repo = env.Cook('GitBranch', repo_name = 'glm_mewin', remote_url = 'https://git.mewin.de/mewin/glm.git', git_ref = git_ref) + repo = env.GitBranch(repo_name = 'glm_mewin', remote_url = 'https://git.mewin.de/mewin/glm.git', git_ref = git_ref) else: - repo = env.Cook('GitBranch', repo_name = 'glm', remote_url = 'https://github.com/g-truc/glm.git', git_ref = git_ref) + 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 { diff --git a/recipes/glslang/recipe.py b/recipes/glslang/recipe.py index ecb01db..08a5ed0 100644 --- a/recipes/glslang/recipe.py +++ b/recipes/glslang/recipe.py @@ -12,9 +12,9 @@ _SCRIPT_STAMPFILE = '.spp_script_run' def cook(env: Environment, remote: str = 'github', git_ref: str = '') -> dict: if remote == 'mewin': - repo = env.Cook('GitBranch', repo_name = 'glslang_mewin', remote_url = 'https://git.mewin.de/mewin/glslang.git', git_ref = git_ref or 'master') + 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.Cook('GitBranch', repo_name = 'glslang', remote_url = 'https://github.com/KhronosGroup/glslang.git', git_ref = git_ref or 'main') + 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? diff --git a/recipes/imgui/recipe.py b/recipes/imgui/recipe.py index b6b2c8f..2563fde 100644 --- a/recipes/imgui/recipe.py +++ b/recipes/imgui/recipe.py @@ -3,7 +3,7 @@ from SCons.Script import * import os def cook(env: Environment, backends: list = [], git_ref: str = '') -> dict: - repo = env.Cook('GitBranch', repo_name = 'imgui', remote_url = 'https://github.com/ocornut/imgui.git', git_ref = git_ref or 'master') + 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'), diff --git a/recipes/iwa/recipe.py b/recipes/iwa/recipe.py index c5c28fb..9af13c4 100644 --- a/recipes/iwa/recipe.py +++ b/recipes/iwa/recipe.py @@ -3,6 +3,6 @@ import os from SCons.Script import * def cook(env: Environment, git_ref: str = "master") -> dict: - repo = env.Cook('GitBranch', repo_name = 'iwa', remote_url = 'https://git.mewin.de/mewin/iwa.git', git_ref = git_ref) + 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']) diff --git a/recipes/libbacktrace/recipe.py b/recipes/libbacktrace/recipe.py index e8bae96..b5e0ded 100644 --- a/recipes/libbacktrace/recipe.py +++ b/recipes/libbacktrace/recipe.py @@ -4,9 +4,9 @@ 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.Cook('GitBranch', repo_name = 'libbacktrace', remote_url = 'https://github.com/ianlancetaylor/libbacktrace.git', git_ref = git_ref) + 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.Cook('AutotoolsProject', checkout_root) + build_result = env.AutotoolsProject(checkout_root) return { 'LIBPATH': build_result['LIBPATH'], 'CPPPATH': build_result['CPPPATH'], diff --git a/recipes/libjpeg-turbo/recipe.py b/recipes/libjpeg-turbo/recipe.py index 3c1afe6..b7e1569 100644 --- a/recipes/libjpeg-turbo/recipe.py +++ b/recipes/libjpeg-turbo/recipe.py @@ -2,9 +2,9 @@ from SCons.Script import * def cook(env: Environment, git_ref = 'main') -> dict: - repo = env.Cook('GitBranch', repo_name = 'libjpeg-turbo', remote_url = 'https://github.com/libjpeg-turbo/libjpeg-turbo.git', git_ref = git_ref) + 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.Cook('CMakeProject', checkout_root) + build_result = env.CMakeProject(checkout_root) return { 'CPPPATH': build_result['CPPPATH'], 'LIBS': [env.FindLib('jpeg', paths=build_result['LIBPATH'])], diff --git a/recipes/libpng/recipe.py b/recipes/libpng/recipe.py index 10f1632..0c9a353 100644 --- a/recipes/libpng/recipe.py +++ b/recipes/libpng/recipe.py @@ -3,9 +3,9 @@ from SCons.Script import * def cook(env: Environment, git_ref = 'master') -> dict: lib_z = env.Cook('zlib') - repo = env.Cook('GitBranch', repo_name = 'libpng', remote_url = 'https://git.code.sf.net/p/libpng/code.git', git_ref = git_ref) + 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.Cook('AutotoolsProject', checkout_root) + build_result = env.AutotoolsProject(checkout_root) return { 'CPPPATH': build_result['CPPPATH'], 'LIBS': [env.FindLib('png16', paths=build_result['LIBPATH'])], diff --git a/recipes/magic_enum/recipe.py b/recipes/magic_enum/recipe.py index 085bc2c..3b454fd 100644 --- a/recipes/magic_enum/recipe.py +++ b/recipes/magic_enum/recipe.py @@ -3,7 +3,7 @@ import os from SCons.Script import * def cook(env: Environment, git_ref: str = "master") -> dict: - repo = env.Cook('GitBranch', repo_name = 'magic_enum', remote_url = 'https://github.com/Neargye/magic_enum.git', git_ref = git_ref) + 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')] diff --git a/recipes/mecab/recipe.py b/recipes/mecab/recipe.py index 71043fc..fa33fe4 100644 --- a/recipes/mecab/recipe.py +++ b/recipes/mecab/recipe.py @@ -4,9 +4,9 @@ from SCons.Script import * import os def cook(env: Environment, git_ref = 'master') -> dict: - repo = env.Cook('GitBranch', repo_name = 'mecab', remote_url = 'https://github.com/taku910/mecab.git', git_ref = git_ref) + 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.Cook('AutotoolsProject', os.path.join(checkout_root, 'mecab')) + build_result = env.AutotoolsProject(os.path.join(checkout_root, 'mecab')) return { 'LIBPATH': build_result['LIBPATH'], 'CPPPATH': build_result['CPPPATH'], diff --git a/recipes/mijin/recipe.py b/recipes/mijin/recipe.py index 2ba0e51..687518c 100644 --- a/recipes/mijin/recipe.py +++ b/recipes/mijin/recipe.py @@ -3,6 +3,6 @@ import os from SCons.Script import * def cook(env: Environment, git_ref: str = "master") -> dict: - repo = env.Cook('GitBranch', repo_name = 'mijin', remote_url = 'https://git.mewin.de/mewin/mijin2.git', git_ref = git_ref) + 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']) diff --git a/recipes/mikktspace/recipe.py b/recipes/mikktspace/recipe.py index 5692cd6..16332a8 100644 --- a/recipes/mikktspace/recipe.py +++ b/recipes/mikktspace/recipe.py @@ -3,7 +3,7 @@ import os from SCons.Script import * def cook(env: Environment, git_ref: str = 'master') -> dict: - repo = env.Cook('GitBranch', repo_name = 'mikktspace', remote_url = 'https://github.com/mmikk/MikkTSpace.git', git_ref = git_ref) + 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', diff --git a/recipes/spdlog/recipe.py b/recipes/spdlog/recipe.py index fdedb18..c780530 100644 --- a/recipes/spdlog/recipe.py +++ b/recipes/spdlog/recipe.py @@ -2,9 +2,9 @@ from SCons.Script import * def cook(env: Environment, git_ref: str = 'v1.x', use_external_libfmt = False) -> dict: - repo = env.Cook('GitBranch', repo_name = 'spdlog', remote_url = 'https://github.com/gabime/spdlog.git', git_ref = git_ref) + 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.Cook('CMakeProject', project_root=checkout_root) + build_result = env.CMakeProject(project_root=checkout_root) lib_name = { 'debug': 'spdlogd' diff --git a/recipes/stb/recipe.py b/recipes/stb/recipe.py index bcc18ca..1c7a512 100644 --- a/recipes/stb/recipe.py +++ b/recipes/stb/recipe.py @@ -2,7 +2,7 @@ from SCons.Script import * def cook(env: Environment, git_ref: str = "master") -> dict: - repo = env.Cook('GitBranch', repo_name = 'stb', remote_url = 'https://github.com/nothings/stb.git', git_ref = git_ref) + 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] diff --git a/recipes/yaml-cpp/recipe.py b/recipes/yaml-cpp/recipe.py index 9b0fbaa..7b23c23 100644 --- a/recipes/yaml-cpp/recipe.py +++ b/recipes/yaml-cpp/recipe.py @@ -1,9 +1,9 @@ from SCons.Script import * def cook(env: Environment, git_ref: str = "master") -> dict: - repo = env.Cook('GitBranch', repo_name = 'yaml-cpp', remote_url = 'https://github.com/jbeder/yaml-cpp', git_ref = git_ref) + 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.Cook('CMakeProject', project_root=checkout_root) + build_result = env.CMakeProject(project_root=checkout_root) lib_name = { 'debug': 'yaml-cppd' }.get(env['BUILD_TYPE'], 'yaml-cpp') diff --git a/recipes/zlib/recipe.py b/recipes/zlib/recipe.py index 9a52032..1db74a5 100644 --- a/recipes/zlib/recipe.py +++ b/recipes/zlib/recipe.py @@ -3,9 +3,9 @@ import os from SCons.Script import * def cook(env: Environment, git_ref: str = 'master') -> dict: - repo = env.Cook('GitBranch', repo_name = 'zlib', remote_url = 'https://github.com/madler/zlib.git', git_ref = git_ref) + 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.Cook('CMakeProject', project_root=extracted_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'])]