Added recipe for winsock2 and target_os to dependency conditions.
This commit is contained in:
13
SConscript
13
SConscript
@@ -126,7 +126,8 @@ def _deps_from_json(env: Environment, deps: dict) -> dict:
|
||||
for key, dep in deps.items():
|
||||
if 'condition' in dep:
|
||||
if not _safe_eval(dep['condition'], {
|
||||
'compiler_family': env['COMPILER_FAMILY']
|
||||
'compiler_family': env['COMPILER_FAMILY'],
|
||||
'target_os': os.name
|
||||
}):
|
||||
to_remove.append(key)
|
||||
continue
|
||||
@@ -340,7 +341,7 @@ def _build_target(target: _Target):
|
||||
for lib in libs_copy:
|
||||
if isinstance(lib, str) and os.path.isabs(lib):
|
||||
target.kwargs['LIBS'].remove(lib)
|
||||
target.kwargs['source'].append(lib)
|
||||
target.kwargs['source'].append(env.Entry(lib))
|
||||
elif isinstance(lib, _Target):
|
||||
if not lib.target:
|
||||
_build_target(lib)
|
||||
@@ -404,6 +405,9 @@ if not config.get('PREPROCESSOR_PREFIX'):
|
||||
if 'COMPILATIONDB_FILTER_FILES' not in config:
|
||||
config['COMPILATIONDB_FILTER_FILES'] = True
|
||||
|
||||
if 'WINDOWS_DISABLE_DEFAULT_DEFINES' not in config:
|
||||
config['WINDOWS_DISABLE_DEFAULT_DEFINES'] = False
|
||||
|
||||
AddOption(
|
||||
'--build_type',
|
||||
dest = 'build_type',
|
||||
@@ -687,6 +691,11 @@ if env['COMPILER_FAMILY'] == 'gcc':
|
||||
elif env['COMPILER_FAMILY'] == 'clang':
|
||||
env.Append(CCFLAGS = ['-Wno-deprecated-volatile', '-Wno-nested-anon-types', '-Wno-unknown-warning-option'])
|
||||
|
||||
# platform specific options
|
||||
if os.name == 'nt':
|
||||
if not config['WINDOWS_DISABLE_DEFAULT_DEFINES']:
|
||||
env.Append(CDEFINES = ['WIN32_LEAN_AND_MEAN', 'NOMINMAX', 'STRICT', 'UNICODE'], CPPDEFINES = ['WIN32_LEAN_AND_MEAN', 'NOMINMAX', 'STRICT', 'UNICODE'])
|
||||
|
||||
env.AddMethod(_cook, 'Cook')
|
||||
env.AddMethod(_parse_lib_conf, 'ParseLibConf')
|
||||
env.AddMethod(_rglob, 'RGlob')
|
||||
|
||||
Reference in New Issue
Block a user