Skip to content

Commit

Permalink
wscript: re-route vgui-dev to current folder submodule, cleanup unuse…
Browse files Browse the repository at this point in the history
…d code
  • Loading branch information
a1batross committed Jun 12, 2022
1 parent 444e142 commit 2c17fff
Showing 1 changed file with 10 additions and 11 deletions.
21 changes: 10 additions & 11 deletions wscript
Original file line number Diff line number Diff line change
Expand Up @@ -11,13 +11,16 @@ VGUI_SUPPORTED_OS = ['win32', 'darwin', 'linux']

def options(opt):
grp = opt.add_option_group('VGUI options')
grp.add_option('--vgui', action = 'store', dest = 'VGUI_DEV', default='vgui-dev',

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]')

grp.add_option('--disable-vgui', action = 'store_true', dest = 'NO_VGUI', default = False,
help = 'disable vgui_support [default: %default]')

grp.add_option('--skip-vgui-sanity-check', action = 'store_false', dest = 'VGUI_SANITY_CHECK', default=False,
grp.add_option('--skip-vgui-sanity-check', action = 'store_false', dest = 'VGUI_SANITY_CHECK', default=True,
help = 'skip checking VGUI sanity [default: %default]' )
return

Expand Down Expand Up @@ -58,26 +61,22 @@ def configure(conf):
if conf.env.NO_VGUI:
return

if conf.options.VGUI_DEV:
conf.start_msg('Configuring VGUI by provided path')
conf.env.VGUI_DEV = conf.options.VGUI_DEV
else:
conf.start_msg('Configuring VGUI by default path')
conf.env.VGUI_DEV = 'vgui-dev'
conf.start_msg('Configuring VGUI by provided path')
vgui_dev = conf.options.VGUI_DEV

if conf.env.DEST_OS == 'win32':
conf.env.LIB_VGUI = ['vgui']
conf.env.LIBPATH_VGUI = [os.path.abspath(os.path.join(conf.env.VGUI_DEV, 'lib/win32_vc6/'))]
conf.env.LIBPATH_VGUI = [os.path.abspath(os.path.join(vgui_dev, 'lib/win32_vc6/'))]
else:
libpath = os.path.abspath(os.path.join(conf.env.VGUI_DEV, 'lib'))
libpath = os.path.abspath(os.path.join(vgui_dev, 'lib'))
if conf.env.DEST_OS == 'linux':
conf.env.LIB_VGUI = [':vgui.so']
conf.env.LIBPATH_VGUI = [libpath]
elif conf.env.DEST_OS == 'darwin':
conf.env.LDFLAGS_VGUI = [os.path.join(libpath, 'vgui.dylib')]
else:
conf.fatal('vgui is not supported on this OS: ' + conf.env.DEST_OS)
conf.env.INCLUDES_VGUI = [os.path.abspath(os.path.join(conf.env.VGUI_DEV, 'include'))]
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))
Expand Down

0 comments on commit 2c17fff

Please sign in to comment.