Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

MSVC: Enable Edit & Continue in debug builds #7702

Merged
merged 1 commit into from
Feb 4, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -161,6 +161,9 @@ ipch/
# Visual Studio Trace Files
*.e2e

# Visual Studio Edit & Continue
enc_temp_folder

# TFS 2012 Local Workspace
$tf/

Expand Down
7 changes: 6 additions & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
cmake_minimum_required(VERSION 3.15)

foreach(_policy CMP0111 CMP0126 CMP0135)
foreach(_policy CMP0111 CMP0126 CMP0135 CMP0141)
if(POLICY ${_policy})
cmake_policy(SET ${_policy} NEW)
set(CMAKE_POLICY_DEFAULT_${_policy} NEW)
Expand Down Expand Up @@ -282,6 +282,11 @@ endif()
if(CMAKE_CXX_COMPILER_ID MATCHES "MSVC")
# u8path() function is deprecated but there is no sensible alternative and it might even get un-deprecated.
add_definitions(-D_SILENCE_CXX20_U8PATH_DEPRECATION_WARNING)
if(${CMAKE_VERSION} VERSION_GREATER_EQUAL "3.25")
# This enables Edit & Continue support, see https://learn.microsoft.com/en-us/cpp/build/cmake-projects-in-visual-studio#edit-and-continue-for-cmake-projects
set(CMAKE_MSVC_DEBUG_INFORMATION_FORMAT "$<$<CONFIG:Debug>:EditAndContinue>") # Sets /ZI compiler option, see https://cmake.org/cmake/help/latest/variable/CMAKE_MSVC_DEBUG_INFORMATION_FORMAT.html
add_link_options("$<$<CONFIG:Debug>:/INCREMENTAL>")
endif()
endif()

# Not a genexp because CMake doesn't support it
Expand Down
Loading