From 779e064a17a133d75ba2ba765581c1b27fae987b Mon Sep 17 00:00:00 2001 From: David Anderson Date: Sat, 8 Feb 2014 20:53:01 -0800 Subject: [PATCH] Add .rc files. Former-commit-id: 3d9c34eff669112a54d181ca3f970e2c77d31409 --- AMBuildScript | 30 +++++++++++++----------------- amxmodx/AMBuilder | 3 +++ amxmodx/version.rc | 10 ++++++++-- compiler/amxxpc/AMBuilder | 3 +++ compiler/libpc300/AMBuilder | 3 +++ 5 files changed, 30 insertions(+), 19 deletions(-) diff --git a/AMBuildScript b/AMBuildScript index 6ae3bdb9..6d1fb143 100644 --- a/AMBuildScript +++ b/AMBuildScript @@ -229,13 +229,11 @@ class AMXXConfig(object): binary = compiler.Library(name) binary.compiler.cxxincludes += [os.path.join(context.currentSourcePath)] if builder.target_platform == 'windows': - #binary.sources += ['version.rc'] - #binary.compiler.rcdefines += [ - # 'BINARY_NAME="{0}"'.format(binary.outputFile), - # 'SM_GENERATED_BUILD', - # 'RC_COMPILE', - #] - pass + binary.compiler.rcdefines += [ + 'BINARY_NAME="{0}"'.format(binary.outputFile), + 'AMBUILD', + 'RC_COMPILE', + ] elif builder.target_platform == 'mac': binary.compiler.postlink += [ '-compatibility_version', '1.0.0', @@ -250,7 +248,7 @@ class AMXXConfig(object): os.path.join(context.currentSourcePath, 'sdk'), ] - if builder.target_platform == 'mac': + if builder.target_platform == 'mac' or builder.target_platform == 'windows': name = name + '_amxx' elif builder.target_platform == 'linux': name = name + '_amxx_i386' @@ -260,14 +258,12 @@ class AMXXConfig(object): def ProgramBuilder(self, context, compiler, name): binary = compiler.Program(name) binary.compiler.cxxincludes += [os.path.join(context.currentSourcePath)] - # if builder.target_platform == 'windows': - # binary.sources += ['version.rc'] - # binary.compiler.rcdefines += [ - # 'BINARY_NAME="{0}"'.format(binary.outputFile), - # 'SM_GENERATED_BUILD', - # 'RC_COMPILE', - # ] - # binary.compiler.linkflags += [self.versionlib] + if builder.target_platform == 'windows': + binary.compiler.rcdefines += [ + 'BINARY_NAME="{0}"'.format(binary.outputFile), + 'AMBUILD', + 'RC_COMPILE', + ] binary.compiler.sourcedeps += AMXX.generated_headers return binary @@ -283,7 +279,7 @@ class AMXXConfig(object): def MetaPlugin(self, context, name): compiler = self.MMCompiler(context) - if builder.target_platform == 'mac': + if builder.target_platform == 'mac' or builder.target_platform == 'windows': name = name + '_mm' elif builder.target_platform == 'linux': name = name + '_mm_i386' diff --git a/amxmodx/AMBuilder b/amxmodx/AMBuilder index df90d73d..034ff488 100644 --- a/amxmodx/AMBuilder +++ b/amxmodx/AMBuilder @@ -94,4 +94,7 @@ binary.sources = [ 'trie_natives.cpp', ] +if builder.target_platform == 'windows': + binary.sources += ['version.rc'] + AMXX.binaries += [builder.Add(binary)] diff --git a/amxmodx/version.rc b/amxmodx/version.rc index 9b7a81e0..48e839ce 100755 --- a/amxmodx/version.rc +++ b/amxmodx/version.rc @@ -6,7 +6,13 @@ // Generated from the TEXTINCLUDE 2 resource. // #include "winres.h" -#include "svn_version.h" +#if defined AMBUILD +# include +#else +# define SVN_VERSION_DWORD 1, 8, 3, 0 +# define SVN_VERSION_STRING "dev-local" +# define SVN_VERSION SVN_VERSION_STRING +#endif ///////////////////////////////////////////////////////////////////////////// #undef APSTUDIO_READONLY_SYMBOLS @@ -49,7 +55,7 @@ BEGIN VALUE "LegalCopyright", "Copyright (c) 2004-2007, AMX Mod X Dev Team" VALUE "OriginalFilename", "amxmodx_mm.dll" VALUE "ProductName", "AMX Mod X" - VALUE "ProductVersion", SVN_VERSION_PRODUCT + VALUE "ProductVersion", SVN_VERSION END END BLOCK "VarFileInfo" diff --git a/compiler/amxxpc/AMBuilder b/compiler/amxxpc/AMBuilder index 8ecdb096..b154773b 100644 --- a/compiler/amxxpc/AMBuilder +++ b/compiler/amxxpc/AMBuilder @@ -29,4 +29,7 @@ binary.sources = [ 'Binary.cpp', ] +if builder.target_platform == 'windows': + binary.sources += ['amxxpc1.rc'] + AMXX.amxxpc = builder.Add(binary) diff --git a/compiler/libpc300/AMBuilder b/compiler/libpc300/AMBuilder index a0637c8b..87e59f61 100644 --- a/compiler/libpc300/AMBuilder +++ b/compiler/libpc300/AMBuilder @@ -35,4 +35,7 @@ binary.sources = [ 'memfile.c', ] +if builder.target_platform == 'windows': + binary.sources+= ['libpawnc.rc'] + AMXX.libpc300 = builder.Add(binary)