Skip to content

Commit 3ecc3d4

Browse files
authored
Merge pull request #34698 from bnbarham/prevent-diagnostic-database
Prevent superfluous diagnostic-database execution
2 parents 3a0ffbb + e9a80de commit 3ecc3d4

File tree

1 file changed

+12
-4
lines changed

1 file changed

+12
-4
lines changed

localization/CMakeLists.txt

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
1-
add_custom_target(diagnostic-database)
1+
set(diagnostic_witness "${CMAKE_BINARY_DIR}/share/swift/diagnostics/generated")
22

3-
add_custom_command(TARGET diagnostic-database
3+
add_custom_command(
4+
OUTPUT
5+
${diagnostic_witness}
46
COMMAND
57
${CMAKE_COMMAND} -E copy_directory ${CMAKE_CURRENT_SOURCE_DIR}/diagnostics/ ${CMAKE_BINARY_DIR}/share/swift/diagnostics/
68
COMMAND
@@ -10,11 +12,17 @@ add_custom_command(TARGET diagnostic-database
1012
"${SWIFT_NATIVE_SWIFT_TOOLS_PATH}/swift-serialize-diagnostics"
1113
--input-file-path ${CMAKE_BINARY_DIR}/share/swift/diagnostics/en.yaml
1214
--output-directory ${CMAKE_BINARY_DIR}/share/swift/diagnostics/
15+
COMMAND
16+
${CMAKE_COMMAND} -E touch ${diagnostic_witness}
17+
DEPENDS
18+
swift-def-to-yaml-converter
19+
swift-serialize-diagnostics
20+
# Add files in diagnostics subdirectory when they're created
1321
)
1422

23+
add_custom_target(diagnostic-database DEPENDS ${diagnostic_witness})
24+
1525
add_dependencies(swift-frontend diagnostic-database)
16-
add_dependencies(diagnostic-database swift-serialize-diagnostics)
17-
add_dependencies(diagnostic-database swift-def-to-yaml-converter)
1826

1927
swift_install_in_component(
2028
DIRECTORY ${CMAKE_BINARY_DIR}/share/swift/diagnostics/

0 commit comments

Comments
 (0)