diff --git a/ship/common_ship.py b/ship/common_ship.py index 71dffd6..65b9689 100644 --- a/ship/common_ship.py +++ b/ship/common_ship.py @@ -18,7 +18,7 @@ with open(topDir + "/VERSION.txt", "rt") as f: def writeBuildInfo(): with open(topDir + "/BUILD_INFO.txt", "w") as f: - f.write("VERSION_SUFFIX=\n") + f.write("VERSION_SUFFIX=__none__\n") f.write("COMMIT_HASH=" + commitHash + "\n") def rmrf(patterns): diff --git a/ship/make_msvc_package.py b/ship/make_msvc_package.py index 9451e57..07a3425 100755 --- a/ship/make_msvc_package.py +++ b/ship/make_msvc_package.py @@ -102,7 +102,8 @@ def build(arch, packageDir, xp=False): "../build-gyp/gyp_main.py", "winpty.gyp", "-I", "configurations.gypi", - "-G", "msvs_version=" + versionInfo["gyp_version"]] + + "-G", "msvs_version=" + versionInfo["gyp_version"], + "-D", "VERSION_SUFFIX=__none__"] + (["-D", "WINPTY_MSBUILD_TOOLSET=" + versionInfo["xp_toolset"]] if xp else []), cwd="src") devCmdPath = os.path.join(os.environ[versionInfo["common_tools_env"]], "VsDevCmd.bat") diff --git a/src/shared/WinptyVersion.cc b/src/shared/WinptyVersion.cc index 38bef7e..ccc9ac0 100644 --- a/src/shared/WinptyVersion.cc +++ b/src/shared/WinptyVersion.cc @@ -21,20 +21,29 @@ #include "WinptyVersion.h" #include +#include #include "DebugClient.h" #define XSTRINGIFY(x) #x #define STRINGIFY(x) XSTRINGIFY(x) +static const char *versionSuffix() { + const char *ret = STRINGIFY(WINPTY_VERSION_SUFFIX); + if (!strcmp(ret, "__none__")) { + return ""; + } + return ret; +} + void dumpVersionToStdout() { - printf("winpty version %s%s\n", STRINGIFY(WINPTY_VERSION), STRINGIFY(WINPTY_VERSION_SUFFIX)); + printf("winpty version %s%s\n", STRINGIFY(WINPTY_VERSION), versionSuffix()); printf("commit %s\n", STRINGIFY(WINPTY_COMMIT_HASH)); } void dumpVersionToTrace() { trace("winpty version %s%s (commit %s)", STRINGIFY(WINPTY_VERSION), - STRINGIFY(WINPTY_VERSION_SUFFIX), + versionSuffix(), STRINGIFY(WINPTY_COMMIT_HASH)); }