diff --git a/3rdparty/bzip2/wscript b/3rdparty/bzip2/wscript index a62a2c0f..4d5a785e 100644 --- a/3rdparty/bzip2/wscript +++ b/3rdparty/bzip2/wscript @@ -29,6 +29,5 @@ def build(bld): target = 'bzip2', # use = 'bz_version.h', includes = ['.', 'bzip2/'], - subsystem = bld.env.MSVC_SUBSYSTEM, export_includes = ['bzip2/'] ) diff --git a/3rdparty/gl4es/wscript b/3rdparty/gl4es/wscript index 4558a65b..8700d0eb 100644 --- a/3rdparty/gl4es/wscript +++ b/3rdparty/gl4es/wscript @@ -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 = '.') diff --git a/3rdparty/opus/wscript b/3rdparty/opus/wscript index 1b343d4d..211cb10b 100644 --- a/3rdparty/opus/wscript +++ b/3rdparty/opus/wscript @@ -64,6 +64,5 @@ def build(bld): features = 'c', includes = includes, defines = defines, - subsystem = bld.env.MSVC_SUBSYSTEM, export_includes = ['opus/include/'] ) diff --git a/engine/wscript b/engine/wscript index c31af6ba..9ef95223 100644 --- a/engine/wscript +++ b/engine/wscript @@ -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, ) diff --git a/filesystem/wscript b/filesystem/wscript index d780ee9b..1403e922 100644 --- a/filesystem/wscript +++ b/filesystem/wscript @@ -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) diff --git a/public/wscript b/public/wscript index 953f007c..ec87cb88 100644 --- a/public/wscript +++ b/public/wscript @@ -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) diff --git a/ref/gl/wscript b/ref/gl/wscript index 062830d3..0f7cc81b 100644 --- a/ref/gl/wscript +++ b/ref/gl/wscript @@ -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) diff --git a/ref/null/wscript b/ref/null/wscript index 06c1f1d0..8de44e99 100644 --- a/ref/null/wscript +++ b/ref/null/wscript @@ -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 ) diff --git a/ref/soft/wscript b/ref/soft/wscript index aa7b1374..95e37ec6 100644 --- a/ref/soft/wscript +++ b/ref/soft/wscript @@ -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 ) diff --git a/wscript b/wscript index f3794582..7bb5a716 100644 --- a/wscript +++ b/wscript @@ -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'