Skip to content

Commit

Permalink
MSVC: Enable Edit & Continue in debug builds
Browse files Browse the repository at this point in the history
  • Loading branch information
obligaron committed Feb 2, 2025
1 parent d9dc491 commit 9eaedba
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 1 deletion.
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
8 changes: 7 additions & 1 deletion CMake/functions/devilutionx_library.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,13 @@ function(add_devilutionx_library NAME)
target_link_libraries(${NAME} PUBLIC $<${DEVILUTIONX_STATIC_CXX_STDLIB_GENEX}:-static-libgcc;-static-libstdc++>)
endif()

if(NOT CMAKE_CXX_COMPILER_ID MATCHES "MSVC")
if(CMAKE_CXX_COMPILER_ID MATCHES "MSVC")
if(CMAKE_BUILD_TYPE STREQUAL "Debug")
# 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
target_compile_options(${NAME} PUBLIC "/ZI")
target_link_options(${NAME} PUBLIC "/INCREMENTAL")
endif()
else()
# Note: For Valgrind support.
genex_for_option(DEBUG)
target_compile_options(${NAME} PUBLIC $<${DEBUG_GENEX}:-fno-omit-frame-pointer>)
Expand Down

0 comments on commit 9eaedba

Please sign in to comment.