From 45d52fe24284d360378084af31090a8eb4bb3b7b Mon Sep 17 00:00:00 2001 From: Alibek Omarov Date: Tue, 4 Aug 2026 02:41:48 +0800 Subject: [PATCH] Remove all vgui limitation because we switch to freevgui here --- .gitmodules | 3 ++ 3rdparty/freevgui | 1 + 3rdparty/vgui_support | 2 +- scripts/waifulib/vgui.py | 97 ---------------------------------------- wscript | 1 + 5 files changed, 6 insertions(+), 98 deletions(-) create mode 160000 3rdparty/freevgui delete mode 100644 scripts/waifulib/vgui.py diff --git a/.gitmodules b/.gitmodules index 9ef46b93..b1f919c9 100644 --- a/.gitmodules +++ b/.gitmodules @@ -46,3 +46,6 @@ [submodule "3rdparty/mbedtls/mbedtls"] path = 3rdparty/mbedtls/mbedtls url = https://github.com/FWGS/mbedtls-releases.git +[submodule "3rdparty/freevgui"] + path = 3rdparty/freevgui + url = https://github.com/FWGS/freevgui.git diff --git a/3rdparty/freevgui b/3rdparty/freevgui new file mode 160000 index 00000000..8bf71dba --- /dev/null +++ b/3rdparty/freevgui @@ -0,0 +1 @@ +Subproject commit 8bf71dba02af27b47dd32c7260b755125d2e313e diff --git a/3rdparty/vgui_support b/3rdparty/vgui_support index d2aaec10..aa31f43b 160000 --- a/3rdparty/vgui_support +++ b/3rdparty/vgui_support @@ -1 +1 @@ -Subproject commit d2aaec107d70ffb45a167cfb33ecf849310aa330 +Subproject commit aa31f43b57984a06a974081ceec435b63cef80d7 diff --git a/scripts/waifulib/vgui.py b/scripts/waifulib/vgui.py deleted file mode 100644 index 5fd54191..00000000 --- a/scripts/waifulib/vgui.py +++ /dev/null @@ -1,97 +0,0 @@ -#! /usr/bin/env python -# encoding: utf-8 -# mittorn, 2018 - -from waflib.Configure import conf -from waflib import Logs -import os - -VGUI_SUPPORTED_OS = ['win32', 'darwin', 'linux'] - -VGUI_FRAGMENT = '''#include -int main() { return 0; }''' - -def options(opt): - grp = opt.add_option_group('VGUI options') - - vgui_dev_path = os.path.join(opt.path.path_from(opt.root), 'vgui-dev') - - grp.add_option('--vgui', action = 'store', dest = 'VGUI_DEV', default=vgui_dev_path, - help = 'path to vgui-dev repo [default: %(default)s]') - - grp.add_option('--enable-unsupported-vgui', action = 'store_true', dest = 'ENABLE_UNSUPPORTED_VGUI', default=False, - help = 'ignore all checks and allow link against anything [default: %(default)s]') - - grp.add_option('--skip-vgui-sanity-check', action = 'store_false', dest = 'VGUI_SANITY_CHECK', default=True, - help = 'skip checking VGUI sanity [default: %(default)s]' ) - return - -@conf -def check_vgui(conf): - if not conf.options.ENABLE_UNSUPPORTED_VGUI: - conf.start_msg('Does this architecture support VGUI?') - - if conf.env.DEST_CPU != 'x86': - conf.end_msg('no') - Logs.warn('vgui is not supported on this CPU: ' + str(conf.env.DEST_CPU)) - return False - else: conf.end_msg('yes') - - conf.start_msg('Does this OS support VGUI?') - if conf.env.DEST_OS not in VGUI_SUPPORTED_OS: - conf.end_msg('no') - Logs.warn('vgui is not supported on this OS: ' + str(conf.env.DEST_OS)) - return False - else: conf.end_msg('yes') - - conf.start_msg('Does this toolchain able to link VGUI?') - if conf.env.DEST_OS == 'win32' and conf.env.COMPILER_CXX != 'msvc': - conf.end_msg('no') - # we have ABI incompatibility ONLY on MinGW - Logs.warn('vgui can\'t be linked with MinGW') - return False - else: conf.end_msg('yes') - - conf.start_msg('Configuring VGUI by provided path') - vgui_dev = conf.options.VGUI_DEV - - libpath = os.path.abspath(os.path.join(vgui_dev, 'lib')) - - if conf.env.DEST_OS == 'win32': - conf.env.LIB_VGUI = ['vgui'] - libpath = os.path.join(libpath, 'win32_vc6') - if conf.env.DEST_CPU != 'x86': - # for 32-bit x86 it's expected to be under win32_vc6 - # for others, it's expected to be under win32_vc6 subdirectory matching CPU arch (x86_64 for 64-bit CPUs) - libpath = os.path.join(libpath, conf.env.DEST_CPU) - conf.env.LIBPATH_VGUI = [libpath] - elif conf.env.DEST_OS == 'linux': - conf.env.LIB_VGUI = [':vgui.so'] - if conf.env.DEST_CPU != 'x86': - libpath = os.path.join(libpath, conf.env.DEST_CPU) - conf.env.LIBPATH_VGUI = [libpath] - elif conf.env.DEST_OS == 'darwin': - if conf.env.DEST_CPU != 'x86': - conf.env.LDFLAGS_VGUI = [os.path.join(libpath, conf.env.DEST_CPU, 'vgui.dylib')] - else: - conf.env.LDFLAGS_VGUI = [os.path.join(libpath, 'vgui.dylib')] - else: - # TODO: figure out what to do here - conf.env.LIB_VGUI = ['vgui'] - conf.env.LIBPATH_VGUI = [os.path.join(libpath, conf.env.DEST_OS, conf.env.DEST_CPU)] - - conf.env.INCLUDES_VGUI = [os.path.abspath(os.path.join(vgui_dev, 'include'))] - - conf.env.HAVE_VGUI = 1 - conf.end_msg('yes: {0}, {1}, {2}'.format(conf.env.LIB_VGUI, conf.env.LIBPATH_VGUI, conf.env.INCLUDES_VGUI)) - - if conf.env.HAVE_VGUI and conf.options.VGUI_SANITY_CHECK: - try: - conf.check_cxx(fragment=VGUI_FRAGMENT, - msg = 'Checking for library VGUI sanity', - use = 'VGUI', - execute = False) - except conf.errors.ConfigurationError: - conf.fatal("Can't compile simple program. Check your path to vgui-dev repository.") - - return True diff --git a/wscript b/wscript index 552e2c75..a8d0aa89 100644 --- a/wscript +++ b/wscript @@ -127,6 +127,7 @@ SUBDIRS = [ Subproject('3rdparty/opusfile', lambda x: x.env.CLIENT and not x.env.HAVE_SYSTEM_OPUSFILE), Subproject('3rdparty/maintui', lambda x: x.env.CLIENT and x.env.TUI), Subproject('3rdparty/mainui', lambda x: x.env.CLIENT and x.env.DEST_OS != 'android'), + Subproject('3rdparty/freevgui', lambda x: x.env.CLIENT), Subproject('3rdparty/vgui_support', lambda x: x.env.CLIENT), Subproject('3rdparty/MultiEmulator',lambda x: x.env.CLIENT), # Subproject('3rdparty/freevgui', lambda x: x.env.CLIENT),