Simplify vcxproj file - Remove explicit defaults - #45
Merged
Conversation
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`.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Remove explicit default settings in
.vcxprojfile 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:
DebugInformationFormatOP2Utility#457