From 6d320163a1458a1183b8b8f4e0a7659047ca5573 Mon Sep 17 00:00:00 2001 From: David Anderson Date: Mon, 30 Dec 2013 17:51:00 -0500 Subject: [PATCH] Various Windows build fixes (bug 5997 part 13, r=ds). --HG-- rename : sourcepawn/compiler/libpawnc.rc => sourcepawn/compiler/version.rc --- AMBuildScript | 6 ++++-- extensions/curl/curl-src/lib/AMBuilder | 9 ++++++++- public/sourcemod_version.h | 3 +++ sourcepawn/compiler/{libpawnc.rc => version.rc} | 0 4 files changed, 15 insertions(+), 3 deletions(-) rename sourcepawn/compiler/{libpawnc.rc => version.rc} (100%) diff --git a/AMBuildScript b/AMBuildScript index 4d454897..88646c7b 100644 --- a/AMBuildScript +++ b/AMBuildScript @@ -252,7 +252,8 @@ class SMConfig(object): binary.sources += ['version.rc'] binary.compiler.rcdefines += [ 'BINARY_NAME="{0}"'.format(binary.outputFile), - 'SM_GENERATED_BUILD' + 'SM_GENERATED_BUILD', + 'RC_COMPILE', ] elif builder.target_platform == 'mac': binary.compiler.postlink += [ @@ -269,7 +270,8 @@ class SMConfig(object): binary.sources += ['version.rc'] binary.compiler.rcdefines += [ 'BINARY_NAME="{0}"'.format(binary.outputFile), - 'SM_GENERATED_BUILD' + 'SM_GENERATED_BUILD', + 'RC_COMPILE', ] binary.compiler.linkflags += [self.versionlib] binary.compiler.sourcedeps += SM.generated_headers diff --git a/extensions/curl/curl-src/lib/AMBuilder b/extensions/curl/curl-src/lib/AMBuilder index 84f56ade..8748638c 100644 --- a/extensions/curl/curl-src/lib/AMBuilder +++ b/extensions/curl/curl-src/lib/AMBuilder @@ -14,6 +14,12 @@ if builder.target_platform is 'mac': mac_tuple = mac_version.split('.') if int(mac_tuple[0]) >= 10 and int(mac_tuple[1]) >= 9: binary.compiler.defines += ['BUILTIN_STRLCAT'] +elif builder.target_platform is 'windows': + binary.compiler.defines += [ + 'BUILDING_LIBCURL', + 'CURL_STATICLIB', + 'CURL_DISABLE_LDAP', + ] binary.sources += [ 'base64.c', @@ -52,7 +58,6 @@ binary.sources += [ 'llist.c', 'md5.c', 'memdebug.c', - 'mprintf.c', 'multi.c', 'netrc.c', 'nss.c', @@ -82,5 +87,7 @@ binary.sources += [ 'url.c', 'version.c' ] +if builder.target_platform != 'windows': + builder.sources += ['mprintf.c'] rvalue = builder.Add(binary) diff --git a/public/sourcemod_version.h b/public/sourcemod_version.h index a5d88112..c9ef3b0d 100644 --- a/public/sourcemod_version.h +++ b/public/sourcemod_version.h @@ -39,6 +39,9 @@ */ #if defined SM_GENERATED_BUILD +# if defined RC_COMPILE +# undef SM_USE_VERSIONLIB +# endif # if defined SM_USE_VERSIONLIB # include # else diff --git a/sourcepawn/compiler/libpawnc.rc b/sourcepawn/compiler/version.rc similarity index 100% rename from sourcepawn/compiler/libpawnc.rc rename to sourcepawn/compiler/version.rc