Improve s2_sample_mm build script

Now it's possible to use run-time variables to compute the target paths/defines for includes/libs/defines
This commit is contained in:
GAMMACASE 2023-12-21 20:54:22 +03:00 committed by Nicholas Hastings
parent bc36e072a1
commit 6b8ae69227

View File

@ -1,17 +1,24 @@
# vim: set sts=2 ts=8 sw=2 tw=99 et ft=python: # vim: set sts=2 ts=8 sw=2 tw=99 et ft=python:
import os, sys import os, sys
additional_libs = [ # Edit the functions below for the extra functionality, the return should be
# a list of path's to wanted locations
def additional_libs(context, binary, sdk):
return [
# Path should be relative either to hl2sdk folder or to build folder # Path should be relative either to hl2sdk folder or to build folder
# 'path/to/lib/example.lib', # 'path/to/lib/example.lib',
] ]
additional_defines = [ def additional_defines(context, binary, sdk):
return [
# 'EXAMPLE_DEFINE=2' # 'EXAMPLE_DEFINE=2'
] ]
additional_includes = [ def additional_includes(context, binary, sdk):
return [
# Path should be absolute only! # Path should be absolute only!
# os.path.join(sdk['path'], 'game', 'server'),
# os.path.join(sdk['path'], 'public', 'entity2'),
# 'D:/absolute/path/to/include/folder/' # 'D:/absolute/path/to/include/folder/'
] ]
@ -286,9 +293,9 @@ class MMSPluginConfig(object):
SdkHelpers.configureCxx(context, binary, sdk) SdkHelpers.configureCxx(context, binary, sdk)
cxx.linkflags += additional_libs cxx.linkflags += additional_libs(context, binary, sdk)
cxx.defines += additional_defines cxx.defines += additional_defines(context, binary, sdk)
cxx.cxxincludes += additional_includes cxx.cxxincludes += additional_includes(context, binary, sdk)
return binary return binary