Browse Source

vgui_support: wscript: refactor, use shared get_subproject_name, rename no-vgui to disable-vgui to follow automake-style convention, add vGUI library sanity check

pull/2/head
Alibek Omarov 6 years ago
parent
commit
9ce9fa8cb5
  1. 29
      vgui_support/wscript

29
vgui_support/wscript

@ -4,6 +4,7 @@
from waflib import Logs from waflib import Logs
import os import os
from fwgslib import get_subproject_name
top = '.' top = '.'
@ -11,10 +12,15 @@ def options(opt):
opt.add_option( opt.add_option(
'--vgui', action = 'store', type='string', dest = 'VGUI_DEV', '--vgui', action = 'store', type='string', dest = 'VGUI_DEV',
help = 'path to vgui-dev repo', default='' ) help = 'path to vgui-dev repo', default='' )
opt.add_option( opt.add_option(
'--no-vgui', action = 'store_true', dest = 'NO_VGUI', '--disable-vgui', action = 'store_true', dest = 'NO_VGUI',
help = 'disable vgui_support', default=False ) help = 'disable vgui_support', default=False )
opt.add_option(
'--skip-vgui-sanity-check', action = 'store_false', dest = 'VGUI_SANITY_CHECK',
help = 'Skip checking VGUI sanity', default=True )
# stub # stub
return return
@ -23,7 +29,7 @@ def configure(conf):
if conf.options.DEDICATED or conf.options.NO_VGUI: if conf.options.DEDICATED or conf.options.NO_VGUI:
return return
conf.start_msg('Checking for VGUI') conf.start_msg('Configuring VGUI by provided path')
if not conf.options.VGUI_DEV: if not conf.options.VGUI_DEV:
conf.end_msg('no') conf.end_msg('no')
@ -49,8 +55,23 @@ def configure(conf):
conf.env.HAVE_VGUI = 1 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)) conf.end_msg('yes: {0}, {1}, {2}'.format(conf.env.LIB_VGUI, conf.env.LIBPATH_VGUI, conf.env.INCLUDES_VGUI))
def get_subproject_name(ctx): if conf.env.HAVE_VGUI and conf.options.VGUI_SANITY_CHECK:
return os.path.basename(os.path.realpath(str(ctx.path))) try:
conf.check_cxx(
fragment='''
#include <VGUI.h>
#include <VGUI_App.h>
int main( int argc, char **argv )
{
vgui::App *app = vgui::App::getInstance();
app->main(argc, argv);
return 0;
}''',
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.")
def build(bld): def build(bld):
bld.load_envs() bld.load_envs()

Loading…
Cancel
Save