mirror of
https://github.com/typesense/typesense.git
synced 2025-05-18 04:32:38 +08:00
Experimenting with ICU linking options.
This commit is contained in:
parent
55ac4feb08
commit
ddcb89843f
@ -72,10 +72,27 @@ add_executable(typesense_test ${SRC_FILES} test/main.cpp test/array_test.cpp tes
|
||||
test/string_utils_test.cpp)
|
||||
|
||||
set(TYPESENSE_VERSION "nightly" CACHE STRING "") # will be overridden from command line during a release build
|
||||
target_compile_definitions(typesense-server PRIVATE TYPESENSE_VERSION="${TYPESENSE_VERSION}")
|
||||
target_compile_definitions(benchmark PRIVATE TYPESENSE_VERSION="${TYPESENSE_VERSION}")
|
||||
target_compile_definitions(search PRIVATE TYPESENSE_VERSION="${TYPESENSE_VERSION}")
|
||||
target_compile_definitions(typesense_test PRIVATE ROOT_DIR="${CMAKE_SOURCE_DIR}/" TYPESENSE_VERSION="${TYPESENSE_VERSION}")
|
||||
|
||||
target_compile_definitions(
|
||||
typesense-server PRIVATE
|
||||
TYPESENSE_VERSION="${TYPESENSE_VERSION}"
|
||||
)
|
||||
|
||||
target_compile_definitions(
|
||||
benchmark PRIVATE
|
||||
TYPESENSE_VERSION="${TYPESENSE_VERSION}"
|
||||
)
|
||||
|
||||
target_compile_definitions(
|
||||
search PRIVATE
|
||||
TYPESENSE_VERSION="${TYPESENSE_VERSION}"
|
||||
)
|
||||
|
||||
target_compile_definitions(
|
||||
typesense_test PRIVATE
|
||||
ROOT_DIR="${CMAKE_SOURCE_DIR}/"
|
||||
TYPESENSE_VERSION="${TYPESENSE_VERSION}"
|
||||
)
|
||||
|
||||
if (APPLE)
|
||||
set(STD_LIB -static-libstdc++) # https://stackoverflow.com/a/26543140/131050 (can't statically link libgcc on Mac)
|
||||
|
@ -1,9 +1,5 @@
|
||||
#pragma once
|
||||
|
||||
#define U_USING_ICU_NAMESPACE 0
|
||||
#define U_STATIC_IMPLEMENTATION 1
|
||||
//#define U_DISABLE_RENAMING 1
|
||||
|
||||
#include <string>
|
||||
#include <algorithm>
|
||||
#include <sstream>
|
||||
|
@ -6,7 +6,7 @@ void StringUtils::unicode_normalize(std::string& str) const {
|
||||
return !std::isalnum(c) && (int)(c) >= 0;
|
||||
}), str.end());
|
||||
|
||||
UnicodeString u_str = UnicodeString::fromUTF8(str);
|
||||
icu::UnicodeString u_str = icu::UnicodeString::fromUTF8(str);
|
||||
transliterator->transliterate(u_str);
|
||||
str.clear();
|
||||
u_str.toLower().toUTF8String(str);
|
||||
|
Loading…
x
Reference in New Issue
Block a user