|
@@ -9,6 +9,18 @@ sourceFiles = [
|
|
|
'natives.cpp',
|
|
|
]
|
|
|
|
|
|
+pluginFiles = [
|
|
|
+ 'tf_econ_dynamic_compat.sp'
|
|
|
+]
|
|
|
+
|
|
|
+spcomp_argv = [
|
|
|
+ Extension.spcomp_bin,
|
|
|
+ '-i' + os.path.relpath(os.path.join(builder.sourcePath, 'scripting', 'include'),
|
|
|
+ os.path.join(builder.buildPath, builder.buildFolder)),
|
|
|
+ '-h',
|
|
|
+ '-E',
|
|
|
+]
|
|
|
+
|
|
|
###############
|
|
|
# Make sure to edit PackageScript, which copies your files to their appropriate locations
|
|
|
# Simple extensions do not need to modify past this point.
|
|
@@ -29,4 +41,30 @@ for sdk_name in Extension.sdks:
|
|
|
|
|
|
binary = Extension.HL2Config(project, projectName + '.ext.' + sdk.ext, sdk)
|
|
|
|
|
|
+def build_plugin(script_path, smx_file):
|
|
|
+ inputs = [
|
|
|
+ Extension.spcomp_bin,
|
|
|
+ script_path,
|
|
|
+ ]
|
|
|
+ outputs = [
|
|
|
+ smx_file
|
|
|
+ ]
|
|
|
+ argv = spcomp_argv + [script_path]
|
|
|
+ result = builder.AddCommand(
|
|
|
+ inputs = inputs,
|
|
|
+ argv = argv,
|
|
|
+ outputs = outputs,
|
|
|
+ dep_type = 'msvc',
|
|
|
+ )
|
|
|
+
|
|
|
+ # ???
|
|
|
+ (smx_command, smx_outputs) = result
|
|
|
+ out, *_ = smx_outputs
|
|
|
+ Extension.plugins[smx_file] = out
|
|
|
+
|
|
|
+for script_file in pluginFiles:
|
|
|
+ script_path = os.path.join(builder.currentSourcePath, 'scripting', script_file)
|
|
|
+ smx_file = os.path.splitext(script_file)[0] + '.smx'
|
|
|
+ build_plugin(script_path, smx_file)
|
|
|
+
|
|
|
Extension.extensions = builder.Add(project)
|