Merge pull request #17 from alliedmodders/vsgen

Add support for the preliminary IDE project file generator.
This commit is contained in:
David Anderson 2014-05-30 19:18:40 -07:00
commit b0ccc87638
4 changed files with 57 additions and 44 deletions

3
.gitignore vendored
View File

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

View File

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

View File

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

View File

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