Remove use of the Dep API.
This is going away.
This commit is contained in:
parent
0bed34e0c7
commit
6e2c5a66b3
@ -506,7 +506,7 @@ class SMConfig(object):
|
|||||||
self.ConfigureForExtension(context, binary.compiler)
|
self.ConfigureForExtension(context, binary.compiler)
|
||||||
return binary
|
return binary
|
||||||
|
|
||||||
def ConfigureForHL2(self, binary, sdk):
|
def ConfigureForHL2(self, context, binary, sdk):
|
||||||
compiler = binary.compiler
|
compiler = binary.compiler
|
||||||
SetArchFlags(compiler)
|
SetArchFlags(compiler)
|
||||||
|
|
||||||
@ -594,20 +594,20 @@ class SMConfig(object):
|
|||||||
if compiler.target.platform in ['linux', 'mac']:
|
if compiler.target.platform in ['linux', 'mac']:
|
||||||
if sdk.name in ['sdk2013', 'bms'] or compiler.target.arch == 'x86_64':
|
if sdk.name in ['sdk2013', 'bms'] or compiler.target.arch == 'x86_64':
|
||||||
compiler.postlink += [
|
compiler.postlink += [
|
||||||
compiler.Dep(os.path.join(lib_folder, 'tier1.a')),
|
os.path.join(lib_folder, 'tier1.a'),
|
||||||
compiler.Dep(os.path.join(lib_folder, 'mathlib.a'))
|
os.path.join(lib_folder, 'mathlib.a')
|
||||||
]
|
]
|
||||||
else:
|
else:
|
||||||
compiler.postlink += [
|
compiler.postlink += [
|
||||||
compiler.Dep(os.path.join(lib_folder, 'tier1_i486.a')),
|
os.path.join(lib_folder, 'tier1_i486.a'),
|
||||||
compiler.Dep(os.path.join(lib_folder, 'mathlib_i486.a'))
|
os.path.join(lib_folder, 'mathlib_i486.a')
|
||||||
]
|
]
|
||||||
|
|
||||||
if sdk.name in ['blade', 'insurgency', 'doi', 'csgo']:
|
if sdk.name in ['blade', 'insurgency', 'doi', 'csgo']:
|
||||||
if compiler.target.arch == 'x86_64':
|
if compiler.target.arch == 'x86_64':
|
||||||
compiler.postlink += [compiler.Dep(os.path.join(lib_folder, 'interfaces.a'))]
|
compiler.postlink += [os.path.join(lib_folder, 'interfaces.a')]
|
||||||
else:
|
else:
|
||||||
compiler.postlink += [compiler.Dep(os.path.join(lib_folder, 'interfaces_i486.a'))]
|
compiler.postlink += [os.path.join(lib_folder, 'interfaces_i486.a')]
|
||||||
|
|
||||||
dynamic_libs = []
|
dynamic_libs = []
|
||||||
if compiler.target.platform == 'linux':
|
if compiler.target.platform == 'linux':
|
||||||
@ -631,39 +631,37 @@ class SMConfig(object):
|
|||||||
lib_path = os.path.join(sdk.path, 'lib', 'public', lib) + '.lib'
|
lib_path = os.path.join(sdk.path, 'lib', 'public', lib) + '.lib'
|
||||||
elif compiler.target.arch == 'x86_64':
|
elif compiler.target.arch == 'x86_64':
|
||||||
lib_path = os.path.join(sdk.path, 'lib', 'public', 'win64', lib) + '.lib'
|
lib_path = os.path.join(sdk.path, 'lib', 'public', 'win64', lib) + '.lib'
|
||||||
compiler.linkflags.append(compiler.Dep(lib_path))
|
compiler.linkflags.append(lib_path)
|
||||||
|
|
||||||
for library in dynamic_libs:
|
for library in dynamic_libs:
|
||||||
source_path = os.path.join(lib_folder, library)
|
source_path = os.path.join(lib_folder, library)
|
||||||
output_path = os.path.join(binary.localFolder, library)
|
output_path = os.path.join(binary.localFolder, library)
|
||||||
|
|
||||||
def make_linker(source_path, output_path):
|
# Ensure the output path exists.
|
||||||
def link(context, binary):
|
context.AddFolder(binary.localFolder)
|
||||||
cmd_node, (output,) = context.AddSymlink(source_path, output_path)
|
output = context.AddSymlink(source_path, output_path)
|
||||||
return output
|
|
||||||
return link
|
|
||||||
|
|
||||||
linker = make_linker(source_path, output_path)
|
compiler.weaklinkdeps += [output]
|
||||||
compiler.linkflags[0:0] = [compiler.Dep(library, linker)]
|
compiler.linkflags[0:0] = [library]
|
||||||
|
|
||||||
return binary
|
return binary
|
||||||
|
|
||||||
def HL2Library(self, context, compiler, name, sdk):
|
def HL2Library(self, context, compiler, name, sdk):
|
||||||
binary = self.Library(context, compiler, name)
|
binary = self.Library(context, compiler, name)
|
||||||
self.ConfigureForExtension(context, binary.compiler)
|
self.ConfigureForExtension(context, binary.compiler)
|
||||||
return self.ConfigureForHL2(binary, sdk)
|
return self.ConfigureForHL2(context, binary, sdk)
|
||||||
|
|
||||||
def HL2Config(self, project, compiler, name, sdk):
|
def HL2Config(self, project, context, compiler, name, sdk):
|
||||||
binary = project.Configure(compiler, name,
|
binary = project.Configure(compiler, name,
|
||||||
'{0} - {1} {2}'.format(self.tag, sdk.name, compiler.target.arch))
|
'{0} - {1} {2}'.format(self.tag, sdk.name, compiler.target.arch))
|
||||||
self.AddVersioning(binary)
|
self.AddVersioning(binary)
|
||||||
return self.ConfigureForHL2(binary, sdk)
|
return self.ConfigureForHL2(context, binary, sdk)
|
||||||
|
|
||||||
def HL2ExtConfig(self, project, context, compiler, name, sdk):
|
def HL2ExtConfig(self, project, context, compiler, name, sdk):
|
||||||
binary = project.Configure(compiler, name,
|
binary = project.Configure(compiler, name,
|
||||||
'{0} - {1} {2}'.format(self.tag, sdk.name, compiler.target.arch))
|
'{0} - {1} {2}'.format(self.tag, sdk.name, compiler.target.arch))
|
||||||
self.AddVersioning(binary)
|
self.AddVersioning(binary)
|
||||||
self.ConfigureForHL2(binary, sdk)
|
self.ConfigureForHL2(context, binary, sdk)
|
||||||
self.ConfigureForExtension(context, binary.compiler)
|
self.ConfigureForExtension(context, binary.compiler)
|
||||||
return binary
|
return binary
|
||||||
|
|
||||||
|
@ -51,7 +51,7 @@ for sdk_name in SM.sdks:
|
|||||||
|
|
||||||
binary_name = 'sourcemod.' + sdk.ext
|
binary_name = 'sourcemod.' + sdk.ext
|
||||||
|
|
||||||
binary = SM.HL2Config(project, cxx, binary_name, sdk)
|
binary = SM.HL2Config(project, builder, cxx, binary_name, sdk)
|
||||||
SM.ConfigureForExtension(builder, binary.compiler)
|
SM.ConfigureForExtension(builder, binary.compiler)
|
||||||
|
|
||||||
compiler = binary.compiler
|
compiler = binary.compiler
|
||||||
@ -103,7 +103,7 @@ for sdk_name in SM.sdks:
|
|||||||
lib_path = os.path.join(sdk.path, 'lib', 'win32', 'debug', 'vs' + vs_year, 'libprotobuf.lib')
|
lib_path = os.path.join(sdk.path, 'lib', 'win32', 'debug', 'vs' + vs_year, 'libprotobuf.lib')
|
||||||
else:
|
else:
|
||||||
lib_path = os.path.join(sdk.path, 'lib', 'win32', 'release', 'vs' + vs_year, 'libprotobuf.lib')
|
lib_path = os.path.join(sdk.path, 'lib', 'win32', 'release', 'vs' + vs_year, 'libprotobuf.lib')
|
||||||
compiler.linkflags.insert(0, binary.Dep(lib_path))
|
compiler.linkflags.insert(0, lib_path)
|
||||||
|
|
||||||
if sdk.name in ['csgo', 'blade']:
|
if sdk.name in ['csgo', 'blade']:
|
||||||
binary.sources += ['smn_protobuf.cpp']
|
binary.sources += ['smn_protobuf.cpp']
|
||||||
|
@ -27,7 +27,7 @@ for cxx in builder.targets:
|
|||||||
path = os.path.join(builder.sourcePath, 'extensions', 'regex', 'lib_darwin', 'libpcre.a')
|
path = os.path.join(builder.sourcePath, 'extensions', 'regex', 'lib_darwin', 'libpcre.a')
|
||||||
elif arch == 'x86_64':
|
elif arch == 'x86_64':
|
||||||
path = os.path.join(builder.sourcePath, 'extensions', 'regex', 'lib_darwin64', 'libpcre.a')
|
path = os.path.join(builder.sourcePath, 'extensions', 'regex', 'lib_darwin64', 'libpcre.a')
|
||||||
binary.compiler.postlink += [binary.Dep(path)]
|
binary.compiler.postlink += [path]
|
||||||
|
|
||||||
binary.sources += [
|
binary.sources += [
|
||||||
'extension.cpp',
|
'extension.cpp',
|
||||||
|
@ -47,7 +47,7 @@ def build_plugin(script_path, smx_file):
|
|||||||
smx_file
|
smx_file
|
||||||
]
|
]
|
||||||
argv = spcomp_argv + [script_path]
|
argv = spcomp_argv + [script_path]
|
||||||
cmd_entry, (smx_entry,) = builder.AddCommand(
|
(smx_entry,) = builder.AddCommand(
|
||||||
inputs = inputs,
|
inputs = inputs,
|
||||||
argv = argv,
|
argv = argv,
|
||||||
outputs = outputs,
|
outputs = outputs,
|
||||||
|
@ -36,7 +36,7 @@ sources = [
|
|||||||
# The script source is a dependency, of course...
|
# The script source is a dependency, of course...
|
||||||
argv[1]
|
argv[1]
|
||||||
]
|
]
|
||||||
cmd_node, output_nodes = builder.AddCommand(
|
output_nodes = builder.AddCommand(
|
||||||
inputs=sources,
|
inputs=sources,
|
||||||
argv=argv,
|
argv=argv,
|
||||||
outputs=outputs
|
outputs=outputs
|
||||||
|
Loading…
Reference in New Issue
Block a user