Skip to content

msvc.cmake is missing a lot of modern MSVC build switches #593

@walbourn

Description

@walbourn
  • Since you force /DEBUG for the linker in release it generates PDBs which is great. It, however, ALSO disables /OPT:REF,ICF so you should be adding that back in.

  • The linker should use /CETCOMPAT for CMAKE_CXX_COMPILER_VERSION VERSION_GREATER_EQUAL 19.27

  • Compiler switch /guard:cf needs to be on for release

  • Compiler and linker should use /guard:ehcont for MSVC_VERSION GREATER_EQUAL 1928

  • Linker for release should use /INCREMENTAL:NO

  • The release build is missing /GF so it doesn't remove duplicate strings. Was this intentional?

See https://github.com/walbourn/directx-vs-templates/blob/main/build/CompilerAndLinker.cmake for a full set of switches and compiler versions.

Metadata

Metadata

Labels

No labels
No labels

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions