12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970 |
- # vim: set sts=2 ts=8 sw=2 tw=99 et ft=python:
- import os, sys
- projectName = 'tf2econdynamic'
- sourceFiles = [
- 'mmsplugin.cpp',
- 'econmanager.cpp',
- '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.
- project = Extension.HL2Project(builder, projectName + '.ext')
- if os.path.isfile(os.path.join(builder.currentSourcePath, 'sdk', 'smsdk_ext.cpp')):
- # Use the copy included in the project
- project.sources += [os.path.join('sdk', 'smsdk_ext.cpp')]
- else:
- # Use the copy included with SM 1.6 and newer
- project.sources += [os.path.join(Extension.sm_root, 'public', 'smsdk_ext.cpp')]
- project.sources += sourceFiles
-
- for sdk_name in Extension.sdks:
- sdk = Extension.sdks[sdk_name]
-
- 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)
|