Skip to content

[Frontend] Diagnostic translations re-org #32828

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Jul 14, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -1109,6 +1109,8 @@ if(SWIFT_INCLUDE_TOOLS)
add_subdirectory(tools)
endif()

add_subdirectory(localization)

add_subdirectory(utils)

add_subdirectory(userdocs)
Expand Down
3 changes: 0 additions & 3 deletions include/swift/AST/CMakeLists.txt

This file was deleted.

5 changes: 2 additions & 3 deletions lib/Frontend/CompilerInvocation.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -63,12 +63,11 @@ void CompilerInvocation::setMainExecutablePath(StringRef Path) {
"diagnostics");
DiagnosticOpts.DiagnosticDocumentationPath = std::string(DiagnosticDocsPath.str());

// Compute the path of the YAML diagnostic messages directory files
// in the toolchain.
// Compute the path to the diagnostic translations in the toolchain/build.
llvm::SmallString<128> DiagnosticMessagesDir(Path);
llvm::sys::path::remove_filename(DiagnosticMessagesDir); // Remove /swift
llvm::sys::path::remove_filename(DiagnosticMessagesDir); // Remove /bin
llvm::sys::path::append(DiagnosticMessagesDir, "share", "swift");
llvm::sys::path::append(DiagnosticMessagesDir, "share", "swift", "diagnostics");
DiagnosticOpts.LocalizationPath = std::string(DiagnosticMessagesDir.str());
}

Expand Down
14 changes: 14 additions & 0 deletions localization/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
add_custom_target(diagnostic-translation-database)

add_custom_command(
TARGET diagnostic-translation-database
WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}
DEPENDS diagnostics
COMMAND "${CMAKE_COMMAND}" -E copy_directory diagnostics/ "${SWIFT_BINARY_DIR}/share/swift/diagnostics/")

add_dependencies(swift-frontend diagnostic-translation-database)

swift_install_in_component(
DIRECTORY diagnostics
DESTINATION "share/swift"
COMPONENT compiler)
File renamed without changes.