Skip to content

Simplify vcxproj file - Remove explicit defaults - #45

Merged
DanRStevens merged 11 commits into
mainfrom
simplifyVcxprojFile
Aug 13, 2026
Merged

Simplify vcxproj file - Remove explicit defaults#45
DanRStevens merged 11 commits into
mainfrom
simplifyVcxprojFile

Conversation

@DanRStevens

Copy link
Copy Markdown
Member

Remove explicit default settings in .vcxproj file and normalize setting order.

This makes it easier to compare settings between configurations, and to see more clearly which non-default settings are being used that may require some attention.

Related:

The `IntrinsicFunctions` (`/Oi`) and `FunctionLevelLinking` (`/Gy`) settings are implied by the `Optimization` setting of `MaxSpeed` (`/O2`). The `/O2` flag implies: `/Og` `/Oi` `/Ot` `/Oy` `/Ob2` `/GF` `/Gy`
For `Debug` builds (`UseDebugLibraries` set to `true`) the default for `Optimization` is `Disabled` (`/Od`).

For `Release` builds (`UseDebugLibraries` not set to `true`) the default for `Optimization` is `MaxSpeed` (`/O2`).
For `Debug` builds (`UseDebugLibraries` set to `true`) the `RuntimeLibrary` setting defaults to `MultiThreadedDebugDll`.

For `Release` builds (`UseDebugLibraries` not set to `true`) the `RuntimeLibrary` setting defaults to `MultiThreadedDll`.
Oddly this setting was only specified in 3 out of 4 configurations.

----

According to `msbuild` file the default value for `ConformanceMode` is `Default`, which will be enabled for this project since it targets `stdcpp20`.

Documentation:
https://learn.microsoft.com/en-us/cpp/build/reference/permissive-standards-conformance?view=msvc-170
> The `/permissive-` option is implicitly set by the `/std:c++latest` option starting in Visual Studio 2019 version 16.8, and in version 16.11 by the `/std:c++20` option.

New projects created with Visual Studio 2026 typically have `ConformanceMode` set to `true`, though not for all project types. In particular a new Google Test project doesn't set `ConformanceMode`.

The documentation had a note about setting `ConformanceMode` for new projects:
> By default, the /permissive- option is set in new projects created by Visual Studio 2017 version 15.5 and later versions. It's not set by default in earlier versions.

Given the default, this doesn't appear to be needed for newer versions of Visual Studio targetting `c++20`.

----

Related:
- PR lairworks/nas2d-core#1479
- Commit lairworks/nas2d-core@6ad937d
The last configuration had this setting placed differently than the other configurations. Placing it first seems like a logical position. In particular, it is common among all configuration settings, and should be grouped with other common settings. The last couple of settings vary a bit by configuration, so better to place it before those settings.
According to the documentation the `/DEBUG` flag is equivalent to `/DEBUG:FULL`. According to MSBuild files, the default for `GenerateDebugInformation` is `DebugFull`. Hence there doesn't seem to be a reason to override the default value with an equivalent non-default value.

Documentation:
https://learn.microsoft.com/en-us/cpp/build/reference/debug-generate-debug-info?view=msvc-180
The `AdditionalIncludeDirectories` setting is identical for all configurations, so it's probably better to group it with the other common settings. The common grouping means larger blocks of text can be searched or replaced. Meanwhile the `PreprocessorDefinitions` setting varies by configuration.
The `WholeProgramOptimization` setting is unique to `Release` configurations, so placing it last means other settings common to all configurations can be grouped together. This maximizes the size of text blocks that can be searched or replaced.
The `UseDebugLibraries` setting is currently common to all configurations, though the value differs by `Debug` or `Release` configurations. By moving it to the end of the common value block we maximize the size of common text that can be searched or replaced.
When not specified the `UseDebugLibraries` defaults to `false`.
@DanRStevens
DanRStevens merged commit afc6c08 into main Aug 13, 2026
4 checks passed
@DanRStevens
DanRStevens deleted the simplifyVcxprojFile branch August 13, 2026 15:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant