2021-04-06 19:31:58 +00:00
|
|
|
#! /usr/bin/env python
|
|
|
|
# encoding: utf-8
|
|
|
|
|
|
|
|
from waflib import Utils
|
|
|
|
import os
|
2021-11-16 20:46:29 +00:00
|
|
|
import vpc_parser
|
2021-04-06 19:31:58 +00:00
|
|
|
|
|
|
|
top = '.'
|
|
|
|
PROJECT_NAME = 'client'
|
|
|
|
|
|
|
|
def options(opt):
|
|
|
|
return
|
|
|
|
|
2021-11-16 20:46:29 +00:00
|
|
|
games = {
|
|
|
|
'hl2': ['client_base.vpc', 'client_hl2.vpc'],
|
|
|
|
'hl2mp': ['client_base.vpc', 'client_hl2mp.vpc'],
|
|
|
|
'hl1': ['client_base.vpc', 'client_hl1.vpc'],
|
2022-04-16 09:58:59 +00:00
|
|
|
'episodic': ['client_base.vpc', 'client_episodic.vpc'],
|
2021-11-16 20:46:29 +00:00
|
|
|
'portal': ['client_base.vpc', 'client_portal.vpc'],
|
2022-05-15 18:09:59 +00:00
|
|
|
'hl1mp': ['client_base.vpc', 'client_hl1mp.vpc'],
|
2022-02-12 10:45:43 +00:00
|
|
|
'cstrike': ['client_base.vpc', 'client_cstrike.vpc'],
|
2021-11-16 20:46:29 +00:00
|
|
|
'dod': ['client_base.vpc', 'client_dod.vpc']
|
|
|
|
}
|
|
|
|
|
2021-04-06 19:31:58 +00:00
|
|
|
def configure(conf):
|
2021-11-16 20:46:29 +00:00
|
|
|
game = conf.options.GAMES
|
|
|
|
conf.env.GAMES = game
|
|
|
|
|
2022-04-16 09:58:59 +00:00
|
|
|
conf.env.append_unique('DEFINES', ['DISABLE_STEAM=1'])
|
|
|
|
|
2021-11-16 20:46:29 +00:00
|
|
|
if game not in games.keys():
|
|
|
|
conf.fatal("Couldn't find game: ", game)
|
2021-04-06 19:31:58 +00:00
|
|
|
|
|
|
|
def build(bld):
|
2021-11-16 20:46:29 +00:00
|
|
|
game = vpc_parser.parse_vpcs( bld.env, games[bld.env.GAMES], '../..' )
|
2021-04-06 19:31:58 +00:00
|
|
|
|
|
|
|
includes = [
|
|
|
|
'.',
|
|
|
|
'game_controls',
|
|
|
|
'../../common',
|
|
|
|
'../../public',
|
|
|
|
'../../public/tier0',
|
|
|
|
'../../public/tier1',
|
|
|
|
'../../vgui2/include',
|
|
|
|
'../../vgui2/controls',
|
|
|
|
'../shared'
|
|
|
|
]
|
|
|
|
|
|
|
|
libs = [
|
|
|
|
'tier0',
|
|
|
|
'particles',
|
|
|
|
'dmxloader',
|
|
|
|
'vgui_controls',
|
|
|
|
'matsys_controls',
|
|
|
|
'tier1',
|
|
|
|
'tier2',
|
|
|
|
'tier3',
|
|
|
|
'mathlib',
|
|
|
|
'vstdlib',
|
|
|
|
'choreoobjects',
|
|
|
|
'steam_api',
|
|
|
|
'bitmap',
|
|
|
|
'vtf',
|
2021-11-16 20:46:29 +00:00
|
|
|
'RT',
|
|
|
|
'ZLIB'
|
2021-04-06 19:31:58 +00:00
|
|
|
]
|
|
|
|
|
2021-09-02 17:33:03 +00:00
|
|
|
install_path = bld.env.PREFIX
|
|
|
|
if bld.env.DEST_OS != 'android':
|
2022-01-09 16:58:08 +00:00
|
|
|
install_path += '/'+bld.env.GAMES+'/bin'
|
2021-04-06 19:31:58 +00:00
|
|
|
|
2022-04-16 09:58:59 +00:00
|
|
|
source = [ 'touch.cpp', 'in_touch.cpp' ]
|
2022-03-19 12:40:11 +00:00
|
|
|
if bld.env.DEST_OS == 'win32':
|
|
|
|
source += [ '../../public/tier0/memoverride.cpp' ]
|
|
|
|
libs += ['USER32']
|
2021-11-16 20:46:29 +00:00
|
|
|
|
|
|
|
source += game["sources"]
|
|
|
|
includes += game["includes"]
|
|
|
|
defines = game["defines"]
|
|
|
|
|
|
|
|
defines.remove('PROTECTED_THINGS_ENABLE')
|
|
|
|
|
2021-04-06 19:31:58 +00:00
|
|
|
bld.shlib(
|
|
|
|
source = source,
|
|
|
|
target = PROJECT_NAME,
|
|
|
|
name = PROJECT_NAME,
|
|
|
|
features = 'c cxx',
|
|
|
|
includes = includes,
|
|
|
|
defines = defines,
|
|
|
|
use = libs,
|
|
|
|
install_path = install_path,
|
|
|
|
subsystem = bld.env.MSVC_SUBSYSTEM,
|
|
|
|
idx = bld.get_taskgen_count()
|
|
|
|
)
|
|
|
|
|