Skip to content

Commit 0103b79

Browse files
committed
[Localization] Adjust cmake to include serialized diagnostics in toolchain
Building of the diagnostic database to be done in three steps: - Copy YAMLs from <source>/localization/diagnostics to <build>/share/swift/diagnostics - Serialize English into <build>/share/swift/diagnostics - Install everything (YAML and `.db`) from <build>/share/swift/diagnostics to share/swift/diagnostics in toolchain
1 parent 8d8da1b commit 0103b79

File tree

1 file changed

+12
-16
lines changed

1 file changed

+12
-16
lines changed

localization/CMakeLists.txt

Lines changed: 12 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,17 @@
1-
add_custom_target(diagnostic-translation-database)
1+
add_custom_target(diagnostic-database)
22

3-
add_custom_command(
4-
TARGET diagnostic-translation-database
5-
WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}
6-
DEPENDS diagnostics
7-
COMMAND "${CMAKE_COMMAND}" -E copy_directory diagnostics/ "${SWIFT_BINARY_DIR}/share/swift/diagnostics/")
3+
add_custom_command(TARGET diagnostic-database
4+
COMMAND
5+
${CMAKE_COMMAND} -E copy_directory ${CMAKE_CURRENT_SOURCE_DIR}/diagnostics/ ${CMAKE_BINARY_DIR}/share/swift/diagnostics/
6+
COMMAND
7+
swift-serialize-diagnostics
8+
--input-file-path ${CMAKE_BINARY_DIR}/share/swift/diagnostics/en.yaml
9+
--output-directory ${CMAKE_BINARY_DIR}/share/swift/diagnostics/
10+
)
811

9-
add_custom_command(
10-
TARGET diagnostic-translation-database
11-
WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}
12-
COMMAND swift-serialize-diagnostics
13-
--input-file-path diagnostics/en.yaml
14-
--output-directory ${SWIFT_BINARY_DIR}/share/swift/diagnostics)
15-
16-
add_dependencies(swift-frontend diagnostic-translation-database)
12+
add_dependencies(swift-frontend diagnostic-database)
1713

1814
swift_install_in_component(
19-
DIRECTORY diagnostics
20-
DESTINATION "share/swift"
15+
DIRECTORY ${CMAKE_BINARY_DIR}/share/swift/diagnostics/
16+
DESTINATION "share/swift/diagnostics"
2117
COMPONENT compiler)

0 commit comments

Comments
 (0)