Skip to content

Commit b327dbf

Browse files
authored
Merge pull request #32828 from xedin/translation-placement
[Frontend] Diagnostic translations re-org
2 parents 5c6c556 + 91cd0f0 commit b327dbf

File tree

5 files changed

+18
-6
lines changed

5 files changed

+18
-6
lines changed

CMakeLists.txt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1109,6 +1109,8 @@ if(SWIFT_INCLUDE_TOOLS)
11091109
add_subdirectory(tools)
11101110
endif()
11111111

1112+
add_subdirectory(localization)
1113+
11121114
add_subdirectory(utils)
11131115

11141116
add_subdirectory(userdocs)

include/swift/AST/CMakeLists.txt

Lines changed: 0 additions & 3 deletions
This file was deleted.

lib/Frontend/CompilerInvocation.cpp

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -63,12 +63,11 @@ void CompilerInvocation::setMainExecutablePath(StringRef Path) {
6363
"diagnostics");
6464
DiagnosticOpts.DiagnosticDocumentationPath = std::string(DiagnosticDocsPath.str());
6565

66-
// Compute the path of the YAML diagnostic messages directory files
67-
// in the toolchain.
66+
// Compute the path to the diagnostic translations in the toolchain/build.
6867
llvm::SmallString<128> DiagnosticMessagesDir(Path);
6968
llvm::sys::path::remove_filename(DiagnosticMessagesDir); // Remove /swift
7069
llvm::sys::path::remove_filename(DiagnosticMessagesDir); // Remove /bin
71-
llvm::sys::path::append(DiagnosticMessagesDir, "share", "swift");
70+
llvm::sys::path::append(DiagnosticMessagesDir, "share", "swift", "diagnostics");
7271
DiagnosticOpts.LocalizationPath = std::string(DiagnosticMessagesDir.str());
7372
}
7473

localization/CMakeLists.txt

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
add_custom_target(diagnostic-translation-database)
2+
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/")
8+
9+
add_dependencies(swift-frontend diagnostic-translation-database)
10+
11+
swift_install_in_component(
12+
DIRECTORY diagnostics
13+
DESTINATION "share/swift"
14+
COMPONENT compiler)

0 commit comments

Comments
 (0)