Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR implements a mechanism to let MSBuild set some
#define
s customised per distro version (i.e. per appx version built).It relies on the
wsl-builder
component to apply a file namedPreprocessor.props
frommeta/
subtree according to the appx version being built during the build system preparation, so each Ubuntu app can have its own version of that file with its own list of#define
s.We can later use that mechanism to make MSBuild
#define WIN_OOBE_ENABLED
for UbuntuPreview and that effectively selects the correct app strategy for the OOBE. The filemeta/**/Preprocessor.props
must setItemDefinitionGroup.ClCompile.PreprocessorDefinitions
to a list of values that will be passed to the compiler as if the command line/D<VALUE>
was passed such as illustrated below:Notice that a default
DistroLauncher/Preprocessor.props
is not allowed and it's git-ignored. Default#define
s must be visible in the source code. That file is for appx-version-specific customisations, thus only those insidemeta/
are meant to be version-controlled.To ensure that the constant definition won't be too early or too late a common
Directory.Build.props
was placed insideDistroLauncher/
forcing thePreprocessor.props
to be imported before common Cpp props (if that file exists, of course).That required changes in the CI QA workflow, because it was based on placing a custom
Directory.Build.props
file insideDistroLauncher/
directory to override theClangTidy
MSBuild target. The same behavior can be achieved with a.targets
file even though it's loaded later in the build process than the.props
file.This PR just implements the mechanism. The per-app define files must be later created as needed in their respective
meta/
subdirectories.