Fix example/tdweb build

GitOrigin-RevId: f924d875361fc363af32e5d703e3cac373927405
This commit is contained in:
Arseny Smirnov 2019-12-23 21:33:03 +04:00
parent adb10460b2
commit e7e1521fd2
6 changed files with 15 additions and 14 deletions

View File

@ -87,8 +87,8 @@ if (EMSCRIPTEN)
set(ZLIB_LIBRARIES)
set(ZLIB_INCLUDE_DIR)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -s ALLOW_MEMORY_GROWTH=1 -s MEMFS_APPEND_TO_TYPED_ARRAYS=1 -s USE_ZLIB=1 -s MODULARIZE=1 -s WEBSOCKET_URL=\"'wss:#'\" -s EXTRA_EXPORTED_RUNTIME_METHODS=\"['FS','cwrap']\"")
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -s ALLOW_MEMORY_GROWTH=1 -s MEMFS_APPEND_TO_TYPED_ARRAYS=1 -s USE_ZLIB=1 -s MODULARIZE=1 -s WEBSOCKET_URL=\"'wss:#'\" -s EXTRA_EXPORTED_RUNTIME_METHODS=\"['FS','cwrap']\"")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -s ALLOW_MEMORY_GROWTH=1 -s MEMFS_APPEND_TO_TYPED_ARRAYS=1 -s USE_ZLIB=1 -s MODULARIZE=1 -s WEBSOCKET_URL=\"'wss:#'\" -s EXTRA_EXPORTED_RUNTIME_METHODS=\"['FS','cwrap']\" -lidbfs.js -lworkerfs.js")
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -s ALLOW_MEMORY_GROWTH=1 -s MEMFS_APPEND_TO_TYPED_ARRAYS=1 -s USE_ZLIB=1 -s MODULARIZE=1 -s WEBSOCKET_URL=\"'wss:#'\" -s EXTRA_EXPORTED_RUNTIME_METHODS=\"['FS','cwrap']\" -lidbfs.js -lworkerfs.js")
set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} -s DEMANGLE_SUPPORT=1 -s ASSERTIONS=1")
set(CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS_DEBUG} -s DEMANGLE_SUPPORT=1 -s ASSERTIONS=1")

View File

@ -1,6 +1,6 @@
#!/bin/sh
emconfigure 2> /dev/null || { echo 'emconfigure not found. Install emsdk and add emconfigure and emmake to PATH environment variable. See instruction at https://kripken.github.io/emscripten-site/docs/getting_started/downloads.html. Do not forget to add `emconfigure` and `emmake` to the PATH environment variable via `emsdk/emsdk_env.sh` script.'; exit 1; }
emconfigure true 2> /dev/null || { echo 'emconfigure not found. Install emsdk and add emconfigure and emmake to PATH environment variable. See instruction at https://kripken.github.io/emscripten-site/docs/getting_started/downloads.html. Do not forget to add `emconfigure` and `emmake` to the PATH environment variable via `emsdk/emsdk_env.sh` script.'; exit 1; }
OPENSSL=OpenSSL_1_1_0j
if [ ! -f $OPENSSL.tar.gz ]; then
@ -12,7 +12,7 @@ echo "Unpacking OpenSSL sources..."
tar xzf $OPENSSL.tar.gz || exit 1
cd openssl-$OPENSSL
emconfigure ./Configure linux-generic32 no-shared no-dso no-engine no-unit-test no-ui || exit 1
emconfigure ./Configure linux-generic32 no-shared no-threads no-dso no-engine no-unit-test no-ui || exit 1
sed -i.bak 's/CROSS_COMPILE=.*/CROSS_COMPILE=/g' Makefile || exit 1
sed -i.bak 's/-ldl //g' Makefile || exit 1
sed -i.bak 's/-O3/-Os/g' Makefile || exit 1

View File

@ -1,6 +1,6 @@
#!/bin/sh
emconfigure 2> /dev/null || { echo 'emconfigure not found. Install emsdk and add emconfigure and emmake to PATH environment variable. See instruction at https://kripken.github.io/emscripten-site/docs/getting_started/downloads.html. Do not forget to add `emconfigure` and `emmake` to the PATH environment variable via `emsdk/emsdk_env.sh` script.'; exit 1; }
emconfigure true 2> /dev/null || { echo 'emconfigure not found. Install emsdk and add emconfigure and emmake to PATH environment variable. See instruction at https://kripken.github.io/emscripten-site/docs/getting_started/downloads.html. Do not forget to add `emconfigure` and `emmake` to the PATH environment variable via `emsdk/emsdk_env.sh` script.'; exit 1; }
rm -rf build/generate
rm -rf build/asmjs

View File

