microsoft/GSL

Make files visible in generated Visual Studio solution

オープン

#1,216 opened on 2025/09/26

 (4 件のコメント) (0 件のリアクション) (0 人の担当者)C++ (721 件のフォーク)batch import
Help WantedPriority: LowStatus: Open

Repository metrics

Stars
 (5,695 個のスター)
PR merge metrics
 (PR metrics pending)

説明

If you generate a Visual studio solution from the current CMake the GSL headers like algorithm and assert don't appear. The only way you seem to be able to see them is to open a test like algorithm_tests.cpp and then do a "Go to document" on a line like #include <gsl/algorithm>. In my local copy I added the following

add_custom_target(include SOURCES
    gsl/algorithm
    gsl/assert
    gsl/byte
    gsl/gsl
    gsl/narrow
    gsl/pointers	
    gsl/span
    gsl/span_ext
    gsl/util	
    gsl/zstring		
)

But I am sure that is the wrong way to do it.

I also added

set(SolutionItems
    .clang-format
    .gitattributes
    .gitignore
    CMakeSettings.json
    CONTRIBUTING.md
    LICENSE
    README.md
    SECURITY.md
    ThirdPartyNotices.txt)
set_property(DIRECTORY APPEND PROPERTY VS_SOLUTION_ITEMS ${SolutionItems})

This makes all these files appears in the "Solution Items" folder in the IDE which is super useful.

コントリビューターガイド