From ae550e0969595f062b15c2ff5cc33d4afe8ebc3f Mon Sep 17 00:00:00 2001 From: "Dustin L. Howett" Date: Wed, 21 Oct 2020 14:43:53 -0700 Subject: [PATCH] Expose WindowsTerminalBranding to the preprocessor (optionally) (#7986) Our build pipeline was originally set up such that we could take any binaries from the Terminal build and seamlessly re-package them with the release or preview livery. My initial plan was to stamp a stable and preview build at the same time, out of the same bits, to make ring promotion easier. I've never done that. For the last five releases, we've just re-cut a new stable build along with the new preview build, usually because we want to backport some fixes to stable. This commit introduces preprocessor defines, detectable through CL and RC, for any project that wants them. Right now, that's just going to be WindowsTerminal.vcxproj (since it hosts the icons and the app entry point). This list may be extended to include wt (the shim executable) and the shell extension at some future date. This will greatly simplify the logic in #7971, as we'll no longer need to detect if we're dev or preview at runtime. It may also simplify the logic in the shell extension for determining whether we're Dev or not. --- build/rules/Branding.targets | 18 ++++++++++++++++++ .../WindowsTerminal/WindowsTerminal.vcxproj | 1 + 2 files changed, 19 insertions(+) create mode 100644 build/rules/Branding.targets diff --git a/build/rules/Branding.targets b/build/rules/Branding.targets new file mode 100644 index 000000000..f72a2430a --- /dev/null +++ b/build/rules/Branding.targets @@ -0,0 +1,18 @@ + + + + <_WTBrandingPreprocessorToken Condition="'$(WindowsTerminalBranding)'=='Preview'">WT_BRANDING_PREVIEW + <_WTBrandingPreprocessorToken Condition="'$(WindowsTerminalBranding)'=='Release'">WT_BRANDING_RELEASE + <_WTBrandingPreprocessorToken Condition="'$(_WTBrandingPreprocessorToken)'==''">WT_BRANDING_DEV + + + + + $(_WTBrandingPreprocessorToken);%(PreprocessorDefinitions) + + + + $(_WTBrandingPreprocessorToken);%(PreprocessorDefinitions) + + + diff --git a/src/cascadia/WindowsTerminal/WindowsTerminal.vcxproj b/src/cascadia/WindowsTerminal/WindowsTerminal.vcxproj index 6d9388771..d8adf0098 100644 --- a/src/cascadia/WindowsTerminal/WindowsTerminal.vcxproj +++ b/src/cascadia/WindowsTerminal/WindowsTerminal.vcxproj @@ -155,6 +155,7 @@ +