aboutsummaryrefslogtreecommitdiffstats
path: root/library
diff options
context:
space:
mode:
authorshokhor <shokhor@yandex-team.com>2023-09-19 05:45:26 +0300
committershokhor <shokhor@yandex-team.com>2023-09-19 06:02:49 +0300
commitae87be2b19d1d4e6a5c7bad6650381690b5dfe9d (patch)
treee3dd23427bd7e3eda2785c33de59cf1ac9f07e1d /library
parent1df0281596525a87ffe350f2e94b91e10fa46bca (diff)
downloadydb-ae87be2b19d1d4e6a5c7bad6650381690b5dfe9d.tar.gz
Introduce library/cpp/charset/lite which excludes functionality with dependency on libiconv
Introduce library/cpp/charset/lite which excludes functionality with dependency on libiconv Задача: - выпилить зависимость от libiconv в библиотеке клавиатуры для андроид libiconv приходит из двух мест: - dict/dictutil - library/cpp/charset В обоих случаях libiconv используется в вариантах CharToWide/WideToChar для перекодировки. Первый кейс dictutil - клавиатура для релиза строится с ключом DICTUTIL_WITHOUT_ICONV_AND_UNICODE, который исключает зависимость. Следующий шаг сделать флаг по умолчанию для мобильных билдов. Второй кейс library/cpp/charset: 1. Шаг - выделяем библиотеку library/cpp/charset/lite без части функциональности, зависящей от libiconv (этот ПР) 2. Шаг - переводим библиотеки, используемые клавиатурой на lite версию (следующий ПР)
Diffstat (limited to 'library')
-rw-r--r--library/cpp/charset/CMakeLists.darwin-x86_64.txt9
-rw-r--r--library/cpp/charset/CMakeLists.linux-aarch64.txt9
-rw-r--r--library/cpp/charset/CMakeLists.linux-x86_64.txt9
-rw-r--r--library/cpp/charset/CMakeLists.windows-x86_64.txt9
-rw-r--r--library/cpp/charset/README.md2
-rw-r--r--library/cpp/charset/codepage.cpp117
-rw-r--r--library/cpp/charset/decodeunknownplane.cpp121
-rw-r--r--library/cpp/charset/lite/CMakeLists.darwin-x86_64.txt22
-rw-r--r--library/cpp/charset/lite/CMakeLists.linux-aarch64.txt23
-rw-r--r--library/cpp/charset/lite/CMakeLists.linux-x86_64.txt23
-rw-r--r--library/cpp/charset/lite/CMakeLists.txt17
-rw-r--r--library/cpp/charset/lite/CMakeLists.windows-x86_64.txt22
-rw-r--r--library/cpp/charset/lite/ut/ya.make10
-rw-r--r--library/cpp/charset/lite/ya.make18
-rw-r--r--library/cpp/charset/ut/ya.make2
-rw-r--r--library/cpp/charset/ya.make9
16 files changed, 273 insertions, 149 deletions
diff --git a/library/cpp/charset/CMakeLists.darwin-x86_64.txt b/library/cpp/charset/CMakeLists.darwin-x86_64.txt
index 3dd7934c11..04a8e24de1 100644
--- a/library/cpp/charset/CMakeLists.darwin-x86_64.txt
+++ b/library/cpp/charset/CMakeLists.darwin-x86_64.txt
@@ -6,19 +6,16 @@
# original buildsystem will not be accepted.
+add_subdirectory(lite)
add_library(library-cpp-charset)
target_link_libraries(library-cpp-charset PUBLIC
contrib-libs-cxxsupp
yutil
+ cpp-charset-lite
)
target_sources(library-cpp-charset PRIVATE
- ${CMAKE_SOURCE_DIR}/library/cpp/charset/generated/cp_data.cpp
- ${CMAKE_SOURCE_DIR}/library/cpp/charset/generated/encrec_data.cpp
- ${CMAKE_SOURCE_DIR}/library/cpp/charset/codepage.cpp
- ${CMAKE_SOURCE_DIR}/library/cpp/charset/cp_encrec.cpp
- ${CMAKE_SOURCE_DIR}/library/cpp/charset/doccodes.cpp
+ ${CMAKE_SOURCE_DIR}/library/cpp/charset/decodeunknownplane.cpp
${CMAKE_SOURCE_DIR}/library/cpp/charset/iconv.cpp
- ${CMAKE_SOURCE_DIR}/library/cpp/charset/ci_string.cpp
${CMAKE_SOURCE_DIR}/library/cpp/charset/wide.cpp
)
diff --git a/library/cpp/charset/CMakeLists.linux-aarch64.txt b/library/cpp/charset/CMakeLists.linux-aarch64.txt
index ff528662af..9d456b690b 100644
--- a/library/cpp/charset/CMakeLists.linux-aarch64.txt
+++ b/library/cpp/charset/CMakeLists.linux-aarch64.txt
@@ -6,20 +6,17 @@
# original buildsystem will not be accepted.
+add_subdirectory(lite)
add_library(library-cpp-charset)
target_link_libraries(library-cpp-charset PUBLIC
contrib-libs-linux-headers
contrib-libs-cxxsupp
yutil
+ cpp-charset-lite
)
target_sources(library-cpp-charset PRIVATE
- ${CMAKE_SOURCE_DIR}/library/cpp/charset/generated/cp_data.cpp
- ${CMAKE_SOURCE_DIR}/library/cpp/charset/generated/encrec_data.cpp
- ${CMAKE_SOURCE_DIR}/library/cpp/charset/codepage.cpp
- ${CMAKE_SOURCE_DIR}/library/cpp/charset/cp_encrec.cpp
- ${CMAKE_SOURCE_DIR}/library/cpp/charset/doccodes.cpp
+ ${CMAKE_SOURCE_DIR}/library/cpp/charset/decodeunknownplane.cpp
${CMAKE_SOURCE_DIR}/library/cpp/charset/iconv.cpp
- ${CMAKE_SOURCE_DIR}/library/cpp/charset/ci_string.cpp
${CMAKE_SOURCE_DIR}/library/cpp/charset/wide.cpp
)
diff --git a/library/cpp/charset/CMakeLists.linux-x86_64.txt b/library/cpp/charset/CMakeLists.linux-x86_64.txt
index ff528662af..9d456b690b 100644
--- a/library/cpp/charset/CMakeLists.linux-x86_64.txt
+++ b/library/cpp/charset/CMakeLists.linux-x86_64.txt
@@ -6,20 +6,17 @@
# original buildsystem will not be accepted.
+add_subdirectory(lite)
add_library(library-cpp-charset)
target_link_libraries(library-cpp-charset PUBLIC
contrib-libs-linux-headers
contrib-libs-cxxsupp
yutil
+ cpp-charset-lite
)
target_sources(library-cpp-charset PRIVATE
- ${CMAKE_SOURCE_DIR}/library/cpp/charset/generated/cp_data.cpp
- ${CMAKE_SOURCE_DIR}/library/cpp/charset/generated/encrec_data.cpp
- ${CMAKE_SOURCE_DIR}/library/cpp/charset/codepage.cpp
- ${CMAKE_SOURCE_DIR}/library/cpp/charset/cp_encrec.cpp
- ${CMAKE_SOURCE_DIR}/library/cpp/charset/doccodes.cpp
+ ${CMAKE_SOURCE_DIR}/library/cpp/charset/decodeunknownplane.cpp
${CMAKE_SOURCE_DIR}/library/cpp/charset/iconv.cpp
- ${CMAKE_SOURCE_DIR}/library/cpp/charset/ci_string.cpp
${CMAKE_SOURCE_DIR}/library/cpp/charset/wide.cpp
)
diff --git a/library/cpp/charset/CMakeLists.windows-x86_64.txt b/library/cpp/charset/CMakeLists.windows-x86_64.txt
index 2be179087c..3756311ac1 100644
--- a/library/cpp/charset/CMakeLists.windows-x86_64.txt
+++ b/library/cpp/charset/CMakeLists.windows-x86_64.txt
@@ -7,20 +7,17 @@
find_package(Iconv REQUIRED)
+add_subdirectory(lite)
add_library(library-cpp-charset)
target_link_libraries(library-cpp-charset PUBLIC
contrib-libs-cxxsupp
yutil
+ cpp-charset-lite
Iconv::Iconv
)
target_sources(library-cpp-charset PRIVATE
- ${CMAKE_SOURCE_DIR}/library/cpp/charset/generated/cp_data.cpp
- ${CMAKE_SOURCE_DIR}/library/cpp/charset/generated/encrec_data.cpp
- ${CMAKE_SOURCE_DIR}/library/cpp/charset/codepage.cpp
- ${CMAKE_SOURCE_DIR}/library/cpp/charset/cp_encrec.cpp
- ${CMAKE_SOURCE_DIR}/library/cpp/charset/doccodes.cpp
+ ${CMAKE_SOURCE_DIR}/library/cpp/charset/decodeunknownplane.cpp
${CMAKE_SOURCE_DIR}/library/cpp/charset/iconv.cpp
- ${CMAKE_SOURCE_DIR}/library/cpp/charset/ci_string.cpp
${CMAKE_SOURCE_DIR}/library/cpp/charset/wide.cpp
)
diff --git a/library/cpp/charset/README.md b/library/cpp/charset/README.md
index 9a257e3b4d..6878cbf4f5 100644
--- a/library/cpp/charset/README.md
+++ b/library/cpp/charset/README.md
@@ -8,3 +8,5 @@
3. [Класс `TCiString`](https://a.yandex-team.ru/arc/trunk/arcadia/library/cpp/charset/ci_string.h) - аналог `TString`, но использующий case-insensitive-компаратор и хеш и поддерживающий разные кодировки.
В комплекте есть ещё много функций для работы со старой однобайтной Yandex-кодировкой. Не рекомендуется к использованию. Для преобразования из UTF-8 в `TUtf16String` и для работы с Unicode используйте функции из [arcadia/util/charset](https://a.yandex-team.ru/arc/trunk/arcadia/util/charset).
+
+Библиотека library/cpp/charset/lite - содержит часть функциональности, не зависящей от libiconv (e.g. пункты 2 и 3 из основной библиотеки)
diff --git a/library/cpp/charset/codepage.cpp b/library/cpp/charset/codepage.cpp
index 0431bef31b..d75dbe6b6a 100644
--- a/library/cpp/charset/codepage.cpp
+++ b/library/cpp/charset/codepage.cpp
@@ -1,6 +1,4 @@
#include "ci_string.h"
-#include "wide.h"
-#include "recyr.hh"
#include "codepage.h"
#include <util/string/cast.h>
@@ -203,121 +201,6 @@ ECharset CharsetByNameOrDie(TStringBuf name) {
return result;
}
-template <typename TxChar>
-static inline RECODE_RESULT utf8_read_rune_from_unknown_plane(TxChar& rune, size_t& rune_len, const TxChar* s, const TxChar* end) {
- if ((*s & 0xFF00) != 0xF000) {
- rune_len = 1;
- rune = *s;
- return RECODE_OK;
- }
-
- rune_len = 0;
-
- size_t _len = UTF8RuneLen((unsigned char)(*s));
- if (s + _len > end)
- return RECODE_EOINPUT; //[EOINPUT]
- if (_len == 0)
- return RECODE_BROKENSYMBOL; //[BROKENSYMBOL] in first byte
-
- wchar32 _rune = (ui8)(*s++); //[00000000 0XXXXXXX]
- if (_len > 1) {
- _rune &= UTF8LeadByteMask(_len);
- wchar32 ch = *s++;
- if ((ch & 0xFFC0) != 0xF080)
- return RECODE_BROKENSYMBOL; //[BROKENSYMBOL] in second byte
- _rune <<= 6;
- _rune |= ch & 0x3F; //[00000XXX XXYYYYYY]
- if (_len > 2) {
- ch = *s++;
- if ((ch & 0xFFC0) != 0xF080)
- return RECODE_BROKENSYMBOL; //[BROKENSYMBOL] in third byte
- _rune <<= 6;
- _rune |= ch & 0x3F; //[XXXXYYYY YYZZZZZZ]
- if (_len > 3) {
- ch = *s;
- if ((ch & 0xFFC0) != 0xF080)
- return RECODE_BROKENSYMBOL; //[BROKENSYMBOL] in fourth byte
- _rune <<= 6;
- _rune |= ch & 0x3F; //[XXXYY YYYYZZZZ ZZQQQQQQ]
- }
- }
- }
- rune_len = _len;
- if (_rune > Max<TxChar>())
- rune = ' '; // maybe put sequence
- else
- rune = TxChar(_rune);
- return RECODE_OK;
-}
-
-template <typename TxChar>
-void DoDecodeUnknownPlane(TxChar* str, TxChar*& ee, const ECharset enc) {
- TxChar* e = ee;
- if (SingleByteCodepage(enc)) {
- const CodePage* cp = CodePageByCharset(enc);
- for (TxChar* s = str; s < e; s++) {
- if (Hi8(Lo16(*s)) == 0xF0)
- *s = (TxChar)cp->unicode[Lo8(Lo16(*s))]; // NOT mb compliant
- }
- } else if (enc == CODES_UTF8) {
- TxChar* s;
- TxChar* d;
-
- for (s = d = str; s < e;) {
- size_t l = 0;
-
- if (utf8_read_rune_from_unknown_plane(*d, l, s, e) == RECODE_OK) {
- d++, s += l;
- } else {
- *d++ = BROKEN_RUNE;
- ++s;
- }
- }
- e = d;
- } else if (enc == CODES_UNKNOWN) {
- for (TxChar* s = str; s < e; s++) {
- if (Hi8(Lo16(*s)) == 0xF0)
- *s = Lo8(Lo16(*s));
- }
- } else {
- Y_ASSERT(!SingleByteCodepage(enc));
-
- TxChar* s = str;
- TxChar* d = str;
-
- TVector<char> buf;
-
- size_t read = 0;
- size_t written = 0;
- for (; s < e; ++s) {
- if (Hi8(Lo16(*s)) == 0xF0) {
- buf.push_back(Lo8(Lo16(*s)));
- } else {
- if (!buf.empty()) {
- if (RecodeToUnicode(enc, buf.data(), d, buf.size(), e - d, read, written) == RECODE_OK) {
- Y_ASSERT(read == buf.size());
- d += written;
- } else { // just copying broken symbols
- Y_ASSERT(buf.size() <= static_cast<size_t>(e - d));
- Copy(buf.data(), buf.size(), d);
- d += buf.size();
- }
- buf.clear();
- }
- *d++ = *s;
- }
- }
- }
- ee = e;
-}
-
-void DecodeUnknownPlane(wchar16* str, wchar16*& ee, const ECharset enc) {
- DoDecodeUnknownPlane(str, ee, enc);
-}
-void DecodeUnknownPlane(wchar32* str, wchar32*& ee, const ECharset enc) {
- DoDecodeUnknownPlane(str, ee, enc);
-}
-
namespace {
class THashSetType: public THashSet<TString> {
public:
diff --git a/library/cpp/charset/decodeunknownplane.cpp b/library/cpp/charset/decodeunknownplane.cpp
new file mode 100644
index 0000000000..201a25cd54
--- /dev/null
+++ b/library/cpp/charset/decodeunknownplane.cpp
@@ -0,0 +1,121 @@
+#include "ci_string.h"
+#include "codepage.h"
+#include "recyr.hh"
+
+#include <util/system/hi_lo.h>
+#include <util/generic/vector.h>
+
+template <typename TxChar>
+static inline RECODE_RESULT utf8_read_rune_from_unknown_plane(TxChar& rune, size_t& rune_len, const TxChar* s, const TxChar* end) {
+ if ((*s & 0xFF00) != 0xF000) {
+ rune_len = 1;
+ rune = *s;
+ return RECODE_OK;
+ }
+
+ rune_len = 0;
+
+ size_t _len = UTF8RuneLen((unsigned char)(*s));
+ if (s + _len > end)
+ return RECODE_EOINPUT; //[EOINPUT]
+ if (_len == 0)
+ return RECODE_BROKENSYMBOL; //[BROKENSYMBOL] in first byte
+
+ wchar32 _rune = (ui8)(*s++); //[00000000 0XXXXXXX]
+ if (_len > 1) {
+ _rune &= UTF8LeadByteMask(_len);
+ wchar32 ch = *s++;
+ if ((ch & 0xFFC0) != 0xF080)
+ return RECODE_BROKENSYMBOL; //[BROKENSYMBOL] in second byte
+ _rune <<= 6;
+ _rune |= ch & 0x3F; //[00000XXX XXYYYYYY]
+ if (_len > 2) {
+ ch = *s++;
+ if ((ch & 0xFFC0) != 0xF080)
+ return RECODE_BROKENSYMBOL; //[BROKENSYMBOL] in third byte
+ _rune <<= 6;
+ _rune |= ch & 0x3F; //[XXXXYYYY YYZZZZZZ]
+ if (_len > 3) {
+ ch = *s;
+ if ((ch & 0xFFC0) != 0xF080)
+ return RECODE_BROKENSYMBOL; //[BROKENSYMBOL] in fourth byte
+ _rune <<= 6;
+ _rune |= ch & 0x3F; //[XXXYY YYYYZZZZ ZZQQQQQQ]
+ }
+ }
+ }
+ rune_len = _len;
+ if (_rune > Max<TxChar>())
+ rune = ' '; // maybe put sequence
+ else
+ rune = TxChar(_rune);
+ return RECODE_OK;
+}
+
+template <typename TxChar>
+void DoDecodeUnknownPlane(TxChar* str, TxChar*& ee, const ECharset enc) {
+ TxChar* e = ee;
+ if (SingleByteCodepage(enc)) {
+ const CodePage* cp = CodePageByCharset(enc);
+ for (TxChar* s = str; s < e; s++) {
+ if (Hi8(Lo16(*s)) == 0xF0)
+ *s = (TxChar)cp->unicode[Lo8(Lo16(*s))]; // NOT mb compliant
+ }
+ } else if (enc == CODES_UTF8) {
+ TxChar* s;
+ TxChar* d;
+
+ for (s = d = str; s < e;) {
+ size_t l = 0;
+
+ if (utf8_read_rune_from_unknown_plane(*d, l, s, e) == RECODE_OK) {
+ d++, s += l;
+ } else {
+ *d++ = BROKEN_RUNE;
+ ++s;
+ }
+ }
+ e = d;
+ } else if (enc == CODES_UNKNOWN) {
+ for (TxChar* s = str; s < e; s++) {
+ if (Hi8(Lo16(*s)) == 0xF0)
+ *s = Lo8(Lo16(*s));
+ }
+ } else {
+ Y_ASSERT(!SingleByteCodepage(enc));
+
+ TxChar* s = str;
+ TxChar* d = str;
+
+ TVector<char> buf;
+
+ size_t read = 0;
+ size_t written = 0;
+ for (; s < e; ++s) {
+ if (Hi8(Lo16(*s)) == 0xF0) {
+ buf.push_back(Lo8(Lo16(*s)));
+ } else {
+ if (!buf.empty()) {
+ if (RecodeToUnicode(enc, buf.data(), d, buf.size(), e - d, read, written) == RECODE_OK) {
+ Y_ASSERT(read == buf.size());
+ d += written;
+ } else { // just copying broken symbols
+ Y_ASSERT(buf.size() <= static_cast<size_t>(e - d));
+ Copy(buf.data(), buf.size(), d);
+ d += buf.size();
+ }
+ buf.clear();
+ }
+ *d++ = *s;
+ }
+ }
+ }
+ ee = e;
+}
+
+void DecodeUnknownPlane(wchar16* str, wchar16*& ee, const ECharset enc) {
+ DoDecodeUnknownPlane(str, ee, enc);
+}
+void DecodeUnknownPlane(wchar32* str, wchar32*& ee, const ECharset enc) {
+ DoDecodeUnknownPlane(str, ee, enc);
+}
diff --git a/library/cpp/charset/lite/CMakeLists.darwin-x86_64.txt b/library/cpp/charset/lite/CMakeLists.darwin-x86_64.txt
new file mode 100644
index 0000000000..0a3337929c
--- /dev/null
+++ b/library/cpp/charset/lite/CMakeLists.darwin-x86_64.txt
@@ -0,0 +1,22 @@
+
+# This file was generated by the build system used internally in the Yandex monorepo.
+# Only simple modifications are allowed (adding source-files to targets, adding simple properties
+# like target_include_directories). These modifications will be ported to original
+# ya.make files by maintainers. Any complex modifications which can't be ported back to the
+# original buildsystem will not be accepted.
+
+
+
+add_library(cpp-charset-lite)
+target_link_libraries(cpp-charset-lite PUBLIC
+ contrib-libs-cxxsupp
+ yutil
+)
+target_sources(cpp-charset-lite PRIVATE
+ ${CMAKE_SOURCE_DIR}/library/cpp/charset/generated/cp_data.cpp
+ ${CMAKE_SOURCE_DIR}/library/cpp/charset/generated/encrec_data.cpp
+ ${CMAKE_SOURCE_DIR}/library/cpp/charset/codepage.cpp
+ ${CMAKE_SOURCE_DIR}/library/cpp/charset/cp_encrec.cpp
+ ${CMAKE_SOURCE_DIR}/library/cpp/charset/doccodes.cpp
+ ${CMAKE_SOURCE_DIR}/library/cpp/charset/ci_string.cpp
+)
diff --git a/library/cpp/charset/lite/CMakeLists.linux-aarch64.txt b/library/cpp/charset/lite/CMakeLists.linux-aarch64.txt
new file mode 100644
index 0000000000..ff0a9b367a
--- /dev/null
+++ b/library/cpp/charset/lite/CMakeLists.linux-aarch64.txt
@@ -0,0 +1,23 @@
+
+# This file was generated by the build system used internally in the Yandex monorepo.
+# Only simple modifications are allowed (adding source-files to targets, adding simple properties
+# like target_include_directories). These modifications will be ported to original
+# ya.make files by maintainers. Any complex modifications which can't be ported back to the
+# original buildsystem will not be accepted.
+
+
+
+add_library(cpp-charset-lite)
+target_link_libraries(cpp-charset-lite PUBLIC
+ contrib-libs-linux-headers
+ contrib-libs-cxxsupp
+ yutil
+)
+target_sources(cpp-charset-lite PRIVATE
+ ${CMAKE_SOURCE_DIR}/library/cpp/charset/generated/cp_data.cpp
+ ${CMAKE_SOURCE_DIR}/library/cpp/charset/generated/encrec_data.cpp
+ ${CMAKE_SOURCE_DIR}/library/cpp/charset/codepage.cpp
+ ${CMAKE_SOURCE_DIR}/library/cpp/charset/cp_encrec.cpp
+ ${CMAKE_SOURCE_DIR}/library/cpp/charset/doccodes.cpp
+ ${CMAKE_SOURCE_DIR}/library/cpp/charset/ci_string.cpp
+)
diff --git a/library/cpp/charset/lite/CMakeLists.linux-x86_64.txt b/library/cpp/charset/lite/CMakeLists.linux-x86_64.txt
new file mode 100644
index 0000000000..ff0a9b367a
--- /dev/null
+++ b/library/cpp/charset/lite/CMakeLists.linux-x86_64.txt
@@ -0,0 +1,23 @@
+
+# This file was generated by the build system used internally in the Yandex monorepo.
+# Only simple modifications are allowed (adding source-files to targets, adding simple properties
+# like target_include_directories). These modifications will be ported to original
+# ya.make files by maintainers. Any complex modifications which can't be ported back to the
+# original buildsystem will not be accepted.
+
+
+
+add_library(cpp-charset-lite)
+target_link_libraries(cpp-charset-lite PUBLIC
+ contrib-libs-linux-headers
+ contrib-libs-cxxsupp
+ yutil
+)
+target_sources(cpp-charset-lite PRIVATE
+ ${CMAKE_SOURCE_DIR}/library/cpp/charset/generated/cp_data.cpp
+ ${CMAKE_SOURCE_DIR}/library/cpp/charset/generated/encrec_data.cpp
+ ${CMAKE_SOURCE_DIR}/library/cpp/charset/codepage.cpp
+ ${CMAKE_SOURCE_DIR}/library/cpp/charset/cp_encrec.cpp
+ ${CMAKE_SOURCE_DIR}/library/cpp/charset/doccodes.cpp
+ ${CMAKE_SOURCE_DIR}/library/cpp/charset/ci_string.cpp
+)
diff --git a/library/cpp/charset/lite/CMakeLists.txt b/library/cpp/charset/lite/CMakeLists.txt
new file mode 100644
index 0000000000..f8b31df0c1
--- /dev/null
+++ b/library/cpp/charset/lite/CMakeLists.txt
@@ -0,0 +1,17 @@
+
+# This file was generated by the build system used internally in the Yandex monorepo.
+# Only simple modifications are allowed (adding source-files to targets, adding simple properties
+# like target_include_directories). These modifications will be ported to original
+# ya.make files by maintainers. Any complex modifications which can't be ported back to the
+# original buildsystem will not be accepted.
+
+
+if (CMAKE_SYSTEM_NAME STREQUAL "Linux" AND CMAKE_SYSTEM_PROCESSOR STREQUAL "aarch64" AND NOT HAVE_CUDA)
+ include(CMakeLists.linux-aarch64.txt)
+elseif (CMAKE_SYSTEM_NAME STREQUAL "Darwin" AND CMAKE_SYSTEM_PROCESSOR STREQUAL "x86_64")
+ include(CMakeLists.darwin-x86_64.txt)
+elseif (WIN32 AND CMAKE_SYSTEM_PROCESSOR STREQUAL "AMD64" AND NOT HAVE_CUDA)
+ include(CMakeLists.windows-x86_64.txt)
+elseif (CMAKE_SYSTEM_NAME STREQUAL "Linux" AND CMAKE_SYSTEM_PROCESSOR STREQUAL "x86_64" AND NOT HAVE_CUDA)
+ include(CMakeLists.linux-x86_64.txt)
+endif()
diff --git a/library/cpp/charset/lite/CMakeLists.windows-x86_64.txt b/library/cpp/charset/lite/CMakeLists.windows-x86_64.txt
new file mode 100644
index 0000000000..0a3337929c
--- /dev/null
+++ b/library/cpp/charset/lite/CMakeLists.windows-x86_64.txt
@@ -0,0 +1,22 @@
+
+# This file was generated by the build system used internally in the Yandex monorepo.
+# Only simple modifications are allowed (adding source-files to targets, adding simple properties
+# like target_include_directories). These modifications will be ported to original
+# ya.make files by maintainers. Any complex modifications which can't be ported back to the
+# original buildsystem will not be accepted.
+
+
+
+add_library(cpp-charset-lite)
+target_link_libraries(cpp-charset-lite PUBLIC
+ contrib-libs-cxxsupp
+ yutil
+)
+target_sources(cpp-charset-lite PRIVATE
+ ${CMAKE_SOURCE_DIR}/library/cpp/charset/generated/cp_data.cpp
+ ${CMAKE_SOURCE_DIR}/library/cpp/charset/generated/encrec_data.cpp
+ ${CMAKE_SOURCE_DIR}/library/cpp/charset/codepage.cpp
+ ${CMAKE_SOURCE_DIR}/library/cpp/charset/cp_encrec.cpp
+ ${CMAKE_SOURCE_DIR}/library/cpp/charset/doccodes.cpp
+ ${CMAKE_SOURCE_DIR}/library/cpp/charset/ci_string.cpp
+)
diff --git a/library/cpp/charset/lite/ut/ya.make b/library/cpp/charset/lite/ut/ya.make
new file mode 100644
index 0000000000..53c85fae98
--- /dev/null
+++ b/library/cpp/charset/lite/ut/ya.make
@@ -0,0 +1,10 @@
+UNITTEST_FOR(library/cpp/charset/lite)
+
+SRCDIR(library/cpp/charset)
+
+SRCS(
+ ci_string_ut.cpp
+ codepage_ut.cpp
+)
+
+END()
diff --git a/library/cpp/charset/lite/ya.make b/library/cpp/charset/lite/ya.make
new file mode 100644
index 0000000000..12c6c9975c
--- /dev/null
+++ b/library/cpp/charset/lite/ya.make
@@ -0,0 +1,18 @@
+LIBRARY()
+
+SRCDIR(library/cpp/charset)
+
+SRCS(
+ generated/cp_data.cpp
+ generated/encrec_data.cpp
+ codepage.cpp
+ cp_encrec.cpp
+ doccodes.cpp
+ ci_string.cpp
+)
+
+END()
+
+RECURSE_FOR_TESTS(
+ ut
+)
diff --git a/library/cpp/charset/ut/ya.make b/library/cpp/charset/ut/ya.make
index 42f7ca54e2..38f029cafc 100644
--- a/library/cpp/charset/ut/ya.make
+++ b/library/cpp/charset/ut/ya.make
@@ -1,8 +1,6 @@
UNITTEST_FOR(library/cpp/charset)
SRCS(
- ci_string_ut.cpp
- codepage_ut.cpp
iconv_ut.cpp
wide_ut.cpp
)
diff --git a/library/cpp/charset/ya.make b/library/cpp/charset/ya.make
index f9fbbf9d09..6a52da56bb 100644
--- a/library/cpp/charset/ya.make
+++ b/library/cpp/charset/ya.make
@@ -5,19 +5,15 @@ IF (NOT OPENSOURCE)
ENDIF()
SRCS(
- generated/cp_data.cpp
- generated/encrec_data.cpp
- codepage.cpp
- cp_encrec.cpp
- doccodes.cpp
+ decodeunknownplane.cpp
iconv.cpp
recyr.hh
recyr_int.hh
- ci_string.cpp
wide.cpp
)
PEERDIR(
+ library/cpp/charset/lite
contrib/libs/libiconv
)
@@ -25,4 +21,5 @@ END()
RECURSE_FOR_TESTS(
ut
+ lite/ut
)