2018-05-28 17:17:25 +02:00
|
|
|
#! /usr/bin/env python
|
|
|
|
# encoding: utf-8
|
|
|
|
# a1batross, mittorn, 2018
|
|
|
|
|
|
|
|
from waflib import Logs
|
|
|
|
import os
|
2018-12-13 06:03:51 +01:00
|
|
|
import sys
|
2018-05-28 17:17:25 +02:00
|
|
|
|
|
|
|
top = '.'
|
|
|
|
|
|
|
|
def options(opt):
|
2021-01-07 20:24:16 +01:00
|
|
|
grp = opt.add_option_group('Game launcher options')
|
|
|
|
|
|
|
|
grp.add_option('--disable-menu-changegame', action = 'store_true', dest = 'DISABLE_MENU_CHANGEGAME', default = False,
|
2024-05-25 03:58:28 +02:00
|
|
|
help = 'disable changing the game from the menu [default: %(default)s]')
|
2018-05-28 17:17:25 +02:00
|
|
|
|
|
|
|
def configure(conf):
|
2019-02-19 15:49:09 +01:00
|
|
|
if conf.env.DEST_OS == 'win32':
|
|
|
|
conf.load('winres')
|
2018-05-28 17:17:25 +02:00
|
|
|
|
2021-01-07 20:24:16 +01:00
|
|
|
conf.define_cond('XASH_DISABLE_MENU_CHANGEGAME', conf.options.DISABLE_MENU_CHANGEGAME)
|
|
|
|
|
2018-05-28 17:17:25 +02:00
|
|
|
def build(bld):
|
2022-09-10 21:14:50 +02:00
|
|
|
source = ['game.cpp']
|
|
|
|
|
2023-11-19 20:57:30 +01:00
|
|
|
if bld.env.DEST_OS == 'win32':
|
2018-06-14 19:34:51 +02:00
|
|
|
source += ['game.rc']
|
2018-05-28 17:17:25 +02:00
|
|
|
|
2023-11-19 20:57:30 +01:00
|
|
|
# Half-Life 25th anniversary update doesn't have server library explicitly linked to libm
|
|
|
|
if bld.env.DEST_OS == 'linux':
|
|
|
|
bld.env.LDFLAGS += ['-Wl,--no-as-needed', '-lm']
|
|
|
|
|
2022-09-10 21:14:50 +02:00
|
|
|
bld(source = source,
|
2018-05-28 17:17:25 +02:00
|
|
|
target = 'xash3d', # hl.exe
|
2019-07-12 17:13:03 +02:00
|
|
|
features = 'c cxx cxxprogram',
|
2024-01-30 13:04:57 +01:00
|
|
|
use = 'sdk_includes DL USER32 SHELL32 werror',
|
2023-06-01 03:56:30 +02:00
|
|
|
rpath = bld.env.DEFAULT_RPATH,
|
2018-10-24 19:12:32 +02:00
|
|
|
install_path = bld.env.BINDIR,
|
|
|
|
subsystem = bld.env.MSVC_SUBSYSTEM
|
2018-05-28 17:17:25 +02:00
|
|
|
)
|