Skip to content

Add modern MSVC security/optimization switches to msvc.cmake and clang.cmake#594

Draft
Copilot wants to merge 2 commits intomasterfrom
copilot/add-modern-msvc-build-switches
Draft

Add modern MSVC security/optimization switches to msvc.cmake and clang.cmake#594
Copilot wants to merge 2 commits intomasterfrom
copilot/add-modern-msvc-build-switches

Conversation

Copy link
Copy Markdown

Copilot AI commented Apr 14, 2026

msvc.cmake was missing several modern MSVC compiler and linker hardening/optimization flags, including control flow guard, CET compatibility, EH continuation metadata, and linker optimizations that /DEBUG implicitly disables.

Changes

  • /GF — Added to COMMON_CXX_FLAGS for all build types (eliminate duplicate strings)
  • /guard:cf — Added to Release and RelWithDebInfo compiler flags (control flow guard)
  • /INCREMENTAL:NO — Added to all linker configurations (Debug, Release, RelWithDebInfo)
  • /OPT:REF /OPT:ICF — Added to Debug and RelWithDebInfo linker flags to restore optimizations suppressed by /DEBUG
  • /CETCOMPAT — Added conditionally for MSVC ≥ 19.27 / clang-cl ≥ 13.0 on x64 (CET shadow stack)
  • /guard:ehcont — Added conditionally for MSVC_VERSION ≥ 1928 / clang-cl ≥ 13.0 on x64, compiler + linker, Release and RelWithDebInfo only

The same changes are applied to the Windows section of clang.cmake with equivalent version guards.

Agent-Logs-Url: https://github.com/RenderKit/embree/sessions/02dfbe47-c2bf-46f2-af93-e2f6a9855a0a

Co-authored-by: stefanatwork <93931354+stefanatwork@users.noreply.github.com>
Copilot AI changed the title [WIP] Update msvc.cmake to include modern MSVC build switches Add modern MSVC security/optimization switches to msvc.cmake and clang.cmake Apr 14, 2026
Copilot AI requested a review from stefanatwork April 14, 2026 12:33
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.

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

2 participants