Added recipes for fmt and magic_enum.
This commit is contained in:
parent
93aabf30b4
commit
d959540e0c
@ -5,5 +5,6 @@ from SCons.Script import *
|
|||||||
def cook(env: Environment, git_ref: str = "main") -> dict:
|
def cook(env: Environment, git_ref: str = "main") -> dict:
|
||||||
repo = env.Cook('GitBranch', repo_name = 'VulkanHeaders', remote_url = 'https://github.com/KhronosGroup/Vulkan-Headers.git', git_ref = git_ref)
|
repo = env.Cook('GitBranch', repo_name = 'VulkanHeaders', remote_url = 'https://github.com/KhronosGroup/Vulkan-Headers.git', git_ref = git_ref)
|
||||||
checkout_root = repo['checkout_root']
|
checkout_root = repo['checkout_root']
|
||||||
env.Append(CPPPATH = [os.path.join(checkout_root, 'include')])
|
return {
|
||||||
return {}
|
'CPPPATH': [os.path.join(checkout_root, 'include')]
|
||||||
|
}
|
||||||
|
40
recipes/fmt/recipe.py
Normal file
40
recipes/fmt/recipe.py
Normal file
@ -0,0 +1,40 @@
|
|||||||
|
|
||||||
|
import os
|
||||||
|
import subprocess
|
||||||
|
import sys
|
||||||
|
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)
|
||||||
|
checkout_root = repo['checkout_root']
|
||||||
|
|
||||||
|
config = env['BUILD_TYPE']
|
||||||
|
build_dir = os.path.join(checkout_root, f'build_{config}')
|
||||||
|
install_dir = os.path.join(checkout_root, f'install_{config}')
|
||||||
|
lib_fname = {
|
||||||
|
'debug': 'libfmtd.a'
|
||||||
|
}.get(env['BUILD_TYPE'], 'libfmt.a') # TODO: who cares about windows?
|
||||||
|
is_built = os.path.exists(os.path.join(build_dir, lib_fname)) # TODO!
|
||||||
|
if not is_built:
|
||||||
|
print(f'Building LibFMT, config {config}')
|
||||||
|
os.makedirs(build_dir, exist_ok=True)
|
||||||
|
build_type = {
|
||||||
|
'debug': 'Debug',
|
||||||
|
'release_debug': 'RelWithDebInfo',
|
||||||
|
'release': 'Release',
|
||||||
|
'profile': 'RelWithDebInfo'
|
||||||
|
}.get(env['BUILD_TYPE'], 'RelWithDebInfo')
|
||||||
|
subprocess.run(('cmake', '-G', 'Ninja', '-B', build_dir, f'-DCMAKE_BUILD_TYPE={build_type}', '-DFMT_TEST=OFF', f'-DCMAKE_INSTALL_PREFIX={install_dir}', checkout_root), stdout=sys.stdout, stderr=sys.stderr, check=True)
|
||||||
|
subprocess.run(('cmake', '--build', build_dir), stdout=sys.stdout, stderr=sys.stderr, check=True)
|
||||||
|
subprocess.run(('cmake', '--install', build_dir), stdout=sys.stdout, stderr=sys.stderr, check=True)
|
||||||
|
|
||||||
|
|
||||||
|
lib_name = {
|
||||||
|
'debug': 'fmtd'
|
||||||
|
}.get(env['BUILD_TYPE'], 'fmt')
|
||||||
|
return {
|
||||||
|
'LIBPATH': [os.path.join(install_dir, 'lib')],
|
||||||
|
'CPPPATH': [os.path.join(install_dir, 'include')],
|
||||||
|
'LIBS': [lib_name, 'm']
|
||||||
|
}
|
||||||
|
|
10
recipes/magic_enum/recipe.py
Normal file
10
recipes/magic_enum/recipe.py
Normal file
@ -0,0 +1,10 @@
|
|||||||
|
|
||||||
|
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)
|
||||||
|
checkout_root = repo['checkout_root']
|
||||||
|
return {
|
||||||
|
'CPPPATH': [os.path.join(checkout_root, 'include')]
|
||||||
|
}
|
Loading…
x
Reference in New Issue
Block a user