Skip to content

Commit 4c35e20

Browse files
committed
Enable per-target C++ module scanning in CMake configuration
- Moved `CXX_SCAN_FOR_MODULES` property to individual targets (`VulkanCppModule` and chapter names) for improved modularity and control.
1 parent 6200293 commit 4c35e20

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

attachments/CMakeLists.txt

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,5 @@
11
cmake_minimum_required (VERSION 3.29)
22

3-
# Enable C++ module dependency scanning
4-
set(CMAKE_CXX_SCAN_FOR_MODULES ON)
5-
63
project (VulkanTutorial)
74

85
list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_LIST_DIR}/CMake")
@@ -28,6 +25,7 @@ target_link_libraries(VulkanCppModule
2825
)
2926

3027
set_target_properties(VulkanCppModule PROPERTIES CXX_STANDARD 20)
28+
set_target_properties(VulkanCppModule PROPERTIES CXX_SCAN_FOR_MODULES ON)
3129

3230
target_sources(VulkanCppModule
3331
PUBLIC
@@ -103,6 +101,7 @@ function (add_chapter CHAPTER_NAME)
103101
set_target_properties (${CHAPTER_NAME} PROPERTIES
104102
RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/${CHAPTER_NAME})
105103
set_target_properties (${CHAPTER_NAME} PROPERTIES CXX_STANDARD 20)
104+
set_target_properties (${CHAPTER_NAME} PROPERTIES CXX_SCAN_FOR_MODULES ON)
106105
target_link_libraries (${CHAPTER_NAME} Vulkan::cppm glfw)
107106
target_include_directories (${CHAPTER_NAME} PRIVATE ${STB_INCLUDEDIR})
108107

0 commit comments

Comments
 (0)