@ -200,9 +200,10 @@ Result<SimpleConfig> decode_config(Slice input) {
return std::move(config);
}
template <class F>
static ActorOwn<> get_simple_config_impl(Promise<SimpleConfigResult> promise, int32 scheduler_id, string url,
string host, std::vector<std::pair<string, string>> headers, bool prefer_ipv6,
std::function<Result<string>(HttpQuery &)> get_config,
F &&get_config,
string content = string(), string content_type = string()) {
VLOG(config_recoverer) << "Request simple config from " << url;
#if TD_EMSCRIPTEN // FIXME
@ -242,7 +243,7 @@ ActorOwn<> get_simple_config_azure(Promise<SimpleConfigResult> promise, const Co
<< "v2/config.txt";
const bool prefer_ipv6 = shared_config == nullptr ? false : shared_config->get_option_boolean("prefer_ipv6");
return get_simple_config_impl(std::move(promise), scheduler_id, std::move(url), "tcdnb.azureedge.net", {},
prefer_ipv6, [](HttpQuery &http_query) { return http_query.content_.str(); });
prefer_ipv6, [](auto &http_query) -> Result<string> { return http_query.content_.str(); });
}
static ActorOwn<> get_simple_config_dns(Slice address, Slice host, Promise<SimpleConfigResult> promise,
@ -252,7 +253,7 @@ static ActorOwn<> get_simple_config_dns(Slice address, Slice host, Promise<Simpl
if (name.empty()) {
name = is_test ? "tapv3.stel.com" : "apv3.stel.com";
}
auto get_config = [](HttpQuery &http_query) -> Result<string> {
auto get_config = [](auto &http_query) -> Result<string> {
TRY_RESULT(json, json_decode(http_query.content_));
if (json.type() != JsonValue::Type::Object) {
return Status::Error("Expected JSON object");
@ -320,7 +321,7 @@ ActorOwn<> get_simple_config_firebase_remote_config(Promise<SimpleConfigResult>
"https://firebaseremoteconfig.googleapis.com/v1/projects/peak-vista-421/namespaces/"
"firebase:fetch?key=AIzaSyC2-kAkpDsroixRXw-sTw-Wfqo4NxjMwwM";
const bool prefer_ipv6 = shared_config == nullptr ? false : shared_config->get_option_boolean("prefer_ipv6");
auto get_config = [](HttpQuery &http_query) -> Result<string> {
auto get_config = [](auto &http_query) -> Result<string> {
TRY_RESULT(json, json_decode(http_query.get_arg("entries")));
if (json.type() != JsonValue::Type::Object) {
return Status::Error("Expected JSON object");
@ -342,7 +343,7 @@ ActorOwn<> get_simple_config_firebase_realtime(Promise<SimpleConfigResult> promi
string url = "https://reserve-5a846.firebaseio.com/ipconfigv3.json";
const bool prefer_ipv6 = shared_config == nullptr ? false : shared_config->get_option_boolean("prefer_ipv6");
auto get_config = [](HttpQuery &http_query) -> Result<string> {
auto get_config = [](auto &http_query) -> Result<string> {
return http_query.get_arg("content").str();
};
return get_simple_config_impl(std::move(promise), scheduler_id, std::move(url), "reserve-5a846.firebaseio.com", {},
@ -358,7 +359,7 @@ ActorOwn<> get_simple_config_firebase_firestore(Promise<SimpleConfigResult> prom
string url = "https://www.google.com/v1/projects/reserve-5a846/databases/(default)/documents/ipconfig/v3";
const bool prefer_ipv6 = shared_config == nullptr ? false : shared_config->get_option_boolean("prefer_ipv6");
auto get_config = [](HttpQuery &http_query) -> Result<string> {
auto get_config = [](auto &http_query) -> Result<string> {
TRY_RESULT(json, json_decode(http_query.get_arg("fields")));
if (json.type() != JsonValue::Type::Object) {
return Status::Error("Expected JSON object");

View File

@ -17341,7 +17341,7 @@ Result<int32> MessagesManager::get_message_schedule_date(
switch (scheduling_state->get_id()) {
case td_api::messageSchedulingStateSendWhenOnline::ID:
return SCHEDULE_WHEN_ONLINE_DATE;
return int32(SCHEDULE_WHEN_ONLINE_DATE);
case td_api::messageSchedulingStateSendAtDate::ID: {
auto send_at_date = td_api::move_object_as<td_api::messageSchedulingStateSendAtDate>(scheduling_state);
auto send_date = send_at_date->send_date_;

View File

@ -1065,11 +1065,11 @@ StickersManager::StickersManager(Td *td, ActorShared<> parent) : td_(td), parent
void StickersManager::start_up() {
// add animated emoji sticker set
if (G()->is_test_dc()) {
animated_emoji_sticker_set_id_ = StickerSetId(1258816259751954);
animated_emoji_sticker_set_id_ = StickerSetId(td::int64(1258816259751954));
animated_emoji_sticker_set_access_hash_ = 4879754868529595811;
animated_emoji_sticker_set_name_ = "emojies";
} else {
animated_emoji_sticker_set_id_ = StickerSetId(1258816259751983);
animated_emoji_sticker_set_id_ = StickerSetId(td::int64(1258816259751983));
animated_emoji_sticker_set_access_hash_ = 5100237018658464041;
animated_emoji_sticker_set_name_ = "animatedemojies";
}