Official "Just My Code" support in CMake for MSVC
Microsoft Visual Studio 2017 added a new feature in 15.8 named Just My Code. This allows skipping over third party libraries when stepping through code while debugging. Right now I turn this on in CMake via the following code:
# Enable "Just My Code" feature introduced in MSVC 15.8 (Visual Studio 2017)
# See https://blogs.msdn.microsoft.com/vcblog/2018/06/29/announcing-jmc-stepping-in-visual-studio/
#
# For MSVC version numbering used here, see:
# https://en.wikipedia.org/wiki/Microsoft_Visual_C%2B%2B#Internal_version_numbering
if( CMAKE_CXX_COMPILER_VERSION VERSION_GREATER_EQUAL "19.15" )
add_compile_options( /JMC )
endif()
This does not cause the respective option to be flipped to "Yes" in the GUI Project Settings dialog:
Rather, it shows up under "Command Line":
I've seen other compile flags properly map to properties in the GUI before, I'm not sure if this is CMake's doing or not. Should there be a property for this in CMake? It would be nice if this was turned on by CMake by default, without any special intervention by scripts. Thoughts?
Edited by Robert Dailey