2
0
mirror of https://github.com/FWGS/hlsdk-xash3d synced 2024-11-25 03:09:24 +01:00
hlsdk-xash3d/cl_dll/wscript

125 lines
3.4 KiB
Plaintext
Raw Normal View History

2019-05-03 18:19:39 +02:00
#! /usr/bin/env python
# encoding: utf-8
# a1batross, mittorn, 2018
from waflib import Utils
import os
2019-05-03 18:19:39 +02:00
def options(opt):
grp = opt.add_option_group('Client options')
2019-05-03 18:19:39 +02:00
grp.add_option('--enable-vgui', action = 'store_true', dest = 'USE_VGUI', default = False,
help = 'Enable VGUI1')
grp.add_option('--enable-novgui-motd', action = 'store_true', dest = 'USE_NOVGUI_MOTD', default = False,
help = 'Prefer non-VGUI MOTD when USE_VGUI is enabled')
grp.add_option('--enable-novgui-scoreboard', action = 'store_true', dest = 'USE_NOVGUI_SCOREBOARD', default = False,
help = 'Prefer non-VGUI Scoreboard when USE_VGUI is enabled')
grp.add_option('--disable-goldsrc-support', action = 'store_false', dest = 'GOLDSOURCE_SUPPORT',
default=True, help = 'disable GoldSource compatibility on i386 Win/Mac/Linux')
2019-05-03 18:19:39 +02:00
opt.load('vgui')
def configure(conf):
conf.env.USE_VGUI = conf.options.USE_VGUI
conf.env.USE_NOVGUI_MOTD = conf.options.USE_NOVGUI_MOTD
conf.env.USE_NOVGUI_SCOREBOARD = conf.options.USE_NOVGUI_SCOREBOARD
conf.env.USE_VOICEMGR = conf.options.USE_VOICEMGR
if (conf.env.DEST_CPU == 'x86' or (conf.env.DEST_CPU == 'x86_64' and not conf.options.ALLOW64)) and conf.env.DEST_OS in ['win32', 'linux', 'darwin']:
conf.env.GOLDSOURCE_SUPPORT = conf.options.GOLDSOURCE_SUPPORT
else:
conf.env.GOLDSOURCE_SUPPORT = False
if conf.env.GOLDSOURCE_SUPPORT and not conf.env.DEST_OS == 'win32':
conf.check_cc(lib='dl')
if conf.env.USE_VGUI:
conf.load('vgui')
if not conf.check_vgui():
conf.fatal('VGUI was enabled but VGUI cannot be used')
2019-05-03 18:19:39 +02:00
def build(bld):
libs = []
defines = ['CLIENT_DLL']
includes = ['.',
'../dlls',
'../common',
'../engine',
'../pm_shared',
'../game_shared',
'../public']
excluded_files = ['GameStudioModelRenderer_Sample.cpp',
'game_shared/voice_vgui_tweakdlg.cpp',
'game_shared/voice_gamemgr.cpp',
'game_shared/voice_status.cpp']
if bld.env.USE_VGUI:
defines += ['USE_VGUI']
libs += ['VGUI']
if bld.env.USE_NOVGUI_MOTD:
defines += ['USE_NOVGUI_MOTD']
else:
excluded_files += ['MOTD.cpp']
if bld.env.USE_NOVGUI_SCOREBOARD:
defines += ['USE_NOVGUI_SCOREBOARD']
else:
excluded_files += ['scoreboard.cpp']
else:
includes += ['../utils/fake_vgui/include']
excluded_files += ['voice_status.cpp',
'vgui_*.cpp',
'game_shared/vgui_*.cpp',
'game_shared/voice_banmgr.cpp']
source = bld.path.ant_glob('**/*.cpp', excl=excluded_files)
source += bld.path.parent.ant_glob('game_shared/*.cpp', excl=excluded_files)
2020-08-02 17:23:29 +02:00
source += bld.path.parent.ant_glob([
'pm_shared/*.c',
2020-08-01 17:26:28 +02:00
'dlls/crossbow.cpp',
'dlls/crowbar.cpp',
'dlls/egon.cpp',
'dlls/gauss.cpp',
'dlls/glock.cpp',
'dlls/handgrenade.cpp',
'dlls/hornetgun.cpp',
'dlls/mp5.cpp',
'dlls/python.cpp',
'dlls/rpg.cpp',
'dlls/satchel.cpp',
'dlls/shotgun.cpp',
'dlls/squeakgrenade.cpp',
'dlls/tripmine.cpp'
2019-05-03 18:19:39 +02:00
])
2019-05-06 03:13:09 +02:00
if bld.env.DEST_OS == 'win32':
libs += ['USER32']
if bld.env.GOLDSOURCE_SUPPORT:
defines += ['GOLDSOURCE_SUPPORT']
if bld.env.DEST_OS == 'win32':
libs += ["WINMM"]
else:
libs += ['DL']
if bld.env.DEST_OS not in ['android', 'dos']:
install_path = os.path.join(bld.env.GAMEDIR, bld.env.CLIENT_INSTALL_DIR)
2019-05-06 03:13:09 +02:00
else:
install_path = bld.env.PREFIX
2019-05-03 18:19:39 +02:00
bld.shlib(
source = source,
2019-11-11 02:07:51 +01:00
target = 'client' + bld.env.POSTFIX,
name = 'client',
2019-05-03 18:19:39 +02:00
features = 'c cxx',
includes = includes,
defines = defines,
use = libs,
2019-05-06 03:13:09 +02:00
install_path = install_path,
2019-05-03 18:19:39 +02:00
subsystem = bld.env.MSVC_SUBSYSTEM,
idx = bld.get_taskgen_count()
2019-05-03 18:19:39 +02:00
)
2020-08-09 00:29:46 +02:00