Skip to content

Commit 297b489

Browse files
committed
Remove the check for the Visual Studio generator; the generator may be Ninja on Windows, and adding the headers to the project may be useful on non-Windows
1 parent 70bf9b6 commit 297b489

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

CMakeLists.txt

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ target_link_libraries(boost_assert
1919

2020
# Add headers and .natvis to project, for better IDE integration
2121

22-
if(CMAKE_VERSION VERSION_GREATER 3.18 AND CMAKE_GENERATOR MATCHES "Visual Studio")
22+
if(CMAKE_VERSION VERSION_GREATER 3.18)
2323

2424
# Using target_sources with PRIVATE or PUBLIC on INTERFACE targets requires 3.19
2525

@@ -28,7 +28,12 @@ if(CMAKE_VERSION VERSION_GREATER 3.18 AND CMAKE_GENERATOR MATCHES "Visual Studio
2828
target_sources(boost_assert PRIVATE ${boost_assert_HEADERS})
2929
unset(boost_assert_HEADERS)
3030

31-
target_sources(boost_assert PUBLIC extra/boost_assert.natvis)
31+
if(MSVC)
32+
33+
# Only Visual Studio needs this, but the generator may also be Ninja
34+
target_sources(boost_assert PUBLIC extra/boost_assert.natvis)
35+
36+
endif()
3237

3338
endif()
3439

0 commit comments

Comments
 (0)