Compare commits

...

3 Commits

9 changed files with 57 additions and 5 deletions

1
.gitignore vendored Normal file
View File

@ -0,0 +1 @@
__pycache__

View File

@ -204,15 +204,15 @@ if env['COMPILER_FAMILY'] == 'gcc' or env['COMPILER_FAMILY'] == 'clang':
if build_type == 'debug':
env.Append(CCFLAGS = ['-g', '-O0'], CPPDEFINES = ['_GLIBCXX_DEBUG'])
elif build_type == 'release_debug' or build_type == 'profile':
env.Append(CCFLAGS = ['-Wno-unused-variable', '-Wno-unused-parameter', '-Wno-unused-but-set-variable', '-Wno-unused-local-typedef', '-Wno-unused-local-typedefs', '-g', '-O2'], CPPDEFINES = ['SEKIEI_RELEASE', 'NDEBUG'])
env.Append(CCFLAGS = ['-Wno-unused-variable', '-Wno-unused-parameter', '-Wno-unused-but-set-variable', '-Wno-unused-local-typedef', '-Wno-unused-local-typedefs', '-g', '-O2'], CPPDEFINES = [f'{config["PREPROCESSOR_PREFIX"]}_RELEASE', 'NDEBUG'])
if build_type == 'profile':
if env['COMPILER_FAMILY'] == 'gcc':
env.Append(CPPDEFINES = ['SEKIEI_GCC_INSTRUMENTING=1'])
env.Append(CPPDEFINES = [f'{config["PREPROCESSOR_PREFIX"]}_GCC_INSTRUMENTING=1'])
env.Append(CCFLAGS = ['-finstrument-functions'])
env.Append(LINKFLAGS = ['-rdynamic'])
elif build_type == 'release':
env.Append(CCFLAGS = ['-Wno-unused-variable', '-Wno-unused-parameter', '-Wno-unused-but-set-variable', '-Wno-unused-local-typedef', '-Wno-unused-local-typedefs', '-O2'], CPPDEFINES = ['SEKIEI_RELEASE', 'NDEBUG'])
env.Append(CCFLAGS = ['-Wno-unused-variable', '-Wno-unused-parameter', '-Wno-unused-but-set-variable', '-Wno-unused-local-typedef', '-Wno-unused-local-typedefs', '-O2'], CPPDEFINES = [f'{config["PREPROCESSOR_PREFIX"]}_RELEASE', 'NDEBUG'])
if enable_asan:
env.Append(CCFLAGS = ['-fsanitize=address', '-fno-omit-frame-pointer'])

View File

@ -5,5 +5,6 @@ from SCons.Script import *
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)
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
View 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']
}

View 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')]
}