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 = 'server'
|
|
|
|
|
2021-11-16 20:46:29 +00:00
|
|
|
games = {
|
|
|
|
'hl2': ['server_base.vpc', 'server_hl2.vpc'],
|
|
|
|
'episodic':['server_base.vpc', 'server_episodic.vpc'],
|
|
|
|
'hl2mp': ['server_base.vpc', 'server_hl2mp.vpc'],
|
|
|
|
'portal': ['server_base.vpc', 'server_portal.vpc'],
|
|
|
|
'hl1': ['server_base.vpc', 'server_hl1.vpc'],
|
|
|
|
'hl1mp': ['server_base.vpc', 'server_hl1.vpc'],
|
|
|
|
'css': ['server_base.vpc', 'server_cstrike.vpc', 'nav_mesh.vpc'],
|
|
|
|
'dod': ['server_base.vpc', 'server_dod.vpc'],
|
|
|
|
'tf': [
|
|
|
|
'server_base.vpc',
|
|
|
|
'server_econ_base.vpc',
|
|
|
|
'tf/tf_gcmessages_include.vpc',
|
|
|
|
'nav_mesh.vpc',
|
|
|
|
'server_tf.vpc'
|
|
|
|
]
|
|
|
|
}
|
|
|
|
|
2021-04-06 19:31:58 +00:00
|
|
|
def options(opt):
|
|
|
|
return
|
|
|
|
|
|
|
|
def configure(conf):
|
2021-11-16 20:46:29 +00:00
|
|
|
game = conf.options.GAMES
|
|
|
|
conf.env.GAMES = game
|
|
|
|
|
|
|
|
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 = [
|
|
|
|
'.',
|
|
|
|
'../shared',
|
|
|
|
'../../utils/common',
|
|
|
|
'../shared/econ',
|
|
|
|
'NextBot',
|
|
|
|
'../../common',
|
|
|
|
'../../public/tier0',
|
|
|
|
'../../public/tier1',
|
|
|
|
'../../public'
|
|
|
|
]
|
|
|
|
|
|
|
|
defines = []
|
|
|
|
|
|
|
|
libs = ['tier0','particles','dmxloader','tier1','tier2','tier3','mathlib','vstdlib','choreoobjects','steam_api']
|
|
|
|
|
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
|
|
|
|
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,
|
2021-04-06 20:22:52 +00:00
|
|
|
install_path = install_path,
|
2021-04-06 19:31:58 +00:00
|
|
|
use = libs,
|
|
|
|
subsystem = bld.env.MSVC_SUBSYSTEM,
|
|
|
|
idx = bld.get_taskgen_count()
|
|
|
|
)
|
|
|
|
|