Skip to content
This repository has been archived by the owner on May 4, 2022. It is now read-only.

Commit

Permalink
Merge pull request FWGS#106 from x6herbius/upstream-master
Browse files Browse the repository at this point in the history
Build: Fixed GiveFnptrsToDll not being found on Windows
  • Loading branch information
a1batross committed Oct 31, 2019
2 parents 71afe6e + 1bc65c1 commit 251a387
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 16 deletions.
19 changes: 13 additions & 6 deletions dlls/wscript
Original file line number Diff line number Diff line change
Expand Up @@ -4,21 +4,28 @@

from waflib import Utils
import os

def options(opt):
# stub
return

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

if hlDefNode is not None:
conf.env.append_unique('LINKFLAGS', f'/def:{hlDefNode.abspath()}')
else:
conf.fatal("Could not find hl.def")

def build(bld):
defines = []
source = bld.path.parent.ant_glob([
'pm_shared/*.c',
])

source += [
'agrunt.cpp', 'airtank.cpp', 'aflock.cpp', 'animating.cpp', 'animation.cpp', 'apache.cpp',
'barnacle.cpp', 'barney.cpp', 'bigmomma.cpp', 'bloater.cpp', 'bmodels.cpp', 'bullsquid.cpp', 'buttons.cpp',
Expand All @@ -42,7 +49,7 @@ def build(bld):
'triggers.cpp', 'tripmine.cpp', 'turret.cpp',
'util.cpp',
'weapons.cpp', 'world.cpp', 'xen.cpp', 'zombie.cpp']

if bld.env.VOICEMGR:
source += bld.path.parent.ant_glob([
'game_shared/voice_gamemgr.cpp',
Expand All @@ -61,7 +68,7 @@ def build(bld):

bld.shlib(
source = source,
target = 'server',
target = bld.env.SERVER_NAME,
features = 'c cxx',
includes = includes,
defines = defines,
Expand Down
19 changes: 9 additions & 10 deletions wscript
Original file line number Diff line number Diff line change
Expand Up @@ -33,21 +33,20 @@ def options(opt):

grp.add_option('--enable-goldsrc-support', action = 'store_true', dest = 'GOLDSRC', default = False,
help = 'enable GoldSource engine support [default: %default]')

grp.add_option('--enable-lto', action = 'store_true', dest = 'LTO', default = False,
help = 'enable Link Time Optimization [default: %default]')

grp.add_option('--enable-poly-opt', action = 'store_true', dest = 'POLLY', default = False,
help = 'enable polyhedral optimization if possible [default: %default]')


opt.recurse('cl_dll dlls')

opt.load('xcompile compiler_cxx compiler_c clang_compilation_database strip_on_install')

if sys.platform == 'win32':
opt.load('msvc msdev msvs')
opt.load('reconfigure')

opt.load('reconfigure subproject')
opt.add_subproject(["cl_dll", "dlls"])

def configure(conf):
# Configuration
Expand Down Expand Up @@ -220,10 +219,10 @@ def configure(conf):

conf.define('CLIENT_WEAPONS', '1')

conf.recurse('cl_dll dlls')
conf.add_subproject(["cl_dll", "dlls"])

def build(bld):
bld.recurse('cl_dll dlls')
bld.add_subproject(["cl_dll", "dlls"])



0 comments on commit 251a387

Please sign in to comment.