Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Switch to a manifest-based build model. (#132)
Rather than hardcode a bunch of SDK stuff, this is an attempt to move SDK information to a declarative model. Each SDK gets a manifest, and the manifests are stored in a shared repository. Manifests encode stuff like "what platforms does this SDK build on" and "what link flags do I need on each architecture". This will hopefully reduce the complexity of the build scripts, since going forward we only have to add new manifests, rather than figure out how to attach more gunk into the build logic.
- Loading branch information
Showing
5 changed files
with
93 additions
and
220 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,6 @@ | ||
[submodule "third_party/amtl"] | ||
path = third_party/amtl | ||
url = https://github.com/alliedmodders/amtl | ||
[submodule "hl2sdk-manifests"] | ||
path = hl2sdk-manifests | ||
url = https://github.com/alliedmodders/hl2sdk-manifests |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,35 +1,29 @@ | ||
# vim: set sts=2 ts=8 sw=2 tw=99 et ft=python: | ||
import os | ||
|
||
for sdk_name in MMS.sdks: | ||
for cxx in MMS.all_targets: | ||
sdk = MMS.sdks[sdk_name] | ||
for sdk, cxx in MMS.sdk_targets: | ||
name = 'metamod.' + sdk['extension'] | ||
binary = MMS.HL2Library(builder, cxx, name, sdk) | ||
|
||
if not cxx.target.arch in sdk.platformSpec[cxx.target.platform]: | ||
continue | ||
binary.sources += [ | ||
'metamod.cpp', | ||
'metamod_console.cpp', | ||
'metamod_oslink.cpp', | ||
'metamod_plugins.cpp', | ||
'metamod_util.cpp', | ||
'provider/console.cpp', | ||
'provider/provider_ep2.cpp', | ||
'sourcehook/sourcehook.cpp', | ||
'sourcehook/sourcehook_impl_chookidman.cpp', | ||
'sourcehook/sourcehook_impl_chookmaninfo.cpp', | ||
'sourcehook/sourcehook_impl_cproto.cpp', | ||
'sourcehook/sourcehook_impl_cvfnptr.cpp', | ||
'gamedll_bridge.cpp', | ||
'vsp_bridge.cpp' | ||
] | ||
|
||
name = 'metamod.' + sdk.ext | ||
binary = MMS.HL2Library(builder, cxx, name, sdk) | ||
|
||
binary.sources += [ | ||
'metamod.cpp', | ||
'metamod_console.cpp', | ||
'metamod_oslink.cpp', | ||
'metamod_plugins.cpp', | ||
'metamod_util.cpp', | ||
'provider/console.cpp', | ||
'provider/provider_ep2.cpp', | ||
'sourcehook/sourcehook.cpp', | ||
'sourcehook/sourcehook_impl_chookidman.cpp', | ||
'sourcehook/sourcehook_impl_chookmaninfo.cpp', | ||
'sourcehook/sourcehook_impl_cproto.cpp', | ||
'sourcehook/sourcehook_impl_cvfnptr.cpp', | ||
'gamedll_bridge.cpp', | ||
'vsp_bridge.cpp' | ||
] | ||
|
||
# Source2 hack. TODO: check this more deterministically, "are we doing an x64 build?" | ||
if binary.compiler.target.arch == 'x86': | ||
binary.sources += ['sourcehook/sourcehook_hookmangen.cpp'] | ||
nodes = builder.Add(binary) | ||
MMS.binaries += [nodes] | ||
# Source2 hack. TODO: check this more deterministically, "are we doing an x64 build?" | ||
if binary.compiler.target.arch == 'x86': | ||
binary.sources += ['sourcehook/sourcehook_hookmangen.cpp'] | ||
nodes = builder.Add(binary) | ||
MMS.binaries += [nodes] |
Submodule hl2sdk-manifests
added at
4b11e3
Oops, something went wrong.