2023-09-27 06:26:50 +02:00
|
|
|
# vim: set sts=2 ts=8 sw=2 tw=99 et ft=python:
|
|
|
|
import os
|
|
|
|
|
|
|
|
# Here only one sdk should be available to generate only one executable in the end,
|
|
|
|
# as multi-sdk loading isn't supported out of the box by metamod, and would require specifying the full path in the vdf
|
|
|
|
# which in the end would ruin the multi-platform (unix, win etc) loading by metamod as it won't be able to append platform specific extension
|
|
|
|
# so just fall back to the single binary.
|
|
|
|
# Multi-sdk solutions should be manually loaded with a custom plugin loader (examples being sourcemod, stripper:source)
|
2023-11-12 19:08:12 +01:00
|
|
|
for sdk_target in MMSPlugin.sdk_targets:
|
|
|
|
sdk = sdk_target.sdk
|
|
|
|
cxx = sdk_target.cxx
|
|
|
|
|
|
|
|
binary = MMSPlugin.HL2Library(builder, cxx, MMSPlugin.plugin_name, sdk)
|
|
|
|
|
|
|
|
binary.sources += [
|
2023-11-14 01:51:54 +01:00
|
|
|
'sample_mm.cpp',
|
2023-11-12 19:08:12 +01:00
|
|
|
]
|
|
|
|
|
2023-11-14 01:51:54 +01:00
|
|
|
binary.custom = [builder.tools.Protoc(protoc = sdk_target.protoc, sources = [
|
2023-11-12 19:08:12 +01:00
|
|
|
os.path.join(sdk['path'], 'common', 'network_connection.proto'),
|
2023-11-14 01:51:54 +01:00
|
|
|
])]
|
2023-11-12 19:08:12 +01:00
|
|
|
|
|
|
|
nodes = builder.Add(binary)
|
|
|
|
MMSPlugin.binaries += [nodes]
|