Made Swift 6 local translation support optional.
Esse commit está contido em:
@@ -97,7 +97,9 @@ PRIVATE
|
||||
desktop-app::external_xxhash
|
||||
)
|
||||
|
||||
telegram_add_apple_swift_runtime(Telegram)
|
||||
if (NOT DESKTOP_APP_DISABLE_SWIFT6)
|
||||
telegram_add_apple_swift_runtime(Telegram)
|
||||
endif()
|
||||
|
||||
target_precompile_headers(Telegram PRIVATE $<$<COMPILE_LANGUAGE:CXX,OBJCXX>:${src_loc}/stdafx.h>)
|
||||
nice_target_sources(Telegram ${src_loc}
|
||||
|
||||
@@ -7,6 +7,8 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
|
||||
*/
|
||||
#include "platform/mac/translate_provider_mac.h"
|
||||
|
||||
#ifndef TDESKTOP_DISABLE_SWIFT6
|
||||
|
||||
#include "base/weak_ptr.h"
|
||||
#include "spellcheck/platform/platform_language.h"
|
||||
#include "translate_provider_mac_swift_bridge.h"
|
||||
@@ -102,4 +104,19 @@ bool IsTranslateProviderAvailable() {
|
||||
return TranslateProviderMacSwiftIsAvailable();
|
||||
}
|
||||
|
||||
#else // TDESKTOP_DISABLE_SWIFT6
|
||||
|
||||
// Local on-device translation disabled (no Swift 6).
|
||||
namespace Platform {
|
||||
|
||||
std::unique_ptr<Ui::TranslateProvider> CreateTranslateProvider() {
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
bool IsTranslateProviderAvailable() {
|
||||
return false;
|
||||
}
|
||||
|
||||
#endif // TDESKTOP_DISABLE_SWIFT6
|
||||
|
||||
} // namespace Platform
|
||||
|
||||
@@ -51,3 +51,8 @@ endif()
|
||||
if (DESKTOP_APP_SPECIAL_TARGET)
|
||||
target_compile_definitions(Telegram PRIVATE TDESKTOP_ALLOW_CLOSED_ALPHA)
|
||||
endif()
|
||||
|
||||
option(DESKTOP_APP_DISABLE_SWIFT6 "Disable local on-device translation (build without Swift 6 on macOS)." OFF)
|
||||
if (DESKTOP_APP_DISABLE_SWIFT6)
|
||||
target_compile_definitions(Telegram PRIVATE TDESKTOP_DISABLE_SWIFT6)
|
||||
endif()
|
||||
|
||||
+1
-1
Submodule Telegram/lib_translate updated: 2eb70a8cce...09c1072622
Referência em uma Nova Issue
Bloquear um usuário