Skip to content
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
7 changes: 3 additions & 4 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
cmake_minimum_required(VERSION 3.14...3.16)
list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/cmake/")
include(gsl_functions)

project(GSL VERSION 4.0.0 LANGUAGES CXX)

Expand All @@ -19,8 +17,7 @@ target_compile_features(GSL INTERFACE "cxx_std_14")
# Setup include directory
add_subdirectory(include)

# Add natvis file
gsl_add_native_visualizer_support()
target_sources(GSL INTERFACE $<BUILD_INTERFACE:${GSL_SOURCE_DIR}/GSL.natvis>)
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This does nothing on all platforms except for when generating a visual studio project.

In which case you get the .natvis experience that doesn't affect the PDB.


if (GSL_TEST)
enable_testing()
Expand All @@ -46,4 +43,6 @@ if (GSL_INSTALL)
write_basic_package_version_file(${gls_config_version} COMPATIBILITY SameMajorVersion ARCH_INDEPENDENT)

install(FILES ${gls_config_version} DESTINATION ${cmake_files_install_dir})

install(FILES GSL.natvis DESTINATION ${cmake_files_install_dir})
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Installing the file at least gives find_package users a chance to decide what they want to do. Versus nothing which is what they currently get.

endif()
4 changes: 1 addition & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -214,7 +214,5 @@ target_link_libraries(foobar PRIVATE Microsoft.GSL::GSL)
```

## Debugging visualization support
For Visual Studio users, the file [GSL.natvis](./GSL.natvis) in the root directory of the repository can be added to your project if you would like more helpful visualization of GSL types in the Visual Studio debugger than would be offered by default.

If you are using CMake this will be done automatically for you.
See `GSL_VS_ADD_NATIVE_VISUALIZERS`
For Visual Studio users, the file [GSL.natvis](./GSL.natvis) in the root directory of the repository can be added to your project if you would like more helpful visualization of GSL types in the Visual Studio debugger than would be offered by default.
20 changes: 0 additions & 20 deletions cmake/gsl_functions.cmake

This file was deleted.