Skip to content

Commit 6d30492

Browse files
authored
Merge pull request #3529 from MicrosoftDocs/master
4/22/2021 AM Publish
2 parents 38e6d6c + 5366ab6 commit 6d30492

10 files changed

+281
-171
lines changed

docs/build/cmake-presets-vs.md

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ ms.topic: reference
99

1010
CMake supports two files, `CMakePresets.json` and `CMakeUserPresets.json`, that allow users to specify common configure, build, and test options and share them with others.
1111

12-
Use `CMakePresets.json` and `CMakeUserPresets.json` to drive CMake in Visual Studio and Visual Studio Code, in a Continuous Integration (CI) pipReline, and from the command line. `CMakePresets.json` is intended to save project-wide builds, and `CMakeUserPresets.json` is intended for developers to save their own local builds. `CMakePresets.json` is supported in Visual Studio 2019 version 16.10 or later.
12+
Use `CMakePresets.json` and `CMakeUserPresets.json` to drive CMake in Visual Studio and Visual Studio Code, in a Continuous Integration (CI) pipeline, and from the command line. `CMakePresets.json` is intended to save project-wide builds, and `CMakeUserPresets.json` is intended for developers to save their own local builds. `CMakePresets.json` is supported in Visual Studio 2019 version 16.10 or later.
1313

1414
This article contains information about `CMakePresets.json` integration Visual Studio.
1515

@@ -29,7 +29,7 @@ CMake version 3.20 or higher is required when invoking CMake with `CMakePresets.
2929

3030
`CMakePresets.json` integration isn't enabled by default in Visual Studio 2019. You can enable it for all CMake projects in **Tools** > **Options** > **CMake** > **General**:
3131

32-
![Enable `CMakePresets.json` in CMake options > General](./media/enable-cmakepresets.png)
32+
![Screenshot showing the checkbox to enable CMakePresets.json in the CMake General page of the Tools Options dialog.](./media/enable-cmakepresets.png)
3333

3434
> [!Important]
3535
> Close and reopen the folder in Visual Studio to activate the integration.
@@ -187,7 +187,7 @@ The official [CMake documentation](https://cmake.org/cmake/help/latest/manual/cm
187187

188188
### Select your compilers
189189

190-
C and C++ compilers can be set by `cacheVariables.CMAKE_C_COMPILER` and `cacheVariables.CMAKE_CXX_COMPILER` in a Configure Preset. It's equivalent to passing `-D CMAKE_C_COMPILER=<value> and -D CMAKE_CXX_COMPILER=<value>` to CMake from the command line. For more information, see [CMAKE_\<LANG>_COMPILER](https://cmake.org/cmake/help/latest/variable/CMAKE_LANG_COMPILER.html#cmake-lang-compiler).
190+
C and C++ compilers can be set by `cacheVariables.CMAKE_C_COMPILER` and `cacheVariables.CMAKE_CXX_COMPILER` in a Configure Preset. It's equivalent to passing `-D CMAKE_C_COMPILER=<value> and -D CMAKE_CXX_COMPILER=<value>` to CMake from the command line. For more information, see [`CMAKE_<LANG>_COMPILER`](https://cmake.org/cmake/help/latest/variable/CMAKE_LANG_COMPILER.html#cmake-lang-compiler).
191191

192192
Use the following examples to build with `cl.exe` and `clang-cl.exe` from Visual Studio. The C++ Clang tools for Windows component must be installed to build with `clang-cl`.
193193

@@ -264,7 +264,7 @@ The host architecture (x64 or x86) and toolset can be set with `toolset.value`.
264264

265265
`set` should be used with IDE generators like the Visual Studio Generator. `external` should be used with command-line generators like Ninja. These values allow vendors like Visual Studio to source the required environment before CMake is invoked. For more information about the architecture and toolset fields, see [Configure Presets](https://cmake.org/cmake/help/latest/manual/cmake-presets.7.html#configure-preset).
266266

267-
For a full list of IDE generators that support the architecture field, see [CMAKE_GENERATOR_PLATFORM](https://cmake.org/cmake/help/latest/variable/CMAKE_GENERATOR_PLATFORM.html). For a full list of IDE generators that support the toolset field, see [CMAKE_GENERATOR_TOOLSET](https://cmake.org/cmake/help/latest/variable/CMAKE_GENERATOR_TOOLSET.html).
267+
For a full list of IDE generators that support the architecture field, see [`CMAKE_GENERATOR_PLATFORM`](https://cmake.org/cmake/help/latest/variable/CMAKE_GENERATOR_PLATFORM.html). For a full list of IDE generators that support the toolset field, see [`CMAKE_GENERATOR_TOOLSET`](https://cmake.org/cmake/help/latest/variable/CMAKE_GENERATOR_TOOLSET.html).
268268

269269
Use the examples below to target ARM64 with the Ninja generator, or Win32 (x86) with the Visual Studio 16 2019 generator:
270270

@@ -361,7 +361,7 @@ Update your `launch.vs.json` and `task.vs.json` files to reference `CMakePresets
361361

