mirror of
https://github.com/alliedmodders/sourcemod.git
synced 2025-12-07 02:18:35 +00:00
Copying No Longer Needed
Copying the HL2SDK manifest is no longer needed. Requires latest AMBuild.
This commit is contained in:
parent
399a90bcdc
commit
0b8b9ed72f
@ -1,5 +1,5 @@
|
|||||||
# vim: set sts=2 ts=8 sw=2 tw=99 et ft=python:
|
# vim: set sts=2 ts=8 sw=2 tw=99 et ft=python:
|
||||||
import os, shutil
|
import os
|
||||||
|
|
||||||
def ResolveEnvPath(env, folder):
|
def ResolveEnvPath(env, folder):
|
||||||
if env in os.environ:
|
if env in os.environ:
|
||||||
@ -30,22 +30,17 @@ def SetArchFlags(compiler):
|
|||||||
if compiler.target.arch == 'x86_64':
|
if compiler.target.arch == 'x86_64':
|
||||||
compiler.defines += ['WIN64']
|
compiler.defines += ['WIN64']
|
||||||
|
|
||||||
hl2sdk_manifests_root = None
|
hl2sdk_manifests_path = None
|
||||||
hl2sdk_manifests_dest = Normalize(builder.sourcePath + '/hl2sdk-manifests/')
|
|
||||||
|
|
||||||
if not builder.options.hl2sdk_manifest:
|
if not builder.options.hl2sdk_manifest:
|
||||||
if not os.path.exists(hl2sdk_manifests_dest): # if no root was specified and an hl2sdk-manifests folder does not exists in the source folder
|
raise Exception('HL2SDK Manifest root path not set! (--hl2sdk-manifest-path)')
|
||||||
raise Exception('HL2SDK Manifests directory not found! Set --hl2sdk-manifest-path or manually copy the hl2sdk manifests folder to the current source folder.')
|
|
||||||
else:
|
else:
|
||||||
# The HL2SDK Manifest looks for the manifest file based on the current sourcePath, so we need to copy it to our sourcePath first
|
hl2sdk_manifests_path = os.path.join(builder.options.hl2sdk_manifest, 'SdkHelpers.ambuild')
|
||||||
hl2sdk_manifests_root = Normalize(builder.options.hl2sdk_manifest + '/')
|
|
||||||
|
|
||||||
if not os.path.exists(hl2sdk_manifests_dest):
|
if not os.path.exists(hl2sdk_manifests_path):
|
||||||
shutil.copytree(hl2sdk_manifests_root, hl2sdk_manifests_dest)
|
raise Exception('Could not find SdkHelpers.ambuild in the given HL2SDK Manifest path!')
|
||||||
else:
|
|
||||||
print('HL2SDK Manifests folder already exists, not copying.')
|
|
||||||
|
|
||||||
SdkHelpers = builder.Eval('hl2sdk-manifests/SdkHelpers.ambuild', {
|
SdkHelpers = builder.Eval(hl2sdk_manifests_path, {
|
||||||
'Project': 'sm-extension'
|
'Project': 'sm-extension'
|
||||||
})
|
})
|
||||||
|
|
||||||
|
|||||||
@ -1,15 +1,15 @@
|
|||||||
# vim: set sts=2 ts=8 sw=2 tw=99 et ft=python:
|
# vim: set sts=2 ts=8 sw=2 tw=99 et ft=python:
|
||||||
import os
|
import os
|
||||||
|
|
||||||
|
# Name of your extesion, this will also be it's file name.
|
||||||
projectName = 'sample'
|
projectName = 'sample'
|
||||||
extName = projectName + '.ext.'
|
|
||||||
|
|
||||||
# smsdk_ext.cpp will be automatically added later
|
# smsdk_ext.cpp will be automatically added later
|
||||||
sourceFiles = [
|
sourceFiles = [
|
||||||
'extension.cpp',
|
'extension.cpp',
|
||||||
]
|
]
|
||||||
|
|
||||||
project = builder.LibraryProject(extName)
|
project = builder.LibraryProject(projectName)
|
||||||
|
|
||||||
if os.path.isfile(os.path.join(builder.currentSourcePath, 'sdk', 'smsdk_ext.cpp')):
|
if os.path.isfile(os.path.join(builder.currentSourcePath, 'sdk', 'smsdk_ext.cpp')):
|
||||||
# Use the copy included in the project
|
# Use the copy included in the project
|
||||||
@ -29,6 +29,6 @@ for sdk_name in Extension.sdks:
|
|||||||
if not cxx.target.arch in sdk['platforms'][cxx.target.platform]:
|
if not cxx.target.arch in sdk['platforms'][cxx.target.platform]:
|
||||||
continue
|
continue
|
||||||
|
|
||||||
binary = Extension.HL2ExtConfig(project, builder, cxx, extName + sdk['extension'], sdk)
|
binary = Extension.HL2ExtConfig(project, builder, cxx, projectName + '.ext.' + sdk['extension'], sdk)
|
||||||
|
|
||||||
Extension.extensions += builder.Add(project)
|
Extension.extensions += builder.Add(project)
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user