Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Restore VS2022 support #13524

Merged
merged 7 commits into from
Mar 24, 2022
Merged
Show file tree
Hide file tree
Changes from 5 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions nvdaHelper/archBuild_sconscript
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,10 @@ def COMProxyDllBuilder(env,target,source,proxyClsid):
return proxyDll
env.AddMethod(COMProxyDllBuilder,'COMProxyDll')

# We only support compiling with MSVC 14.2 (2019) or newer
if not env.get('MSVC_VERSION') or tuple(map(int, env.get('MSVC_VERSION').split("."))) < (14, 2):
raise RuntimeError("Visual C++ 14.2 (Visual Studio 2019) or newer not found")

TARGET_ARCH=env['TARGET_ARCH']
debug=env['nvdaHelperDebugFlags']
release=env['release']
Expand Down
5 changes: 5 additions & 0 deletions nvdaHelper/microsoft-ui-uiautomation/sconscript
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,11 @@ Import(
'sourceLibDir',
)

env = env.Clone()
# Building with msbuild requires windir to be set as environment variable,
# otherwise the build fails with Visual Studio 2022
env['ENV']['windir'] = os.environ['windir']

MSUIA_sourceDir = Dir('#include/microsoft-ui-uiautomation/src/uiAutomation')
MSUIA_lib_outDir = Dir('lib')
MSUIA_include_outDir = Dir('include')
Expand Down
13 changes: 7 additions & 6 deletions readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -60,12 +60,13 @@ The following dependencies need to be installed on your system:

* [Python](https://www.python.org/), version 3.7, 32 bit
* Use latest minor version if possible.
* Microsoft Visual Studio 2019:
* When you do not use the Visual Studio IDE itself, you can download the [build tools](https://aka.ms/vs/16/release/vs_BuildTools.exe)
* When you are intending to use the Visual Studio IDE (not required for NVDA development), you can download [the community version](https://aka.ms/vs/16/release/vs_Community.exe), which is also used by appveyor
* The Professional and Enterprise versions are also supported
* Preview versions are *not* supported
* Building with Visual Studio 2022 is not officially supported at this stage.
* Microsoft Visual Studio 2019 or 2022:
* To replicate the production build environment, use the [version of Visual Studio 2019 that AppVeyor is using](https://www.appveyor.com/docs/windows-images-software/#visual-studio-2019).
* When you do not use the Visual Studio IDE itself, you can download the [build tools](https://aka.ms/vs/16/release/vs_BuildTools.exe)
* When you are intending to use the Visual Studio IDE (not required for NVDA development), you can download [the community version](https://aka.ms/vs/16/release/vs_Community.exe), which is also used by appveyor
* The Professional and Enterprise versions are also supported
* Preview versions are *not* supported
* Building with Visual Studio 2022 explicitly requires the MSVC v142 - VS 2019 C++ build tools to be installed (see below)
* When installing Visual Studio, you need to enable the following:
* In the list on the Workloads tab
* in the Windows grouping:
Expand Down
5 changes: 0 additions & 5 deletions sconstruct
Original file line number Diff line number Diff line change
Expand Up @@ -122,11 +122,6 @@ env = Environment(variables=vars,HOST_ARCH='x86',tools=[
"recursiveInstall"
])

# Specifically request to use Visual Studio 2019 (MSVC 14.2).
# This will ensure that this specific version is selected if there are multiple versions installed,
# And fail the build if this version is not installed at all.
env.SetDefault(MSVC_VERSION='14.2')

# speed up subsequent runs by checking timestamps of targets and dependencies, and only using md5 if timestamps differ.
env.Decider('MD5-timestamp')

Expand Down