2
0
mirror of https://github.com/FWGS/xash3d-fwgs synced 2024-12-18 06:51:16 +01:00

wscript: try to automatically set console subsystem flag depending on target features

Remove subsystem flag from shlibs and stlibs, it's only required for executables.
This commit is contained in:
Alibek Omarov 2024-11-27 15:34:49 +03:00
parent cb3f5a74a8
commit 0154ffa060
10 changed files with 14 additions and 18 deletions

View File

@ -29,6 +29,5 @@ def build(bld):
target = 'bzip2',
# use = 'bz_version.h',
includes = ['.', 'bzip2/'],
subsystem = bld.env.MSVC_SUBSYSTEM,
export_includes = ['bzip2/']
)

View File

@ -19,5 +19,4 @@ def build(bld):
includes = ['gl4es/src', 'gl4es/src/gl', 'gl4es/src/glx', 'gl4es/include'],
defines = ['NOX11', 'NO_GBM', 'NO_INIT_CONSTRUCTOR', 'DEFAULT_ES=2', 'NOEGL', 'NO_LOADER', 'STATICLIB'],
cflags = ['-w', '-fvisibility=hidden', '-std=gnu99'],
subsystem = bld.env.MSVC_SUBSYSTEM,
export_includes = '.')

View File

@ -64,6 +64,5 @@ def build(bld):
features = 'c',
includes = includes,
defines = defines,
subsystem = bld.env.MSVC_SUBSYSTEM,
export_includes = ['opus/include/']
)

View File

@ -273,6 +273,5 @@ def build(bld):
sce_sys = 'platform/psvita/sce_sys',
title_id = 'XASH10000',
app_name = 'xash3d-fwgs',
subsystem = bld.env.MSVC_SUBSYSTEM,
rpath = rpath,
)

View File

@ -24,8 +24,7 @@ def build(bld):
features = 'seq',
source = bld.path.ant_glob(['*.c', '*.cpp']),
use = libs,
install_path = bld.env.LIBDIR,
subsystem = bld.env.MSVC_SUBSYSTEM)
install_path = bld.env.LIBDIR)
if bld.env.TESTS:
# build in same module, so dynamic linking will work
@ -42,5 +41,4 @@ def build(bld):
target = 'test_%s' % i,
use = libs + ['DL'],
rpath = bld.env.DEFAULT_RPATH,
subsystem = bld.env.CONSOLE_SUBSYSTEM,
install_path = None)

View File

@ -117,8 +117,7 @@ def build(bld):
bld.stlib(source = bld.path.ant_glob('*.c'),
target = 'public',
use = 'sdk_includes werror',
subsystem = bld.env.MSVC_SUBSYSTEM)
use = 'sdk_includes werror')
if bld.env.TESTS:
if bld.env.VALIDATE_TARGET:
@ -127,7 +126,6 @@ def build(bld):
target = 'validate_target',
use = 'public',
defines = 'VALIDATE_TARGET="%s"' % bld.env.VALIDATE_TARGET,
subsystem = bld.env.CONSOLE_SUBSYSTEM,
install_path = None)
tests = {
@ -145,5 +143,4 @@ def build(bld):
source = tests[i],
target = 'test_%s' % i,
use = 'public',
subsystem = bld.env.CONSOLE_SUBSYSTEM,
install_path = None)

View File

@ -72,5 +72,4 @@ def build(bld):
includes = includes,
use = libs + v['libs'],
defines = v['defines'] + ['REF_DLL=1'],
install_path = bld.env.LIBDIR,
subsystem = bld.env.MSVC_SUBSYSTEM)
install_path = bld.env.LIBDIR)

View File

@ -14,6 +14,5 @@ def build(bld):
target = 'ref_null',
defines = 'REF_DLL',
use = 'engine_includes sdk_includes werror',
install_path = bld.env.LIBDIR,
subsystem = bld.env.MSVC_SUBSYSTEM
install_path = bld.env.LIBDIR
)

View File

@ -26,6 +26,5 @@ def build(bld):
includes = '.',
defines = 'REF_DLL=1',
use = libs,
install_path = bld.env.LIBDIR,
subsystem = bld.env.MSVC_SUBSYSTEM
install_path = bld.env.LIBDIR
)

10
wscript
View File

@ -23,6 +23,15 @@ def remove_implib_install(self):
if not getattr(self, 'install_path_implib', None):
self.install_path_implib = None
@TaskGen.feature('cprogram', 'cxxprogram')
@TaskGen.before_method('apply_flags_msvc')
def apply_subsystem_msvc(self):
if getattr(self, 'subsystem', None):
return # have custom subsystem
if 'test' in self.features:
self.subsystem = self.env.CONSOLE_SUBSYSTEM
class Subproject:
def __init__(self, name, fnFilter = None):
self.name = name
@ -208,7 +217,6 @@ def configure(conf):
conf.load('msvs msdev subproject clang_compilation_database strip_on_install waf_unit_test enforce_pic cmake force_32bit')
# Force XP compatibility, all build targets should add subsystem=bld.env.MSVC_SUBSYSTEM
if conf.env.MSVC_TARGETS[0] == 'amd64_x86' or conf.env.MSVC_TARGETS[0] == 'x86':
conf.env.MSVC_SUBSYSTEM = 'WINDOWS,5.01'
conf.env.CONSOLE_SUBSYSTEM = 'CONSOLE,5.01'