forked from swiftlang/swift
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathCMakeLists.txt
34 lines (30 loc) · 1.14 KB
/
CMakeLists.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
set(diagnostic_witness "${CMAKE_BINARY_DIR}/share/swift/diagnostics/generated")
add_custom_command(
OUTPUT
${diagnostic_witness}
COMMAND
${CMAKE_COMMAND} -E copy_directory ${CMAKE_CURRENT_SOURCE_DIR}/diagnostics/ ${CMAKE_BINARY_DIR}/share/swift/diagnostics/
COMMAND
"${SWIFT_NATIVE_SWIFT_TOOLS_PATH}/swift-def-to-yaml-converter"
--output-directory ${CMAKE_BINARY_DIR}/share/swift/diagnostics/
COMMAND
"${SWIFT_NATIVE_SWIFT_TOOLS_PATH}/swift-serialize-diagnostics"
--input-file-path ${CMAKE_BINARY_DIR}/share/swift/diagnostics/en.yaml
--output-directory ${CMAKE_BINARY_DIR}/share/swift/diagnostics/
COMMAND
${CMAKE_COMMAND} -E touch ${diagnostic_witness}
DEPENDS
swift-def-to-yaml-converter
swift-serialize-diagnostics
# Add files in diagnostics subdirectory when they're created
)
add_custom_target(diagnostic-database DEPENDS ${diagnostic_witness})
add_dependencies(swift-frontend diagnostic-database)
swift_install_in_component(
DIRECTORY ${CMAKE_BINARY_DIR}/share/swift/diagnostics/
DESTINATION "share/swift/diagnostics"
COMPONENT compiler
FILES_MATCHING
PATTERN "*.db"
PATTERN "*.yaml"
)