|
|
|
#! /usr/bin/env python
|
|
|
|
# encoding: utf-8
|
|
|
|
|
|
|
|
from waflib import Utils
|
|
|
|
import os
|
|
|
|
import vpc_parser
|
|
|
|
|
|
|
|
top = '.'
|
|
|
|
PROJECT_NAME = 'server'
|
|
|
|
|
|
|
|
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_hl1mp.vpc'],
|
|
|
|
'cstrike': ['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'
|
|
|
|
]
|
|
|
|
}
|
|
|
|
|
|
|
|
def options(opt):
|
|
|
|
return
|
|
|
|
|
|
|
|
def configure(conf):
|
|
|
|
game = conf.options.GAMES
|
|
|
|
conf.env.GAMES = game
|
|
|
|
|
|
|
|
conf.env.append_unique('DEFINES', ['DISABLE_STEAM=1'])
|
|
|
|
|
|
|
|
if game not in games.keys():
|
|
|
|
conf.fatal("Couldn't find game: ", game)
|
|
|
|
|
|
|
|
def build(bld):
|
|
|
|
game = vpc_parser.parse_vpcs( bld.env, games[bld.env.GAMES], '../..' )
|
|
|
|
|
|
|
|
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']
|
|
|
|
if bld.env.DEST_OS == 'win32':
|
|
|
|
libs += ['USER32']
|
|
|
|
|
|
|
|
install_path = bld.env.PREFIX
|
|
|
|
if bld.env.DEST_OS != 'android':
|
|
|
|
install_path += '/'+bld.env.GAMES+'/bin'
|
|
|
|
|
|
|
|
source = game["sources"]
|
|
|
|
includes += game["includes"]
|
|
|
|
defines = game["defines"]
|
|
|
|
|
|
|
|
if bld.env.DEST_OS == 'win32':
|
|
|
|
source += ['../../public/tier0/memoverride.cpp']
|
|
|
|
|
|
|
|
defines.remove('PROTECTED_THINGS_ENABLE')
|
|
|
|
|
|
|
|
bld.shlib(
|
|
|
|
source = source,
|
|
|
|
target = PROJECT_NAME,
|
|
|
|
name = PROJECT_NAME,
|
|
|
|
features = 'c cxx',
|
|
|
|
includes = includes,
|
|
|
|
defines = defines,
|
|
|
|
install_path = install_path,
|
|
|
|
use = libs,
|
|
|
|
subsystem = bld.env.MSVC_SUBSYSTEM,
|
|
|
|
idx = bld.get_taskgen_count()
|
|
|
|
)
|
|
|
|
|