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-10-30 10:28:15 +01:00
|
|
|
|
2019-05-03 18:19:39 +02:00
|
|
|
def options(opt):
|
2023-04-17 04:23:52 +02:00
|
|
|
grp = opt.add_option_group('Client options')
|
2019-05-03 18:19:39 +02:00
|
|
|
|
2023-04-17 04:23:52 +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',
|
2024-03-28 08:52:29 +01:00
|
|
|
default=True, help = 'disable GoldSource compatibility on i386 Win/Mac/Linux')
|
2019-05-03 18:19:39 +02:00
|
|
|
|
2023-04-17 04:23:52 +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
|
2024-03-28 08:52:29 +01:00
|
|
|
|
|
|
|
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
|
2024-03-10 22:53:44 +01:00
|
|
|
|
2024-04-04 13:15:19 +02:00
|
|
|
if conf.env.GOLDSOURCE_SUPPORT and not conf.env.DEST_OS == 'win32':
|
2024-03-10 22:53:44 +01:00
|
|
|
conf.check_cc(lib='dl')
|
|
|
|
|
2023-04-17 04:23:52 +02:00
|
|
|
if conf.env.USE_VGUI:
|
|
|
|
conf.load('vgui')
|
|
|
|
if not conf.check_vgui():
|
|
|
|
conf.fatal('VGUI was enabled but VGUI cannot be used')
|
2020-09-13 11:58:45 +02:00
|
|
|
|
2019-05-03 18:19:39 +02:00
|
|
|
def build(bld):
|
2023-04-17 04:23:52 +02:00
|
|
|
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']
|
2024-03-10 22:53:44 +01:00
|
|
|
|
2023-04-17 04:23:52 +02:00
|
|
|
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']
|
2024-03-10 22:53:44 +01:00
|
|
|
|
2023-04-17 04:23:52 +02:00
|
|
|
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([
|
2023-04-17 04:23:52 +02:00
|
|
|
'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
|
|
|
|
|
|
|
|
2019-10-30 10:28:15 +01:00
|
|
|
if bld.env.DEST_OS == 'win32':
|
2023-04-17 04:23:52 +02:00
|
|
|
libs += ['USER32']
|
|
|
|
|
|
|
|
if bld.env.GOLDSOURCE_SUPPORT:
|
|
|
|
defines += ['GOLDSOURCE_SUPPORT']
|
2019-10-30 10:28:15 +01:00
|
|
|
|
2020-09-13 11:58:45 +02:00
|
|
|
if bld.env.DEST_OS == 'win32':
|
|
|
|
libs += ["WINMM"]
|
|
|
|
else:
|
|
|
|
libs += ['DL']
|
|
|
|
|
2020-02-12 09:40:06 +01:00
|
|
|
if bld.env.DEST_OS not in ['android', 'dos']:
|
2023-04-17 04:23:52 +02:00
|
|
|
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,
|
2020-02-12 09:40:06 +01:00
|
|
|
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,
|
2023-04-17 04:23:52 +02:00
|
|
|
idx = bld.get_taskgen_count()
|
2019-05-03 18:19:39 +02:00
|
|
|
)
|
2020-08-09 00:29:46 +02:00
|
|
|
|