From e6aeb8a01742d3eef0e7725fed168b397bb6b97d Mon Sep 17 00:00:00 2001 From: Michael Niksa Date: Tue, 3 Nov 2020 15:20:48 -0800 Subject: [PATCH] Use LanguageStandard over explicit compiler flag for C++17 (#8150) Turns out there's an actual way to specify C++17 for MSBuild purposes besides just passing the compile flag. ## References * Future C++20 support (modules) ## PR Checklist * [x] Closes random fact found while exploring VS16.8 preview C++20 modules. * [x] I work here. * [x] It still builds. ## Detailed Description of the Pull Request / Additional comments * We've been setting C++17 with just the flag passed to the compiler `cl.exe`. But it turns out that this particular `LanguageStandard` option will need to be set appropriately one day for us to use C++20 modules (as evidenced by the latest VS16.8 preview that I tried out to explore modules.) The `AdditionalOption` alone isn't enough to ensure that modules can be "seen" by other projects after production, but `LanguageStandard` is (and will set the compiler option as appropriate as well as whatever internal goo that MSBuild needs to hook up other stuff.) ## Validation Steps Performed * Built with it changed. --- .github/actions/spell-check/expect/expect.txt | 1 + src/common.build.pre.props | 3 ++- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/.github/actions/spell-check/expect/expect.txt b/.github/actions/spell-check/expect/expect.txt index df13a23ddf..5ed2c8814a 100644 --- a/.github/actions/spell-check/expect/expect.txt +++ b/.github/actions/spell-check/expect/expect.txt @@ -2191,6 +2191,7 @@ Statusline stdafx STDAPI stdcall +stdcpp stderr stdexcept stdin diff --git a/src/common.build.pre.props b/src/common.build.pre.props index caf53f2a8a..dbe5b91af4 100644 --- a/src/common.build.pre.props +++ b/src/common.build.pre.props @@ -94,7 +94,8 @@ true false false - /std:c++17 /utf-8 %(AdditionalOptions) + stdcpp17 + /utf-8 %(AdditionalOptions) Guard