diff --git a/td/generate/generate_common.cpp b/td/generate/generate_common.cpp index e578e35b1..e9a79ed5b 100644 --- a/td/generate/generate_common.cpp +++ b/td/generate/generate_common.cpp @@ -16,7 +16,7 @@ #include #include -template static void generate_cpp(const std::string &directory, const std::string &tl_name, const std::string &string_type, const std::string &bytes_type, const std::vector &ext_cpp_includes, @@ -24,7 +24,11 @@ static void generate_cpp(const std::string &directory, const std::string &tl_nam std::string path = directory + "/" + tl_name; td::tl::tl_config config = td::tl::read_tl_config_from_file("tlo/" + tl_name + ".tlo"); td::tl::write_tl_to_file(config, path + ".cpp", WriterCpp(tl_name, string_type, bytes_type, ext_cpp_includes)); - td::tl::write_tl_to_file(config, path + ".h", WriterH(tl_name, string_type, bytes_type, ext_h_includes)); + if (generate_multiple_headers) { + td::tl::write_tl_to_multiple_files(config, path, ".h", WriterH(tl_name, string_type, bytes_type, ext_h_includes)); + } else { + td::tl::write_tl_to_file(config, path + ".h", WriterH(tl_name, string_type, bytes_type, ext_h_includes)); + } td::tl::write_tl_to_file(config, path + ".hpp", WriterHpp(tl_name, string_type, bytes_type)); } @@ -40,7 +44,7 @@ int main() { {"\"td/utils/Slice.h\"", "\"td/utils/UInt.h\""}); #ifdef TD_ENABLE_JNI - generate_cpp("td/telegram", "td_api", "std::string", "std::string", + generate_cpp("td/telegram", "td_api", "std::string", "std::string", {"\"td/tl/tl_jni_object.h\""}, {""}); #else generate_cpp<>("td/telegram", "td_api", "std::string", "std::string", {}, {""});