Add support for the preliminary IDE project file generator.

This commit is contained in:
David Anderson 2014-05-30 19:07:56 -07:00
parent 76a589f689
commit 1e6843f8db
4 changed files with 57 additions and 44 deletions

3
.gitignore vendored
View File

@ -30,3 +30,6 @@ LIB-Debug/
# AMBuild build directories # AMBuild build directories
build/ build/
obj-*/ obj-*/
*~
*.rej
*.orig

View File

@ -72,6 +72,9 @@ class SMConfig(object):
self.smx_files = {} self.smx_files = {}
self.versionlib = None self.versionlib = None
def use_auto_versioning(self):
return builder.backend == 'amb2'
def detectProductVersion(self): def detectProductVersion(self):
builder.AddConfigureFile('product.version') builder.AddConfigureFile('product.version')
@ -266,9 +269,10 @@ class SMConfig(object):
# Finish up. # Finish up.
cfg.defines += [ cfg.defines += [
'SOURCEMOD_BUILD', 'SOURCEMOD_BUILD',
'SM_GENERATED_BUILD',
'SM_USE_VERSIONLIB', 'SM_USE_VERSIONLIB',
] ]
if self.use_auto_versioning():
cfg.defines += ['SM_GENERATED_BUILD']
cfg.includes += [os.path.join(builder.buildPath, 'includes')] cfg.includes += [os.path.join(builder.buildPath, 'includes')]
cfg.includes += [os.path.join(builder.sourcePath, 'versionlib')] cfg.includes += [os.path.join(builder.sourcePath, 'versionlib')]
@ -278,14 +282,16 @@ class SMConfig(object):
binary.sources += ['version.rc'] binary.sources += ['version.rc']
binary.compiler.rcdefines += [ binary.compiler.rcdefines += [
'BINARY_NAME="{0}"'.format(binary.outputFile), 'BINARY_NAME="{0}"'.format(binary.outputFile),
'SM_GENERATED_BUILD',
'RC_COMPILE', 'RC_COMPILE',
] ]
if self.use_auto_versioning():
binary.compiler.rcdefines += ['SM_GENERATED_BUILD']
elif builder.target_platform == 'mac': elif builder.target_platform == 'mac':
binary.compiler.postlink += [ binary.compiler.postlink += [
'-compatibility_version', '1.0.0', '-compatibility_version', '1.0.0',
'-current_version', self.productVersion '-current_version', self.productVersion
] ]
if self.use_auto_versioning():
binary.compiler.linkflags += [self.versionlib] binary.compiler.linkflags += [self.versionlib]
binary.compiler.sourcedeps += SM.generated_headers binary.compiler.sourcedeps += SM.generated_headers
return binary return binary
@ -296,9 +302,11 @@ class SMConfig(object):
binary.sources += ['version.rc'] binary.sources += ['version.rc']
binary.compiler.rcdefines += [ binary.compiler.rcdefines += [
'BINARY_NAME="{0}"'.format(binary.outputFile), 'BINARY_NAME="{0}"'.format(binary.outputFile),
'SM_GENERATED_BUILD',
'RC_COMPILE', 'RC_COMPILE',
] ]
if self.use_auto_versioning():
binary.compiler.rcdefines += ['SM_GENERATED_BUILD']
if self.use_auto_versioning():
binary.compiler.linkflags += [self.versionlib] binary.compiler.linkflags += [self.versionlib]
binary.compiler.sourcedeps += SM.generated_headers binary.compiler.sourcedeps += SM.generated_headers
return binary return binary
@ -460,17 +468,17 @@ SM.detectProductVersion()
SM.detectSDKs() SM.detectSDKs()
SM.configure() SM.configure()
SM.generated_headers = builder.RunScript( if SM.use_auto_versioning():
SM.generated_headers = builder.RunScript(
'tools/buildbot/Versioning', 'tools/buildbot/Versioning',
{ 'SM': SM } { 'SM': SM }
) )
SM.versionlib = builder.RunScript( SM.versionlib = builder.RunScript(
'versionlib/AMBuilder', 'versionlib/AMBuilder',
{ 'SM': SM } { 'SM': SM }
) )
builder.RunBuildScripts( BuildScripts = [
[
'loader/AMBuilder', 'loader/AMBuilder',
'core/AMBuilder', 'core/AMBuilder',
'core/logic/AMBuilder', 'core/logic/AMBuilder',
@ -489,13 +497,15 @@ builder.RunBuildScripts(
'extensions/updater/AMBuilder', 'extensions/updater/AMBuilder',
'sourcepawn/compiler/AMBuilder', 'sourcepawn/compiler/AMBuilder',
'sourcepawn/jit/AMBuilder', 'sourcepawn/jit/AMBuilder',
]
if builder.backend == 'amb2':
BuildScripts += [
'plugins/AMBuilder', 'plugins/AMBuilder',
'tools/buildbot/PackageScript', 'tools/buildbot/PackageScript',
], ]
{
'SM': SM builder.RunBuildScripts(BuildScripts, { 'SM': SM })
}
)
if builder.options.breakpad_dump: if builder.options.breakpad_dump:
builder.RunScript('tools/buildbot/BreakpadSymbols', { 'SM': SM }) builder.RunScript('tools/buildbot/BreakpadSymbols', { 'SM': SM })

View File

@ -34,7 +34,7 @@ for sdk_name in SM.sdks:
elif builder.target_platform == 'mac': elif builder.target_platform == 'mac':
lib_path = os.path.join(sdk.path, 'lib', 'osx32', 'release', 'libprotobuf.a') lib_path = os.path.join(sdk.path, 'lib', 'osx32', 'release', 'libprotobuf.a')
elif builder.target_platform == 'windows': elif builder.target_platform == 'windows':
msvc_ver = int(compiler.cxx.version) msvc_ver = compiler.cxx.version
vs_year = '' vs_year = ''
if msvc_ver == 1800: if msvc_ver == 1800:
vs_year = '2013' vs_year = '2013'

View File

@ -342,8 +342,8 @@ void RootConsoleMenu::OnRootConsoleCommand(const char *cmdname, const CCommand &
ConsolePrint(" Compiled on: %s %s", __DATE__, __TIME__); ConsolePrint(" Compiled on: %s %s", __DATE__, __TIME__);
#if defined(SM_GENERATED_BUILD) #if defined(SM_GENERATED_BUILD)
ConsolePrint(" Built from: https://github.com/alliedmodders/sourcemod/commit/%s", SOURCEMOD_SHA); ConsolePrint(" Built from: https://github.com/alliedmodders/sourcemod/commit/%s", SOURCEMOD_SHA);
#endif
ConsolePrint(" Build ID: %s:%s", SOURCEMOD_LOCAL_REV, SOURCEMOD_SHA); ConsolePrint(" Build ID: %s:%s", SOURCEMOD_LOCAL_REV, SOURCEMOD_SHA);
#endif
ConsolePrint(" http://www.sourcemod.net/"); ConsolePrint(" http://www.sourcemod.net/");
} }
} }