Skip to content

Commit

Permalink
Install waf build system
Browse files Browse the repository at this point in the history
  • Loading branch information
a1batross committed May 22, 2024
1 parent 787fa20 commit bedb56c
Show file tree
Hide file tree
Showing 11 changed files with 1,900 additions and 0 deletions.
47 changes: 47 additions & 0 deletions cl_dll/wscript
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
#! /usr/bin/env python
# encoding: utf-8
# a1batross, mittorn, 2018

from waflib import Utils
import os

def options(opt):
pass

def configure(conf):
if conf.env.DEST_OS != 'win32':
conf.check(lib='dl')

def build(bld):
libs = ['DL']
defines = ['CLIENT_DLL']
includes = ['.',
'../dlls',
'../common',
'../engine',
'../pm_shared',
'../game_shared',
'../public']

source = bld.path.ant_glob('**/*.cpp')
source += bld.path.parent.ant_glob('game_shared/*.cpp')
source += bld.path.parent.ant_glob('pm_shared/*.c')

if bld.env.DEST_OS not in ['android', 'dos']:
install_path = os.path.join(bld.env.GAMEDIR, bld.env.CLIENT_INSTALL_DIR)
else:
install_path = bld.env.PREFIX

bld.shlib(
source = source,
target = 'client' + bld.env.POSTFIX,
name = 'client',
features = 'c cxx',
includes = includes,
defines = defines,
use = libs,
install_path = install_path,
subsystem = bld.env.MSVC_SUBSYSTEM,
idx = bld.get_taskgen_count()
)

53 changes: 53 additions & 0 deletions dlls/wscript
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
#! /usr/bin/env python
# encoding: utf-8
# a1batross, mittorn, 2018

from waflib import Utils
import os

def options(opt):
return

def configure(conf):
if conf.env.COMPILER_CC == 'msvc':
# progs.def removes MSVC function name decoration from GiveFnptrsToDll on Windows.
# Without this, the lookup for this function fails.
hlDefNode = conf.path.find_resource("./progs.def")

if hlDefNode is not None:
conf.env.append_value('LINKFLAGS', '/def:%s' % hlDefNode.abspath())
else:
conf.fatal("Could not find progs.def")

def build(bld):
source = bld.path.ant_glob('**/*.cpp')
source += bld.path.parent.ant_glob('pm_shared/*.c')
source += bld.path.parent.ant_glob('game_shared/*.cpp')

includes = [
'.',
'../common',
'../engine',
'../pm_shared',
'../game_shared',
'../public'
]
defines = []

if bld.env.DEST_OS not in ['android', 'dos']:
install_path = os.path.join(bld.env.GAMEDIR, bld.env.SERVER_INSTALL_DIR)
else:
install_path = bld.env.PREFIX

bld.shlib(
source = source,
target = bld.env.SERVER_LIBRARY_NAME + bld.env.POSTFIX,
name = 'server',
features = 'c cxx',
includes = includes,
defines = defines,
install_path = install_path,
subsystem = bld.env.MSVC_SUBSYSTEM,
idx = bld.get_taskgen_count()
)

44 changes: 44 additions & 0 deletions mainui/wscript
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
#! /usr/bin/env python
# encoding: utf-8
# a1batross, mittorn, 2018

from waflib import Utils
import os

def options(opt):
return

def configure(conf):
return

def build(bld):
source = bld.path.ant_glob('**/*.cpp')

includes = [
'.',
'../common',
'../engine',
'../pm_shared',
'../game_shared',
'../public',
'../dlls'
]
defines = []

if bld.env.DEST_OS not in ['android', 'dos']:
install_path = os.path.join(bld.env.GAMEDIR, bld.env.SERVER_INSTALL_DIR)
else:
install_path = bld.env.PREFIX

bld.shlib(
source = source,
target = 'menu' + bld.env.POSTFIX,
name = 'menu',
features = 'c cxx',
includes = includes,
defines = defines,
install_path = install_path,
subsystem = bld.env.MSVC_SUBSYSTEM,
idx = bld.get_taskgen_count()
)

4 changes: 4 additions & 0 deletions mod_options.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
GAMEDIR=ID1 # Gamedir path
SERVER_INSTALL_DIR=bin # Where put server dll
CLIENT_INSTALL_DIR=bin # Where put client dll
SERVER_LIBRARY_NAME=progs # Library name for PC platforms
Loading

0 comments on commit bedb56c

Please sign in to comment.