362362
If things aren't working as expected, there are a few troubleshooting steps that you can take.
363363

364-
If either `CMakePrests.json` or `CMakeUserPresets.json` is invalid, then Visual Studio will fall back on its default behavior and show only the default Configure Presets. Visual Studio IntelliSense can help you catch many of these JSON errors, but it won't know if you're referencing a preset with `inherits` or `configurePreset` by the wrong name. To check if your preset files are valid, run `cmake --list-presets` from the command line at the root of your project directory (CMake 3.20 or higher is required). If either file is invalid, then you'll see the following error:
364+
If either `CMakePresets.json` or `CMakeUserPresets.json` is invalid, then Visual Studio will fall back on its default behavior and show only the default Configure Presets. Visual Studio IntelliSense can help you catch many of these JSON errors, but it won't know if you're referencing a preset with `inherits` or `configurePreset` by the wrong name. To check if your preset files are valid, run `cmake --list-presets` from the command line at the root of your project directory (CMake 3.20 or higher is required). If either file is invalid, then you'll see the following error:
365365

366366
```DOS
367367
CMake Error: Could not read presets from
@@ -372,7 +372,7 @@ Other troubleshooting steps include:
372372

373373
- Delete the cache and reconfigure the project (**CMake: Delete Cache** and **Project** > **Configure \<project-name>**)
374374
- Close and reopen the folder in Visual Studio (**File** > **Close Folder**)
375-
- Delete the `.vs` folder at the root your project
375+
- Delete the *`.vs`* folder at the root your project
376376

377377
If you've identified a problem, the best way to report it is by clicking the **Send Feedback** button in the top right-hand corner of Visual Studio.
378378

@@ -382,7 +382,7 @@ You can enable logging for remote connections if you're having trouble connectin
382382

383383
## Enable AddressSanitizer for Windows and Linux
384384

385-
AddressSanitizer (`ASan`) is a runtime memory error detector for C and C++ that is supported in Visual Studio for both Windows and Linux development. AddressSanitizer was enabled with an option (`addressSanitizerEnabled`) in `CMakeSettings.json`. This behavior isn't supported by `CMakePresets.json`.
385+
AddressSanitizer (ASan) is a runtime memory error detector for C and C++ that's supported in Visual Studio for both Windows and Linux development. AddressSanitizer was enabled with an option (`addressSanitizerEnabled`) in `CMakeSettings.json`. This behavior isn't supported by `CMakePresets.json`.
386386

387387
Instead, enable and disable AddressSanitizer by setting the required compiler and linker flags yourself. Setting them removes Visual Studio-specific behavior and ensures that the same `CMakePresets.json` file can reproduce your build from the command line. The following sample can be added to a `CMakeLists.txt` to enable or disable AddressSanitizer for a target.
388388

@@ -399,7 +399,7 @@ if(ASAN_ENABLED)
399399
endif()
400400
```
401401

