You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
A work-around the concats all natvis files together
natvis.cmake
function(concatenate_natvis_filesnatvis_filesout_file)
# Prepare the output file pathset(output_path "${CMAKE_BINARY_DIR}/${out_file}")
# Define the path to the Python scriptset(PYTHON_SCRIPT "${CMAKE_SOURCE_DIR}/dev/cmake/natvis.py")
# Call the Python script with the list of natvis files and the output pathadd_custom_command(
OUTPUT${output_path}COMMAND${CMAKE_COMMAND}-Eecho"Concatenating .natvis files..."COMMAND${CMAKE_COMMAND}-Eenvpython${PYTHON_SCRIPT}${natvis_files}${output_path}COMMENT"Running Python script to concatenate .natvis files and remove duplicates"DEPENDS${natvis_files}${PYTHON_SCRIPT}
)
# Ensure the output file is builtadd_custom_target(run_concat_natvisALLDEPENDS${output_path})
endfunction()
include(natvis)
option(MW_GENERATE_NATVIS"Generate a natvis file that includes all natvis files in the project"OFF)
if(MW_GENERATE_NATVIS)
# Find all .natvis files recursively under the specified directoryfile(GLOB_RECURSEnatvis_files"${CMAKE_SOURCE_DIR}/dev/*.natvis")
concatenate_natvis_files("${natvis_files}""all_natvis_files.natvis")
endif()
Activity
SimonQi1 commentedon Sep 6, 2023
Will it get support for multplie natvis files?when using cppvsdbg
aiyolo commentedon May 2, 2024
after several months, does this feature has any progress now?
sean-mcmanus commentedon May 2, 2024
aiyolo (@aiyolo) No. It's currently the 10th most upvoted debugger feature: https://github.com/Microsoft/vscode-cpptools/issues?q=is%3Aissue+is%3Aopen+sort%3Areactions-%2B1-desc+label%3Adebugger
dimateos commentedon May 17, 2024
Yeah, I use cppvsdbg and this is a bummer. I tend to use many natvis for boost https://github.com/KindDragon/CPPDebuggerVisualizers...
But I would still prefer a directory (or list of them) to simply target many natvis files microsoft/MIEngine#1049
bradphelan commentedon Jun 25, 2024
A work-around the concats all natvis files together
natvis.cmake
natvis.py
In your main CMakeLists.txt
test: Add a test project for natvis files