Introduced recipe repositories.
This commit is contained in:
14
SConscript
14
SConscript
@@ -55,8 +55,14 @@ def _find_recipe(env: Environment, recipe_name: str):
|
||||
return env['SPP_RECIPES'][recipe_name]
|
||||
import importlib.util
|
||||
source_file = None
|
||||
for folder in env['RECIPES_FOLDERS']:
|
||||
try_source_file = f'{folder.abspath}/{recipe_name}/recipe.py'
|
||||
|
||||
if not env['SPP_RECIPES_FOLDERS']:
|
||||
env.Error('No recipes repositories set. Add one using env.RecipeRepo(<name>, <url>, <branch>).')
|
||||
for folder in env['SPP_RECIPES_FOLDERS']:
|
||||
from SCons import Node
|
||||
if folder is Node:
|
||||
folder = folder.abspath
|
||||
try_source_file = f'{folder}/{recipe_name}/recipe.py'
|
||||
if os.path.exists(try_source_file):
|
||||
source_file = try_source_file
|
||||
break
|
||||
@@ -767,7 +773,7 @@ if 'TOOLS' in config:
|
||||
tools.extend(config['TOOLS'])
|
||||
|
||||
env = Environment(tools = tools, variables = vars, ENV = os.environ)
|
||||
env['RECIPES_FOLDERS'] = [Dir('recipes')]
|
||||
env['SPP_RECIPES_FOLDERS'] = []
|
||||
env['SYSTEM_CACHE_DIR'] = os.path.join(_find_system_cache_dir(), 'spp_cache')
|
||||
env['CLONE_DIR'] = os.path.join(env['SYSTEM_CACHE_DIR'], 'cloned')
|
||||
env['DOWNLOAD_DIR'] = os.path.join(env['SYSTEM_CACHE_DIR'], 'downloaded')
|
||||
@@ -889,7 +895,7 @@ elif unity_mode == 'stress': # compile everything in one single file to stress t
|
||||
|
||||
# setup compiler specific options
|
||||
if env['COMPILER_FAMILY'] == 'gcc' or env['COMPILER_FAMILY'] == 'clang':
|
||||
env.Append(CCFLAGS = ['-Wall', '-Wextra', '-Werror', '-Wstrict-aliasing', '-pedantic'])
|
||||
env.Append(CCFLAGS = ['-Wall', '-Wextra', '-Werror', '-Wstrict-aliasing', '-pedantic', '-fvisibility=hidden'])
|
||||
env.Append(CXXFLAGS = [f'-std={config["CXX_STANDARD"]}'])
|
||||
if env['CXX_NO_EXCEPTIONS']:
|
||||
env.Append(CXXFLAGS = [f'-fno-exceptions'])
|
||||
|
||||
Reference in New Issue
Block a user