402-
`<additional-options>` are other compilation flags like `"-fno-omit-frame-pointer"`. For more information about `ASan` for Linux, see [Using AddressSanitizer](https://github.com/google/sanitizers/wiki/AddressSanitizer#using-addresssanitizer). For more information about using `ASan` with MSVC, see [Use the AddressSanitizer from a Developer Command Prompt](https://docs.microsoft.com/cpp/sanitizers/asan#command-prompt).
402+
`<additional-options>` are other compilation flags like `"-fno-omit-frame-pointer"`. For more information about AddressSanitizer for Linux, see [Using AddressSanitizer](https://github.com/google/sanitizers/wiki/AddressSanitizer#using-addresssanitizer). For more information about using AddressSanitizer with MSVC, see [Use the AddressSanitizer from a Developer Command Prompt](https://docs.microsoft.com/cpp/sanitizers/asan#command-prompt).
403403

404404
Pass runtime flags to AddressSanitizer by using the `ASAN_OPTIONS` field in `launch.vs.json`. `ASAN_OPTIONS` defaults to `detect_leaks=0` when no other runtime options are specified because LeakSanitizer isn't supported in Visual Studio.
405405

@@ -409,7 +409,7 @@ You can use the same `CMakePresets.json` and `CMakeUserPresets.json` files to in
409409

410410
### Sourcing the environment when building with command-line generators on Windows
411411

412-
It's up to the user to configure the environment before CMake is invoked when building with a command-line generator. If you're building with Ninja and the Visual C++ toolset on Windows, then set the environment before CMake is called to generate the build system. You can do it by calling `vcvarsall.bat` with the `architecture` argument. `architecture` specifies the host and target architecture to use. For more information, see [vcvarsall syntax](https://docs.microsoft.com/cpp/build/building-on-the-command-line#vcvarsall-syntax). If you build on Linux or on Windows with a Visual Studio Generator, then you don't need to take this step.
412+
It's up to the user to configure the environment before CMake is invoked when building with a command-line generator. If you're building with Ninja and the Visual C++ toolset on Windows, then set the environment before CMake is called to generate the build system. You can do it by calling `vcvarsall.bat` with the `architecture` argument. `architecture` specifies the host and target architecture to use. For more information, see [`vcvarsall` syntax](https://docs.microsoft.com/cpp/build/building-on-the-command-line#vcvarsall-syntax). If you build on Linux or on Windows with a Visual Studio Generator, then you don't need to take this step.
413413

414414
It's the same step that Visual Studio takes for you when CMake is invoked by the IDE. Visual Studio parses the active Configure Preset for the host and target architecture specified by `toolset` and `architecture` and then sources the specified environment from `vcvarsall.bat`. When you build from the Windows command line with Ninja, you'll need to take this step yourself.
415415

@@ -419,7 +419,7 @@ It's the same step that Visual Studio takes for you when CMake is invoked by the
419419

420420
The following commands can be used to configure and build a CMake project that uses Ninja to target arm64 with x64 build tools. CMake version 3.20 or higher is required. Run these commands from the directory where your `CMakePresets.json` is located:
421421

422-
```DOS
422+
```cmd
423423
/path/to/vcvarsall.bat x64_arm64
424424
cmake --list-presets=all .
425425
cmake --preset <configurePreset-name>
Lines changed: 16 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1,39 +1,36 @@
11
---
2-
description: "Learn more about: /INTEGRITYCHECK (Require Signature Check)"
3-
title: "/INTEGRITYCHECK (Require Signature Check)"
4-
ms.date: "11/04/2016"
5-
ms.assetid: 9e738825-2c98-40cd-8ad2-5d0d9c14893e
2+
description: "Learn more about: /INTEGRITYCHECK (Require signature check)"
3+
title: "/INTEGRITYCHECK (Require signature check)"
4+
ms.date: 04/21/2021
65
---
7-
# /INTEGRITYCHECK (Require Signature Check)
6+
# `/INTEGRITYCHECK` (Require signature check)
87

98
Specifies that the digital signature of the binary image must be checked at load time.
109

11-
```
12-
/INTEGRITYCHECK[:NO]
13-
```
10+
> **`/INTEGRITYCHECK`**[**`:NO`**]
1411
1512
## Remarks
1613

17-
By default, **/INTEGRITYCHECK** is off.
14+
By default, **`/INTEGRITYCHECK`** is off.
1815

19-
The **/INTEGRITYCHECK** option setsin the PE header of the DLL file or executable file—a flag for the memory manager to check for a digital signature in order to load the image in Windows. This option must be set for both 32-bit and 64-bit DLLs that implement kernel-mode code loaded by certain Windows features, and is recommended for all device drivers on Windows Vista, Windows 7, Windows 8, Windows Server 2008, and Windows Server 2012. Versions of Windows prior to Windows Vista ignore this flag. For more information, see [Forced Integrity Signing of Portable Executable (PE) files](https://social.technet.microsoft.com/wiki/contents/articles/255.forced-integrity-signing-of-portable-executable-pe-files.aspx).
16+
The **`/INTEGRITYCHECK`** linker option sets a flag, `IMAGE_DLLCHARACTERISTICS_FORCE_INTEGRITY`, in the PE header of the DLL file or executable file. This flag tells the memory manager to check for a digital signature in order to load the image in Windows. This option must be set for both 32-bit and 64-bit DLLs that implement kernel-mode code loaded by certain Windows features. It's recommended for all device drivers on Windows Vista, Windows Server 2008, and all later versions of Windows and Windows Server. Versions of Windows prior to Windows Vista ignore this flag. For more information, see [Forced Integrity Signing of Portable Executable (PE) files](https://social.technet.microsoft.com/wiki/contents/articles/255.forced-integrity-signing-of-portable-executable-pe-files.aspx).
2017

21-
### To set this linker option in Visual Studio
18+
### Signing `/INTEGRITYCHECK` files
2219

23-
1. Open the project **Property Pages** dialog box. For more information, see [Set C++ compiler and build properties in Visual Studio](../working-with-project-properties.md).
20+
Microsoft has new signing guidance for DLL and executable files linked by using **`/INTEGRITYCHECK`**. The guidance used to recommend a cross-signed certificate from the [cross-signing program](/windows-hardware/drivers/install/cross-certificates-for-kernel-mode-code-signing). However, the [cross-signing program is now deprecated](/windows-hardware/drivers/install/deprecation-of-software-publisher-certificates-and-commercial-release-certificates). We recommend you sign your **`/INTEGRITYCHECK`** files by using the Microsoft [Azure Code Signing](https://techcommunity.microsoft.com/t5/video-hub/reduce-developer-friction-with-azure-code-signing/m-p/1698637) program instead.
2421

25-
1. Expand the **Configuration Properties** node.
22+
### To set this linker option in Visual Studio
2623

27-
1. Expand the **Linker** node.
24+
1. Open the project **Property Pages** dialog box. For more information, see [Set C++ compiler and build properties in Visual Studio](../working-with-project-properties.md).
2825

29-
1. Select the **Command Line** property page.
26+
1. Select the **Configuration Properties** > **Linker** > **Command Line** property page.
3027

31-
1. In **Additional Options**, enter `/INTEGRITYCHECK` or `/INTEGRITYCHECK:NO`.
28+
1. In **Additional Options**, enter *`/INTEGRITYCHECK`* or *`/INTEGRITYCHECK:NO`*. Choose **OK** to save your changes.
3229

3330
## See also
3431

3532
[MSVC linker reference](linking.md)<br/>
36-
[MSVC Linker Options](linker-options.md)<br/>
37-
[Forced Integrity Signing of Portable Executable (PE) files](https://social.technet.microsoft.com/wiki/contents/articles/255.forced-integrity-signing-of-portable-executable-pe-files.aspx)<br/>
38-
[Kernel-Mode Code Signing Requirements](/windows-hardware/drivers/install/kernel-mode-code-signing-requirements--windows-vista-and-later-)<br/>
33+
[MSVC linker options](linker-options.md)<br/>
34+
[Forced integrity signing of portable executable (PE) files](https://social.technet.microsoft.com/wiki/contents/articles/255.forced-integrity-signing-of-portable-executable-pe-files.aspx)<br/>
35+
[Kernel-mode code signing requirements](/windows-hardware/drivers/install/kernel-mode-code-signing-requirements--windows-vista-and-later-)<br/>
3936
[AppInit DLLs and Secure Boot](/windows/win32/dlls/secure-boot-and-appinit-dlls)

0 commit comments

Comments
 (0)