From b7fed0377ccd91d6feb1fecf2c29ba935880e3f0 Mon Sep 17 00:00:00 2001 From: John Preston Date: Fri, 8 Nov 2019 11:27:39 +0300 Subject: [PATCH 001/255] Build codegen utils with cmake. --- CMakeLists.txt | 16 ++++ Telegram/CMakeLists.txt | 18 +++++ Telegram/codegen | 2 +- Telegram/lib_base | 2 +- Telegram/lib_crl | 2 +- Telegram/lib_rpl | 2 +- cmake/CMakeLists.txt | 72 ++++++++++++++++++ cmake/constants.cmake | 8 ++ cmake/external/CMakeLists.txt | 6 ++ cmake/external/crash_reports/CMakeLists.txt | 15 ++++ .../crash_reports/breakpad/CMakeLists.txt | 18 +++++ cmake/external/gsl/CMakeLists.txt | 6 ++ cmake/external/openssl/CMakeLists.txt | 6 ++ cmake/external/qt/CMakeLists.txt | 67 +++++++++++++++++ cmake/external/ranges/CMakeLists.txt | 6 ++ cmake/external/variant/CMakeLists.txt | 6 ++ cmake/functions.cmake | 74 +++++++++++++++++++ 17 files changed, 322 insertions(+), 4 deletions(-) create mode 100644 CMakeLists.txt create mode 100644 Telegram/CMakeLists.txt create mode 100644 cmake/CMakeLists.txt create mode 100644 cmake/constants.cmake create mode 100644 cmake/external/CMakeLists.txt create mode 100644 cmake/external/crash_reports/CMakeLists.txt create mode 100644 cmake/external/crash_reports/breakpad/CMakeLists.txt create mode 100644 cmake/external/gsl/CMakeLists.txt create mode 100644 cmake/external/openssl/CMakeLists.txt create mode 100644 cmake/external/qt/CMakeLists.txt create mode 100644 cmake/external/ranges/CMakeLists.txt create mode 100644 cmake/external/variant/CMakeLists.txt create mode 100644 cmake/functions.cmake diff --git a/CMakeLists.txt b/CMakeLists.txt new file mode 100644 index 000000000..c17c35fa9 --- /dev/null +++ b/CMakeLists.txt @@ -0,0 +1,16 @@ +cmake_minimum_required(VERSION 3.12) +cmake_policy(SET CMP0076 NEW) +cmake_policy(SET CMP0091 NEW) + +project(Telegram + LANGUAGES C CXX + VERSION 1.9.0 + DESCRIPTION "Official Telegram Desktop messenger" + HOMEPAGE_URL "https://desktop.telegram.org" +) + +include(cmake/constants.cmake) +include(cmake/functions.cmake) + +add_subdirectory(cmake) +add_subdirectory(Telegram) diff --git a/Telegram/CMakeLists.txt b/Telegram/CMakeLists.txt new file mode 100644 index 000000000..5b776c0a4 --- /dev/null +++ b/Telegram/CMakeLists.txt @@ -0,0 +1,18 @@ +add_subdirectory(lib_rpl) +add_subdirectory(lib_crl) +add_subdirectory(lib_base) +add_subdirectory(codegen) + +# get_filename_component(src_loc "./SourceFiles" REALPATH) + +# add_executable(Telegram WIN32 MACOSX_BUNDLE +# ${src_loc}/main.cpp +# ) +# init_target(Telegram) + +# force_include(Telegram stdafx.h) + +# target_link_libraries(Telegram +# PRIVATE +# lib_base +# ) diff --git a/Telegram/codegen b/Telegram/codegen index f1202034e..3eee2b658 160000 --- a/Telegram/codegen +++ b/Telegram/codegen @@ -1 +1 @@ -Subproject commit f1202034e2466475eee86b03d880c8c5d9d56988 +Subproject commit 3eee2b6581f4d89952d863b3ea39553a4db1d787 diff --git a/Telegram/lib_base b/Telegram/lib_base index a94ad7f81..eae957873 160000 --- a/Telegram/lib_base +++ b/Telegram/lib_base @@ -1 +1 @@ -Subproject commit a94ad7f817c1e1aeb242843d90f2bac313daab7a +Subproject commit eae95787375e0dd399641abb5e94e40f5ef154e7 diff --git a/Telegram/lib_crl b/Telegram/lib_crl index 440d088d5..5ea1a6d44 160000 --- a/Telegram/lib_crl +++ b/Telegram/lib_crl @@ -1 +1 @@ -Subproject commit 440d088d5d377fe4bddd20e6f3ef32c4174fb27e +Subproject commit 5ea1a6d4469ff6292f4a563958830d3104b42aef diff --git a/Telegram/lib_rpl b/Telegram/lib_rpl index 01323035b..2423c2636 160000 --- a/Telegram/lib_rpl +++ b/Telegram/lib_rpl @@ -1 +1 @@ -Subproject commit 01323035bcc9395525f851b4b208f09818ce65f1 +Subproject commit 2423c263604441616fbe402bafa07101bb2dc29d diff --git a/cmake/CMakeLists.txt b/cmake/CMakeLists.txt new file mode 100644 index 000000000..621cd3eec --- /dev/null +++ b/cmake/CMakeLists.txt @@ -0,0 +1,72 @@ +add_subdirectory(external) + +add_library(common INTERFACE) + +target_compile_features(common +INTERFACE + cxx_std_17 +) + +target_compile_definitions(common +INTERFACE + UNICODE +) + +if (WIN32) + target_compile_definitions(common + INTERFACE + WIN32 + _WINDOWS + _UNICODE + UNICODE + # HAVE_STDINT_H + # ZLIB_WINAPI + _SCL_SECURE_NO_WARNINGS + _USING_V110_SDK71_ + NOMINMAX + ) + target_compile_options(common + INTERFACE + /permissive- + # /Qspectre + /MP # Enable multi process build. + /EHsc # Catch C++ exceptions only, extern C functions never throw a C++ exception. + /w14834 # [[nodiscard]] + /w15038 # wrong initialization order + /w14265 # class has virtual functions, but destructor is not virtual + /experimental:preprocessor # need for range-v3 see https://github.com/ericniebler/range-v3#supported-compilers + /wd5105 # needed for `/experimental:preprocessor`, suppressing C5105 "macro expansion producing 'defined' has undefined behavior" + /Zc:wchar_t- # don't tread wchar_t as builtin type + ) + target_link_libraries(common + INTERFACE + winmm + imm32 + ws2_32 + kernel32 + user32 + gdi32 + winspool + comdlg32 + advapi32 + shell32 + ole32 + oleaut32 + uuid + odbc32 + odbccp32 + Shlwapi + Iphlpapi + Gdiplus + Strmiids + Netapi32 + Userenv + Version + Dwmapi + Wtsapi32 + UxTheme + DbgHelp + Rstrtmgr + ) +else() +endif() diff --git a/cmake/constants.cmake b/cmake/constants.cmake new file mode 100644 index 000000000..700a96ff2 --- /dev/null +++ b/cmake/constants.cmake @@ -0,0 +1,8 @@ +get_filename_component(libs_loc "../Libraries" REALPATH) +get_filename_component(third_party_loc "Telegram/ThirdParty" REALPATH) + +if(CMAKE_BUILD_TYPE STREQUAL "Debug") + set(build_debug 1) +else() + set(build_debug 0) +endif() diff --git a/cmake/external/CMakeLists.txt b/cmake/external/CMakeLists.txt new file mode 100644 index 000000000..6e7ea170e --- /dev/null +++ b/cmake/external/CMakeLists.txt @@ -0,0 +1,6 @@ +add_subdirectory(qt) +add_subdirectory(openssl) +add_subdirectory(variant) +add_subdirectory(ranges) +add_subdirectory(gsl) +add_subdirectory(crash_reports) diff --git a/cmake/external/crash_reports/CMakeLists.txt b/cmake/external/crash_reports/CMakeLists.txt new file mode 100644 index 000000000..76485e43c --- /dev/null +++ b/cmake/external/crash_reports/CMakeLists.txt @@ -0,0 +1,15 @@ +add_library(external_crash_reports INTERFACE IMPORTED GLOBAL) + +add_subdirectory(breakpad) + +if (WIN32) + target_link_libraries(external_crash_reports + INTERFACE + external_breakpad + ) +else() + target_link_libraries(external_crash_reports + INTERFACE + external_crashpad + ) +endif() diff --git a/cmake/external/crash_reports/breakpad/CMakeLists.txt b/cmake/external/crash_reports/breakpad/CMakeLists.txt new file mode 100644 index 000000000..7ef281a67 --- /dev/null +++ b/cmake/external/crash_reports/breakpad/CMakeLists.txt @@ -0,0 +1,18 @@ +add_library(external_breakpad INTERFACE IMPORTED GLOBAL) + +target_include_directories(external_breakpad SYSTEM +INTERFACE + ${libs_loc}/breakpad/src +) + +target_link_libraries(external_breakpad +INTERFACE + windows/common + windows/handler/exception_handler + windows/crash_generation/crash_generation_client +) + +target_link_directories(external_breakpad +INTERFACE + ${libs_loc}/breakpad/src/out/$,Debug,Release>/obj/client +) diff --git a/cmake/external/gsl/CMakeLists.txt b/cmake/external/gsl/CMakeLists.txt new file mode 100644 index 000000000..5a3e4ec33 --- /dev/null +++ b/cmake/external/gsl/CMakeLists.txt @@ -0,0 +1,6 @@ +add_library(external_gsl INTERFACE IMPORTED GLOBAL) + +target_include_directories(external_gsl SYSTEM +INTERFACE + ${third_party_loc}/GSL/include +) diff --git a/cmake/external/openssl/CMakeLists.txt b/cmake/external/openssl/CMakeLists.txt new file mode 100644 index 000000000..1d476d4e1 --- /dev/null +++ b/cmake/external/openssl/CMakeLists.txt @@ -0,0 +1,6 @@ +add_library(external_openssl INTERFACE IMPORTED GLOBAL) + +target_include_directories(external_openssl SYSTEM +INTERFACE + ${libs_loc}/openssl_1_1_1/include +) diff --git a/cmake/external/qt/CMakeLists.txt b/cmake/external/qt/CMakeLists.txt new file mode 100644 index 000000000..edd03a6d2 --- /dev/null +++ b/cmake/external/qt/CMakeLists.txt @@ -0,0 +1,67 @@ +add_library(external_qt INTERFACE IMPORTED GLOBAL) + +set(qt_version 5.12.5) + +if (WIN32) + set(qt_loc ${libs_loc}/Qt-${qt_version}) +else() +endif() + +target_include_directories(external_qt SYSTEM +INTERFACE + ${qt_loc}/include + ${qt_loc}/include/QtCore + ${qt_loc}/include/QtGui + ${qt_loc}/include/QtDBus + ${qt_loc}/include/QtCore/${qt_version} + ${qt_loc}/include/QtGui/${qt_version} + ${qt_loc}/include/QtCore/${qt_version}/QtCore + ${qt_loc}/include/QtGui/${qt_version}/QtGui +) + +set(common_qt_libs + qwebp + qgif + qjpeg + Qt5PrintSupport + Qt5AccessibilitySupport + Qt5FontDatabaseSupport + Qt5EventDispatcherSupport + Qt5ThemeSupport + Qt5Network + Qt5Widgets + Qt5Gui + qtharfbuzz + qtlibpng +) + +if (WIN32) + set(qt_libs + ${common_qt_libs} + Qt5Core + Qt5WindowsUIAutomationSupport + qtmain + qwindows + qtfreetype + qtpcre2 + ) + set(qt_libs_list "") + foreach(lib ${qt_libs}) + list(APPEND qt_libs_list "${lib}$<$:d>") + endforeach() +else() +endif() + +target_link_directories(external_qt +INTERFACE + ${qt_loc}/lib + ${qt_loc}/plugins + ${qt_loc}/plugins/bearer + ${qt_loc}/plugins/platforms + ${qt_loc}/plugins/imageformats +) + +target_link_libraries(external_qt +INTERFACE + ${qt_libs_list} +) diff --git a/cmake/external/ranges/CMakeLists.txt b/cmake/external/ranges/CMakeLists.txt new file mode 100644 index 000000000..e2fcdf603 --- /dev/null +++ b/cmake/external/ranges/CMakeLists.txt @@ -0,0 +1,6 @@ +add_library(external_ranges INTERFACE IMPORTED GLOBAL) + +target_include_directories(external_ranges SYSTEM +INTERFACE + ${libs_loc}/range-v3/include +) diff --git a/cmake/external/variant/CMakeLists.txt b/cmake/external/variant/CMakeLists.txt new file mode 100644 index 000000000..b0bee9a76 --- /dev/null +++ b/cmake/external/variant/CMakeLists.txt @@ -0,0 +1,6 @@ +add_library(external_variant INTERFACE IMPORTED GLOBAL) + +target_include_directories(external_variant SYSTEM +INTERFACE + ${third_party_loc}/variant/include +) diff --git a/cmake/functions.cmake b/cmake/functions.cmake new file mode 100644 index 000000000..c35f042e6 --- /dev/null +++ b/cmake/functions.cmake @@ -0,0 +1,74 @@ +function(force_include target_name file_path) +if (MSVC) + target_compile_options(${target_name} + PRIVATE + /FI${file_path} + ) +else() + target_compile_options(${target_name} + PRIVATE + -include ${file_path} + ) +endif() +endfunction() + +function(init_target target_name) + set_property(TARGET ${target_name} PROPERTY + MSVC_RUNTIME_LIBRARY "MultiThreaded$<$:Debug>") +endfunction() + +function(nice_target_sources target_name src_loc list) + set(writing_now "") + set(private_sources "") + set(public_sources "") + set(interface_sources "") + set(not_win_sources "") + set(not_mac_sources "") + set(not_linux_sources "") + foreach(file ${list}) + if (${file} STREQUAL "PRIVATE" OR ${file} STREQUAL "PUBLIC" OR ${file} STREQUAL "INTERFACE") + set(writing_now ${file}) + else() + set(full_name ${src_loc}/${file}) + if (${file} MATCHES "/win/" OR ${file} MATCHES "_win\.") + list(APPEND not_mac_sources ${full_name}) + list(APPEND not_linux_sources ${full_name}) + elseif (${file} MATCHES "/mac/" OR ${file} MATCHES "_mac\.") + list(APPEND not_win_sources ${full_name}) + list(APPEND not_linux_sources ${full_name}) + elseif (${file} MATCHES "/linux/" OR ${file} MATCHES "_linux\.") + list(APPEND not_win_sources ${full_name}) + list(APPEND not_mac_sources ${full_name}) + elseif (${file} MATCHES "/posix/" OR ${file} MATCHES "_posix\.") + list(APPEND not_win_sources ${full_name}) + endif() + if ("${writing_now}" STREQUAL "PRIVATE") + list(APPEND private_sources ${full_name}) + elseif ("${writing_now}" STREQUAL "PUBLIC") + list(APPEND public_sources ${full_name}) + elseif ("${writing_now}" STREQUAL "INTERFACE") + list(APPEND interface_sources ${full_name}) + else() + message(FATAL_ERROR "Unknown sources scope for target ${target_name}") + endif() + source_group(TREE ${src_loc} FILES ${full_name}) + endif() + endforeach() + + if (NOT "${public_sources}" STREQUAL "") + target_sources(${target_name} PUBLIC ${public_sources}) + endif() + if (NOT "${private_sources}" STREQUAL "") + target_sources(${target_name} PRIVATE ${private_sources}) + endif() + if (NOT "${interface_sources}" STREQUAL "") + target_sources(${target_name} INTERFACE ${interface_sources}) + endif() + if (WIN32) + set_source_files_properties(${not_win_sources} PROPERTIES HEADER_FILE_ONLY TRUE) + elseif (APPLE) + set_source_files_properties(${not_mac_sources} PROPERTIES HEADER_FILE_ONLY TRUE) + elseif (LINUX) + set_source_files_properties(${not_linux_sources} PROPERTIES HEADER_FILE_ONLY TRUE) + endif() +endfunction() From 02a71d745dc02f0bc029b36436c6e34fc4ec2b0d Mon Sep 17 00:00:00 2001 From: John Preston Date: Fri, 8 Nov 2019 13:05:59 +0300 Subject: [PATCH 002/255] Build lib_ui with cmake. --- CMakeLists.txt | 2 ++ Telegram/CMakeLists.txt | 21 ++++++++++++++++++--- Telegram/codegen | 2 +- Telegram/lib_ui | 2 +- cmake/CMakeLists.txt | 2 ++ cmake/constants.cmake | 1 + cmake/functions.cmake | 14 +++++++++----- 7 files changed, 34 insertions(+), 10 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index c17c35fa9..6f25f1131 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -2,6 +2,8 @@ cmake_minimum_required(VERSION 3.12) cmake_policy(SET CMP0076 NEW) cmake_policy(SET CMP0091 NEW) +set_property(GLOBAL PROPERTY USE_FOLDERS ON) + project(Telegram LANGUAGES C CXX VERSION 1.9.0 diff --git a/Telegram/CMakeLists.txt b/Telegram/CMakeLists.txt index 5b776c0a4..3d5dcc931 100644 --- a/Telegram/CMakeLists.txt +++ b/Telegram/CMakeLists.txt @@ -1,18 +1,33 @@ add_subdirectory(lib_rpl) add_subdirectory(lib_crl) add_subdirectory(lib_base) +add_subdirectory(lib_ui) add_subdirectory(codegen) +# include(lib_ui/cmake/generate_styles.cmake) + # get_filename_component(src_loc "./SourceFiles" REALPATH) -# add_executable(Telegram WIN32 MACOSX_BUNDLE -# ${src_loc}/main.cpp -# ) +# add_executable(Telegram WIN32 MACOSX_BUNDLE) # init_target(Telegram) # force_include(Telegram stdafx.h) +# set(telegram_sources +# PRIVATE +# main.cpp +# ) + +# nice_target_sources(Telegram ${src_loc} "${telegram_sources}") + +# target_compile_definitions(Telegram +# PRIVATE +# TDESKTOP_API_ID=17349 +# TDESKTOP_API_HASH=344583e45741c457fe1862106095a5eb +# ) + # target_link_libraries(Telegram # PRIVATE # lib_base +# lib_ui # ) diff --git a/Telegram/codegen b/Telegram/codegen index 3eee2b658..2f972846a 160000 --- a/Telegram/codegen +++ b/Telegram/codegen @@ -1 +1 @@ -Subproject commit 3eee2b6581f4d89952d863b3ea39553a4db1d787 +Subproject commit 2f972846ad4beb64f068dac236ab95b04aa343a9 diff --git a/Telegram/lib_ui b/Telegram/lib_ui index c68dceb18..ab76dcd08 160000 --- a/Telegram/lib_ui +++ b/Telegram/lib_ui @@ -1 +1 @@ -Subproject commit c68dceb1892284f49ef1bf04a719f89635d35c58 +Subproject commit ab76dcd0879e684b34c3de243e44e3751b68356f diff --git a/cmake/CMakeLists.txt b/cmake/CMakeLists.txt index 621cd3eec..6126263fa 100644 --- a/cmake/CMakeLists.txt +++ b/cmake/CMakeLists.txt @@ -29,6 +29,8 @@ if (WIN32) INTERFACE /permissive- # /Qspectre + /W1 + /WX /MP # Enable multi process build. /EHsc # Catch C++ exceptions only, extern C functions never throw a C++ exception. /w14834 # [[nodiscard]] diff --git a/cmake/constants.cmake b/cmake/constants.cmake index 700a96ff2..f36dcd5fe 100644 --- a/cmake/constants.cmake +++ b/cmake/constants.cmake @@ -1,5 +1,6 @@ get_filename_component(libs_loc "../Libraries" REALPATH) get_filename_component(third_party_loc "Telegram/ThirdParty" REALPATH) +get_filename_component(submodules_loc "Telegram" REALPATH) if(CMAKE_BUILD_TYPE STREQUAL "Debug") set(build_debug 1) diff --git a/cmake/functions.cmake b/cmake/functions.cmake index c35f042e6..7ee1f985d 100644 --- a/cmake/functions.cmake +++ b/cmake/functions.cmake @@ -12,9 +12,13 @@ else() endif() endfunction() -function(init_target target_name) +function(init_target target_name) # init_target(my_target folder_name) + set(folder_name "${ARGV1}") set_property(TARGET ${target_name} PROPERTY MSVC_RUNTIME_LIBRARY "MultiThreaded$<$:Debug>") + if (NOT "${folder_name}" STREQUAL "") + set_target_properties(${target_name} PROPERTIES FOLDER ${folder_name}) + endif() endfunction() function(nice_target_sources target_name src_loc list) @@ -30,16 +34,16 @@ function(nice_target_sources target_name src_loc list) set(writing_now ${file}) else() set(full_name ${src_loc}/${file}) - if (${file} MATCHES "/win/" OR ${file} MATCHES "_win\.") + if (${file} MATCHES "/win/" OR ${file} MATCHES "_win\\.") list(APPEND not_mac_sources ${full_name}) list(APPEND not_linux_sources ${full_name}) - elseif (${file} MATCHES "/mac/" OR ${file} MATCHES "_mac\.") + elseif (${file} MATCHES "/mac/" OR ${file} MATCHES "_mac\\.") list(APPEND not_win_sources ${full_name}) list(APPEND not_linux_sources ${full_name}) - elseif (${file} MATCHES "/linux/" OR ${file} MATCHES "_linux\.") + elseif (${file} MATCHES "/linux/" OR ${file} MATCHES "_linux\\.") list(APPEND not_win_sources ${full_name}) list(APPEND not_mac_sources ${full_name}) - elseif (${file} MATCHES "/posix/" OR ${file} MATCHES "_posix\.") + elseif (${file} MATCHES "/posix/" OR ${file} MATCHES "_posix\\.") list(APPEND not_win_sources ${full_name}) endif() if ("${writing_now}" STREQUAL "PRIVATE") From a18baaae2ca89bbd1b6a4471503d3ee7f2f93df4 Mon Sep 17 00:00:00 2001 From: John Preston Date: Fri, 8 Nov 2019 14:08:40 +0300 Subject: [PATCH 003/255] Add all code generation targets. --- CMakeLists.txt | 7 +- Telegram/CMakeLists.txt | 937 +++++++++++++++++- Telegram/cmake/generate_lang.cmake | 20 + Telegram/cmake/generate_numbers.cmake | 20 + Telegram/cmake/generate_scheme.cmake | 22 + Telegram/codegen | 2 +- Telegram/lib_tl | 2 +- Telegram/lib_ui | 2 +- cmake/force_include.cmake | 13 + cmake/generate_target.cmake | 8 + cmake/init_target.cmake | 9 + ...ctions.cmake => nice_target_sources.cmake} | 25 +- cmake/{constants.cmake => paths.cmake} | 6 - 13 files changed, 1018 insertions(+), 55 deletions(-) create mode 100644 Telegram/cmake/generate_lang.cmake create mode 100644 Telegram/cmake/generate_numbers.cmake create mode 100644 Telegram/cmake/generate_scheme.cmake create mode 100644 cmake/force_include.cmake create mode 100644 cmake/generate_target.cmake create mode 100644 cmake/init_target.cmake rename cmake/{functions.cmake => nice_target_sources.cmake} (77%) rename cmake/{constants.cmake => paths.cmake} (65%) diff --git a/CMakeLists.txt b/CMakeLists.txt index 6f25f1131..23802db1a 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -11,8 +11,11 @@ project(Telegram HOMEPAGE_URL "https://desktop.telegram.org" ) -include(cmake/constants.cmake) -include(cmake/functions.cmake) +include(cmake/paths.cmake) +include(cmake/force_include.cmake) +include(cmake/init_target.cmake) +include(cmake/generate_target.cmake) +include(cmake/nice_target_sources.cmake) add_subdirectory(cmake) add_subdirectory(Telegram) diff --git a/Telegram/CMakeLists.txt b/Telegram/CMakeLists.txt index 3d5dcc931..440c7fec9 100644 --- a/Telegram/CMakeLists.txt +++ b/Telegram/CMakeLists.txt @@ -1,33 +1,930 @@ +add_executable(Telegram WIN32 MACOSX_BUNDLE) +init_target(Telegram) + add_subdirectory(lib_rpl) add_subdirectory(lib_crl) add_subdirectory(lib_base) add_subdirectory(lib_ui) +add_subdirectory(lib_tl) add_subdirectory(codegen) -# include(lib_ui/cmake/generate_styles.cmake) +include(lib_ui/cmake/generate_styles.cmake) +include(cmake/generate_scheme.cmake) +include(cmake/generate_lang.cmake) +include(cmake/generate_numbers.cmake) -# get_filename_component(src_loc "./SourceFiles" REALPATH) +get_filename_component(src_loc "./SourceFiles" REALPATH) +get_filename_component(res_loc "./Resources" REALPATH) -# add_executable(Telegram WIN32 MACOSX_BUNDLE) -# init_target(Telegram) +set(style_files + boxes/boxes.style + calls/calls.style + dialogs/dialogs.style + export/view/export.style + history/history.style + info/info.style + intro/intro.style + media/view/mediaview.style + media/player/media_player.style + overview/overview.style + passport/passport.style + profile/profile.style + settings/settings.style + chat_helpers/chat_helpers.style + window/window.style +) -# force_include(Telegram stdafx.h) +set(dependent_style_files + ${submodules_loc}/lib_ui/ui/colors.palette + ${submodules_loc}/lib_ui/ui/basic.style + ${submodules_loc}/lib_ui/ui/layers/layers.style + ${submodules_loc}/lib_ui/ui/widgets/widgets.style +) -# set(telegram_sources -# PRIVATE -# main.cpp -# ) +set(scheme_files + ${res_loc}/tl/mtproto.tl + ${res_loc}/tl/api.tl +) -# nice_target_sources(Telegram ${src_loc} "${telegram_sources}") +generate_scheme(Telegram ${src_loc}/codegen/scheme/codegen_scheme.py "${scheme_files}") +generate_styles(Telegram ${src_loc} "${style_files}" "${dependent_style_files}") +generate_lang(Telegram ${res_loc}/langs/lang.strings) +generate_numbers(Telegram ${res_loc}/numbers.txt) -# target_compile_definitions(Telegram -# PRIVATE -# TDESKTOP_API_ID=17349 -# TDESKTOP_API_HASH=344583e45741c457fe1862106095a5eb -# ) +set(telegram_sources +PRIVATE + api/api_common.h + api/api_hash.h + api/api_sending.cpp + api/api_sending.h + api/api_single_message_search.cpp + api/api_single_message_search.h + api/api_text_entities.cpp + api/api_text_entities.h + boxes/peers/add_participants_box.cpp + boxes/peers/add_participants_box.h + boxes/peers/edit_contact_box.cpp + boxes/peers/edit_contact_box.h + boxes/peers/edit_linked_chat_box.cpp + boxes/peers/edit_linked_chat_box.h + boxes/peers/edit_participant_box.cpp + boxes/peers/edit_participant_box.h + boxes/peers/edit_participants_box.cpp + boxes/peers/edit_participants_box.h + boxes/peers/edit_peer_info_box.cpp + boxes/peers/edit_peer_info_box.h + boxes/peers/edit_peer_type_box.cpp + boxes/peers/edit_peer_type_box.h + boxes/peers/edit_peer_history_visibility_box.cpp + boxes/peers/edit_peer_history_visibility_box.h + boxes/peers/edit_peer_permissions_box.cpp + boxes/peers/edit_peer_permissions_box.h + boxes/about_box.cpp + boxes/about_box.h + boxes/abstract_box.cpp + boxes/abstract_box.h + boxes/add_contact_box.cpp + boxes/add_contact_box.h + boxes/auto_lock_box.cpp + boxes/auto_lock_box.h + boxes/auto_download_box.cpp + boxes/auto_download_box.h + boxes/background_box.cpp + boxes/background_box.h + boxes/background_preview_box.cpp + boxes/background_preview_box.h + boxes/calendar_box.cpp + boxes/calendar_box.h + boxes/change_phone_box.cpp + boxes/change_phone_box.h + boxes/confirm_box.cpp + boxes/confirm_box.h + boxes/confirm_phone_box.cpp + boxes/confirm_phone_box.h + boxes/connection_box.cpp + boxes/connection_box.h + boxes/create_poll_box.cpp + boxes/create_poll_box.h + boxes/download_path_box.cpp + boxes/download_path_box.h + boxes/edit_caption_box.cpp + boxes/edit_caption_box.h + boxes/edit_color_box.cpp + boxes/edit_color_box.h + boxes/edit_privacy_box.cpp + boxes/edit_privacy_box.h + boxes/language_box.cpp + boxes/language_box.h + boxes/local_storage_box.cpp + boxes/local_storage_box.h + boxes/mute_settings_box.cpp + boxes/mute_settings_box.h + boxes/peer_list_box.cpp + boxes/peer_list_box.h + boxes/peer_list_controllers.cpp + boxes/peer_list_controllers.h + boxes/passcode_box.cpp + boxes/passcode_box.h + boxes/photo_crop_box.cpp + boxes/photo_crop_box.h + boxes/rate_call_box.cpp + boxes/rate_call_box.h + boxes/report_box.cpp + boxes/report_box.h + boxes/self_destruction_box.cpp + boxes/self_destruction_box.h + boxes/send_files_box.cpp + boxes/send_files_box.h + boxes/sessions_box.cpp + boxes/sessions_box.h + boxes/share_box.cpp + boxes/share_box.h + boxes/single_choice_box.cpp + boxes/single_choice_box.h + boxes/sticker_set_box.cpp + boxes/sticker_set_box.h + boxes/stickers_box.cpp + boxes/stickers_box.h + boxes/url_auth_box.cpp + boxes/url_auth_box.h + boxes/username_box.cpp + boxes/username_box.h + calls/calls_box_controller.cpp + calls/calls_box_controller.h + calls/calls_call.cpp + calls/calls_call.h + calls/calls_emoji_fingerprint.cpp + calls/calls_emoji_fingerprint.h + calls/calls_instance.cpp + calls/calls_instance.h + calls/calls_panel.cpp + calls/calls_panel.h + calls/calls_top_bar.cpp + calls/calls_top_bar.h + chat_helpers/bot_keyboard.cpp + chat_helpers/bot_keyboard.h + chat_helpers/emoji_keywords.cpp + chat_helpers/emoji_keywords.h + chat_helpers/emoji_list_widget.cpp + chat_helpers/emoji_list_widget.h + chat_helpers/emoji_sets_manager.cpp + chat_helpers/emoji_sets_manager.h + chat_helpers/emoji_suggestions_widget.cpp + chat_helpers/emoji_suggestions_widget.h + chat_helpers/field_autocomplete.cpp + chat_helpers/field_autocomplete.h + chat_helpers/gifs_list_widget.cpp + chat_helpers/gifs_list_widget.h + chat_helpers/message_field.cpp + chat_helpers/message_field.h + chat_helpers/stickers.cpp + chat_helpers/stickers.h + chat_helpers/stickers_emoji_pack.cpp + chat_helpers/stickers_emoji_pack.h + chat_helpers/stickers_list_widget.cpp + chat_helpers/stickers_list_widget.h + chat_helpers/tabbed_panel.cpp + chat_helpers/tabbed_panel.h + chat_helpers/tabbed_section.cpp + chat_helpers/tabbed_section.h + chat_helpers/tabbed_selector.cpp + chat_helpers/tabbed_selector.h + core/application.cpp + core/application.h + core/base_integration.cpp + core/base_integration.h + core/changelogs.cpp + core/changelogs.h + core/click_handler_types.cpp + core/click_handler_types.h + core/core_cloud_password.cpp + core/core_cloud_password.h + core/core_settings.cpp + core/core_settings.h + core/crash_report_window.cpp + core/crash_report_window.h + core/crash_reports.cpp + core/crash_reports.h + core/file_utilities.cpp + core/file_utilities.h + core/launcher.cpp + core/launcher.h + core/local_url_handlers.cpp + core/local_url_handlers.h + core/media_active_cache.h + core/mime_type.cpp + core/mime_type.h + core/sandbox.cpp + core/sandbox.h + core/shortcuts.cpp + core/shortcuts.h + core/ui_integration.cpp + core/ui_integration.h + core/update_checker.cpp + core/update_checker.h + core/utils.cpp + core/utils.h + core/version.h + data/data_abstract_structure.cpp + data/data_abstract_structure.h + data/data_auto_download.cpp + data/data_auto_download.h + data/data_chat.cpp + data/data_chat.h + data/data_channel.cpp + data/data_channel.h + data/data_channel_admins.cpp + data/data_channel_admins.h + data/data_cloud_themes.cpp + data/data_cloud_themes.h + data/data_countries.cpp + data/data_countries.h + data/data_document.cpp + data/data_document.h + data/data_document_good_thumbnail.cpp + data/data_document_good_thumbnail.h + data/data_drafts.cpp + data/data_drafts.h + data/data_folder.cpp + data/data_folder.h + # data/data_feed_messages.cpp + # data/data_feed_messages.h + data/data_file_origin.cpp + data/data_file_origin.h + data/data_flags.h + data/data_game.h + data/data_groups.cpp + data/data_groups.h + data/data_location.cpp + data/data_location.h + data/data_media_types.cpp + data/data_media_types.h + data/data_messages.cpp + data/data_messages.h + data/data_notify_settings.cpp + data/data_notify_settings.h + data/data_peer.cpp + data/data_peer.h + data/data_peer_values.cpp + data/data_peer_values.h + data/data_photo.cpp + data/data_photo.h + data/data_poll.cpp + data/data_poll.h + data/data_pts_waiter.cpp + data/data_pts_waiter.h + data/data_search_controller.cpp + data/data_search_controller.h + data/data_session.cpp + data/data_session.h + data/data_scheduled_messages.cpp + data/data_scheduled_messages.h + data/data_shared_media.cpp + data/data_shared_media.h + data/data_sparse_ids.cpp + data/data_sparse_ids.h + data/data_types.cpp + data/data_types.h + data/data_user.cpp + data/data_user.h + data/data_user_photos.cpp + data/data_user_photos.h + data/data_wall_paper.cpp + data/data_wall_paper.h + data/data_web_page.cpp + data/data_web_page.h + dialogs/dialogs_entry.cpp + dialogs/dialogs_entry.h + dialogs/dialogs_indexed_list.cpp + dialogs/dialogs_indexed_list.h + dialogs/dialogs_inner_widget.cpp + dialogs/dialogs_inner_widget.h + dialogs/dialogs_key.cpp + dialogs/dialogs_key.h + dialogs/dialogs_layout.cpp + dialogs/dialogs_layout.h + dialogs/dialogs_list.cpp + dialogs/dialogs_list.h + dialogs/dialogs_main_list.cpp + dialogs/dialogs_main_list.h + dialogs/dialogs_pinned_list.cpp + dialogs/dialogs_pinned_list.h + dialogs/dialogs_row.cpp + dialogs/dialogs_row.h + dialogs/dialogs_search_from_controllers.cpp + dialogs/dialogs_search_from_controllers.h + dialogs/dialogs_widget.cpp + dialogs/dialogs_widget.h + export/view/export_view_content.cpp + export/view/export_view_content.h + export/view/export_view_panel_controller.cpp + export/view/export_view_panel_controller.h + export/view/export_view_progress.cpp + export/view/export_view_progress.h + export/view/export_view_settings.cpp + export/view/export_view_settings.h + export/view/export_view_top_bar.cpp + export/view/export_view_top_bar.h + history/admin_log/history_admin_log_filter.cpp + history/admin_log/history_admin_log_filter.h + history/admin_log/history_admin_log_inner.cpp + history/admin_log/history_admin_log_inner.h + history/admin_log/history_admin_log_item.cpp + history/admin_log/history_admin_log_item.h + history/admin_log/history_admin_log_section.cpp + history/admin_log/history_admin_log_section.h + # history/feed/history_feed_section.cpp + # history/feed/history_feed_section.h + history/view/media/history_view_call.h + history/view/media/history_view_call.cpp + history/view/media/history_view_contact.h + history/view/media/history_view_contact.cpp + history/view/media/history_view_document.h + history/view/media/history_view_document.cpp + history/view/media/history_view_file.h + history/view/media/history_view_file.cpp + history/view/media/history_view_game.h + history/view/media/history_view_game.cpp + history/view/media/history_view_gif.h + history/view/media/history_view_gif.cpp + history/view/media/history_view_invoice.h + history/view/media/history_view_invoice.cpp + history/view/media/history_view_large_emoji.h + history/view/media/history_view_large_emoji.cpp + history/view/media/history_view_location.h + history/view/media/history_view_location.cpp + history/view/media/history_view_media.h + history/view/media/history_view_media.cpp + history/view/media/history_view_media_common.h + history/view/media/history_view_media_common.cpp + history/view/media/history_view_media_grouped.h + history/view/media/history_view_media_grouped.cpp + history/view/media/history_view_media_unwrapped.h + history/view/media/history_view_media_unwrapped.cpp + history/view/media/history_view_photo.h + history/view/media/history_view_photo.cpp + history/view/media/history_view_poll.h + history/view/media/history_view_poll.cpp + history/view/media/history_view_sticker.h + history/view/media/history_view_sticker.cpp + history/view/media/history_view_theme_document.h + history/view/media/history_view_theme_document.cpp + history/view/media/history_view_video.h + history/view/media/history_view_video.cpp + history/view/media/history_view_web_page.h + history/view/media/history_view_web_page.cpp + history/view/history_view_compose_controls.cpp + history/view/history_view_compose_controls.h + history/view/history_view_contact_status.cpp + history/view/history_view_contact_status.h + history/view/history_view_context_menu.cpp + history/view/history_view_context_menu.h + history/view/history_view_cursor_state.cpp + history/view/history_view_cursor_state.h + history/view/history_view_element.cpp + history/view/history_view_element.h + history/view/history_view_list_widget.cpp + history/view/history_view_list_widget.h + history/view/history_view_message.cpp + history/view/history_view_message.h + history/view/history_view_object.h + history/view/history_view_schedule_box.cpp + history/view/history_view_schedule_box.h + history/view/history_view_scheduled_section.cpp + history/view/history_view_scheduled_section.h + history/view/history_view_service_message.cpp + history/view/history_view_service_message.h + history/view/history_view_top_bar_widget.cpp + history/view/history_view_top_bar_widget.h + history/history.cpp + history/history.h + history/history_drag_area.cpp + history/history_drag_area.h + history/history_item.cpp + history/history_item.h + history/history_item_components.cpp + history/history_item_components.h + history/history_item_text.cpp + history/history_item_text.h + history/history_inner_widget.cpp + history/history_inner_widget.h + history/history_location_manager.cpp + history/history_location_manager.h + history/history_message.cpp + history/history_message.h + history/history_service.cpp + history/history_service.h + history/history_widget.cpp + history/history_widget.h + info/info_content_widget.cpp + info/info_content_widget.h + info/info_controller.cpp + info/info_controller.h + info/info_layer_widget.cpp + info/info_layer_widget.h + info/info_memento.cpp + info/info_memento.h + info/info_section_widget.cpp + info/info_section_widget.h + info/info_top_bar.cpp + info/info_top_bar.h + info/info_wrap_widget.cpp + info/info_wrap_widget.h + # info/channels/info_channels_widget.cpp + # info/channels/info_channels_widget.h + info/common_groups/info_common_groups_inner_widget.cpp + info/common_groups/info_common_groups_inner_widget.h + info/common_groups/info_common_groups_widget.cpp + info/common_groups/info_common_groups_widget.h + # info/feed/info_feed_channels.cpp + # info/feed/info_feed_channels.h + # info/feed/info_feed_channels_controllers.cpp + # info/feed/info_feed_channels_controllers.h + # info/feed/info_feed_cover.cpp + # info/feed/info_feed_cover.h + # info/feed/info_feed_profile_inner_widget.cpp + # info/feed/info_feed_profile_inner_widget.h + # info/feed/info_feed_profile_widget.cpp + # info/feed/info_feed_profile_widget.h + info/media/info_media_buttons.h + info/media/info_media_empty_widget.cpp + info/media/info_media_empty_widget.h + info/media/info_media_inner_widget.cpp + info/media/info_media_inner_widget.h + info/media/info_media_list_widget.cpp + info/media/info_media_list_widget.h + info/media/info_media_widget.cpp + info/media/info_media_widget.h + info/members/info_members_widget.cpp + info/members/info_members_widget.h + info/profile/info_profile_actions.cpp + info/profile/info_profile_actions.h + info/profile/info_profile_cover.cpp + info/profile/info_profile_cover.h + info/profile/info_profile_icon.cpp + info/profile/info_profile_icon.h + info/profile/info_profile_inner_widget.cpp + info/profile/info_profile_inner_widget.h + info/profile/info_profile_members.cpp + info/profile/info_profile_members.h + info/profile/info_profile_members_controllers.cpp + info/profile/info_profile_members_controllers.h + info/profile/info_profile_text.cpp + info/profile/info_profile_text.h + info/profile/info_profile_values.cpp + info/profile/info_profile_values.h + info/profile/info_profile_widget.cpp + info/profile/info_profile_widget.h + info/settings/info_settings_widget.cpp + info/settings/info_settings_widget.h + inline_bots/inline_bot_layout_internal.cpp + inline_bots/inline_bot_layout_internal.h + inline_bots/inline_bot_layout_item.cpp + inline_bots/inline_bot_layout_item.h + inline_bots/inline_bot_result.cpp + inline_bots/inline_bot_result.h + inline_bots/inline_bot_send_data.cpp + inline_bots/inline_bot_send_data.h + inline_bots/inline_results_widget.cpp + inline_bots/inline_results_widget.h + intro/introwidget.cpp + intro/introwidget.h + intro/introcode.cpp + intro/introcode.h + intro/introphone.cpp + intro/introphone.h + intro/intropwdcheck.cpp + intro/intropwdcheck.h + intro/introsignup.cpp + intro/introsignup.h + intro/introstart.cpp + intro/introstart.h + lang/lang_cloud_manager.cpp + lang/lang_cloud_manager.h + lang/lang_file_parser.cpp + lang/lang_file_parser.h + lang/lang_hardcoded.h + lang/lang_instance.cpp + lang/lang_instance.h + lang/lang_keys.cpp + lang/lang_keys.h + lang/lang_numbers_animation.cpp + lang/lang_numbers_animation.h + lang/lang_tag.cpp + lang/lang_tag.h + lang/lang_text_entity.cpp + lang/lang_text_entity.h + lang/lang_translator.cpp + lang/lang_translator.h + lang/lang_values.cpp + lang/lang_values.h + main/main_account.cpp + main/main_account.h + main/main_app_config.cpp + main/main_app_config.h + main/main_session.cpp + main/main_session.h + main/main_settings.cpp + main/main_settings.h + media/audio/media_audio.cpp + media/audio/media_audio.h + media/audio/media_audio_capture.cpp + media/audio/media_audio_capture.h + media/audio/media_audio_ffmpeg_loader.cpp + media/audio/media_audio_ffmpeg_loader.h + media/audio/media_audio_loader.cpp + media/audio/media_audio_loader.h + media/audio/media_audio_loaders.cpp + media/audio/media_audio_loaders.h + media/audio/media_audio_track.cpp + media/audio/media_audio_track.h + media/audio/media_child_ffmpeg_loader.cpp + media/audio/media_child_ffmpeg_loader.h + media/clip/media_clip_check_streaming.cpp + media/clip/media_clip_check_streaming.h + media/clip/media_clip_ffmpeg.cpp + media/clip/media_clip_ffmpeg.h + media/clip/media_clip_implementation.cpp + media/clip/media_clip_implementation.h + media/clip/media_clip_reader.cpp + media/clip/media_clip_reader.h + media/player/media_player_button.cpp + media/player/media_player_button.h + media/player/media_player_float.cpp + media/player/media_player_float.h + media/player/media_player_instance.cpp + media/player/media_player_instance.h + media/player/media_player_panel.cpp + media/player/media_player_panel.h + media/player/media_player_volume_controller.cpp + media/player/media_player_volume_controller.h + media/player/media_player_widget.cpp + media/player/media_player_widget.h + media/streaming/media_streaming_audio_track.cpp + media/streaming/media_streaming_audio_track.h + media/streaming/media_streaming_common.h + media/streaming/media_streaming_file.cpp + media/streaming/media_streaming_file.h + media/streaming/media_streaming_file_delegate.h + media/streaming/media_streaming_loader.cpp + media/streaming/media_streaming_loader.h + media/streaming/media_streaming_loader_local.cpp + media/streaming/media_streaming_loader_local.h + media/streaming/media_streaming_loader_mtproto.cpp + media/streaming/media_streaming_loader_mtproto.h + media/streaming/media_streaming_player.cpp + media/streaming/media_streaming_player.h + media/streaming/media_streaming_reader.cpp + media/streaming/media_streaming_reader.h + media/streaming/media_streaming_utility.cpp + media/streaming/media_streaming_utility.h + media/streaming/media_streaming_video_track.cpp + media/streaming/media_streaming_video_track.h + media/view/media_view_playback_controls.cpp + media/view/media_view_playback_controls.h + media/view/media_view_playback_progress.cpp + media/view/media_view_playback_progress.h + media/view/media_view_group_thumbs.cpp + media/view/media_view_group_thumbs.h + media/view/media_view_overlay_widget.cpp + media/view/media_view_overlay_widget.h + mtproto/auth_key.cpp + mtproto/auth_key.h + mtproto/concurrent_sender.cpp + mtproto/concurrent_sender.h + mtproto/config_loader.cpp + mtproto/config_loader.h + mtproto/connection.cpp + mtproto/connection.h + mtproto/connection_abstract.cpp + mtproto/connection_abstract.h + mtproto/connection_http.cpp + mtproto/connection_http.h + mtproto/connection_resolving.cpp + mtproto/connection_resolving.h + mtproto/connection_tcp.cpp + mtproto/connection_tcp.h + mtproto/core_types.cpp + mtproto/core_types.h + mtproto/dcenter.cpp + mtproto/dcenter.h + mtproto/dc_options.cpp + mtproto/dc_options.h + mtproto/dedicated_file_loader.cpp + mtproto/dedicated_file_loader.h + mtproto/facade.cpp + mtproto/facade.h + mtproto/mtp_instance.cpp + mtproto/mtp_instance.h + mtproto/rsa_public_key.cpp + mtproto/rsa_public_key.h + mtproto/rpc_sender.cpp + mtproto/rpc_sender.h + mtproto/sender.h + mtproto/session.cpp + mtproto/session.h + mtproto/special_config_request.cpp + mtproto/special_config_request.h + mtproto/type_utils.h + overview/overview_layout.cpp + overview/overview_layout.h + passport/passport_encryption.cpp + passport/passport_encryption.h + passport/passport_form_controller.cpp + passport/passport_form_controller.h + passport/passport_form_view_controller.cpp + passport/passport_form_view_controller.h + passport/passport_panel.cpp + passport/passport_panel.h + passport/passport_panel_controller.cpp + passport/passport_panel_controller.h + passport/passport_panel_details_row.cpp + passport/passport_panel_details_row.h + passport/passport_panel_edit_contact.cpp + passport/passport_panel_edit_contact.h + passport/passport_panel_edit_document.cpp + passport/passport_panel_edit_document.h + passport/passport_panel_edit_scans.cpp + passport/passport_panel_edit_scans.h + passport/passport_panel_form.cpp + passport/passport_panel_form.h + passport/passport_panel_password.cpp + passport/passport_panel_password.h + platform/linux/linux_desktop_environment.cpp + platform/linux/linux_desktop_environment.h + platform/linux/linux_gdk_helper.cpp + platform/linux/linux_gdk_helper.h + platform/linux/linux_libnotify.cpp + platform/linux/linux_libnotify.h + platform/linux/linux_libs.cpp + platform/linux/linux_libs.h + platform/linux/file_utilities_linux.cpp + platform/linux/file_utilities_linux.h + platform/linux/launcher_linux.cpp + platform/linux/launcher_linux.h + platform/linux/main_window_linux.cpp + platform/linux/main_window_linux.h + platform/linux/notifications_manager_linux.cpp + platform/linux/notifications_manager_linux.h + platform/linux/specific_linux.cpp + platform/linux/specific_linux.h + platform/mac/file_utilities_mac.mm + platform/mac/file_utilities_mac.h + platform/mac/launcher_mac.mm + platform/mac/launcher_mac.h + platform/mac/mac_iconv_helper.c + platform/mac/main_window_mac.mm + platform/mac/main_window_mac.h + platform/mac/notifications_manager_mac.mm + platform/mac/notifications_manager_mac.h + platform/mac/specific_mac.mm + platform/mac/specific_mac.h + platform/mac/specific_mac_p.mm + platform/mac/specific_mac_p.h + platform/mac/window_title_mac.mm + platform/mac/window_title_mac.h + platform/mac/mac_touchbar.h + platform/mac/mac_touchbar.mm + platform/win/audio_win.cpp + platform/win/audio_win.h + platform/win/file_utilities_win.cpp + platform/win/file_utilities_win.h + platform/win/launcher_win.cpp + platform/win/launcher_win.h + platform/win/main_window_win.cpp + platform/win/main_window_win.h + platform/win/notifications_manager_win.cpp + platform/win/notifications_manager_win.h + platform/win/specific_win.cpp + platform/win/specific_win.h + platform/win/window_title_win.cpp + platform/win/window_title_win.h + platform/win/windows_app_user_model_id.cpp + platform/win/windows_app_user_model_id.h + platform/win/windows_dlls.cpp + platform/win/windows_dlls.h + platform/win/windows_event_filter.cpp + platform/win/windows_event_filter.h + platform/win/wrapper_wrl_implements_h.h + platform/platform_audio.h + platform/platform_file_utilities.h + platform/platform_launcher.h + platform/platform_main_window.h + platform/platform_notifications_manager.h + platform/platform_specific.h + platform/platform_window_title.h + profile/profile_back_button.cpp + profile/profile_back_button.h + profile/profile_block_group_members.cpp + profile/profile_block_group_members.h + profile/profile_block_peer_list.cpp + profile/profile_block_peer_list.h + profile/profile_block_widget.cpp + profile/profile_block_widget.h + profile/profile_cover_drop_area.cpp + profile/profile_cover_drop_area.h + settings/settings_advanced.cpp + settings/settings_advanced.h + settings/settings_chat.cpp + settings/settings_chat.h + settings/settings_calls.cpp + settings/settings_calls.h + settings/settings_codes.cpp + settings/settings_codes.h + settings/settings_common.cpp + settings/settings_common.h + settings/settings_information.cpp + settings/settings_information.h + settings/settings_intro.cpp + settings/settings_intro.h + settings/settings_main.cpp + settings/settings_main.h + settings/settings_notifications.cpp + settings/settings_notifications.h + settings/settings_privacy_controllers.cpp + settings/settings_privacy_controllers.h + settings/settings_privacy_security.cpp + settings/settings_privacy_security.h + storage/file_download.cpp + storage/file_download.h + storage/file_upload.cpp + storage/file_upload.h + storage/localimageloader.cpp + storage/localimageloader.h + storage/localstorage.cpp + storage/localstorage.h + storage/serialize_common.cpp + storage/serialize_common.h + storage/serialize_document.cpp + storage/serialize_document.h + storage/storage_facade.cpp + storage/storage_facade.h + # storage/storage_feed_messages.cpp + # storage/storage_feed_messages.h + storage/storage_media_prepare.cpp + storage/storage_media_prepare.h + storage/storage_shared_media.cpp + storage/storage_shared_media.h + storage/storage_sparse_ids_list.cpp + storage/storage_sparse_ids_list.h + storage/storage_user_photos.cpp + storage/storage_user_photos.h + storage/streamed_file_downloader.cpp + storage/streamed_file_downloader.h + support/support_autocomplete.cpp + support/support_autocomplete.h + support/support_common.cpp + support/support_common.h + support/support_helper.cpp + support/support_helper.h + support/support_templates.cpp + support/support_templates.h + ui/effects/round_checkbox.cpp + ui/effects/round_checkbox.h + ui/effects/send_action_animations.cpp + ui/effects/send_action_animations.h + ui/image/image.cpp + ui/image/image.h + ui/image/image_location.cpp + ui/image/image_location.h + ui/image/image_source.cpp + ui/image/image_source.h + ui/widgets/continuous_sliders.cpp + ui/widgets/continuous_sliders.h + ui/widgets/discrete_sliders.cpp + ui/widgets/discrete_sliders.h + ui/widgets/level_meter.cpp + ui/widgets/level_meter.h + ui/widgets/multi_select.cpp + ui/widgets/multi_select.h + ui/widgets/separate_panel.cpp + ui/widgets/separate_panel.h + ui/countryinput.cpp + ui/countryinput.h + ui/empty_userpic.cpp + ui/empty_userpic.h + ui/grouped_layout.cpp + ui/grouped_layout.h + ui/resize_area.h + ui/search_field_controller.cpp + ui/search_field_controller.h + ui/special_buttons.cpp + ui/special_buttons.h + ui/special_fields.cpp + ui/special_fields.h + ui/text_options.cpp + ui/text_options.h + ui/unread_badge.cpp + ui/unread_badge.h + window/main_window.cpp + window/main_window.h + window/notifications_manager.cpp + window/notifications_manager.h + window/notifications_manager_default.cpp + window/notifications_manager_default.h + window/notifications_utilities.cpp + window/notifications_utilities.h + window/section_memento.h + window/section_widget.cpp + window/section_widget.h + window/window_connecting_widget.cpp + window/window_connecting_widget.h + window/window_controller.cpp + window/window_controller.h + window/window_history_hider.cpp + window/window_history_hider.h + window/window_lock_widgets.cpp + window/window_lock_widgets.h + window/window_main_menu.cpp + window/window_main_menu.h + window/window_media_preview.cpp + window/window_media_preview.h + window/window_outdated_bar.cpp + window/window_outdated_bar.h + window/window_peer_menu.cpp + window/window_peer_menu.h + window/window_session_controller.cpp + window/window_session_controller.h + window/window_slide_animation.cpp + window/window_slide_animation.h + window/window_title.h + window/window_top_bar_wrap.h + window/themes/window_theme.cpp + window/themes/window_theme.h + window/themes/window_theme_editor.cpp + window/themes/window_theme_editor.h + window/themes/window_theme_editor_block.cpp + window/themes/window_theme_editor_block.h + window/themes/window_theme_editor_box.cpp + window/themes/window_theme_editor_box.h + window/themes/window_theme_preview.cpp + window/themes/window_theme_preview.h + window/themes/window_theme_warning.cpp + window/themes/window_theme_warning.h + window/themes/window_themes_cloud_list.cpp + window/themes/window_themes_cloud_list.h + window/themes/window_themes_embedded.cpp + window/themes/window_themes_embedded.h + window/themes/window_themes_generate_name.cpp + window/themes/window_themes_generate_name.h + apiwrap.cpp + apiwrap.h + app.cpp + app.h + config.h + facades.cpp + facades.h + layout.cpp + layout.h + logs.cpp + logs.h + main.cpp + mainwidget.cpp + mainwidget.h + mainwindow.cpp + mainwindow.h + observer_peer.cpp + observer_peer.h + qt_static_plugins.cpp + settings.cpp + settings.h -# target_link_libraries(Telegram -# PRIVATE -# lib_base -# lib_ui -# ) +# platforms: !win +# <(minizip_loc)/crypt.h +# <(minizip_loc)/ioapi.c +# <(minizip_loc)/ioapi.h +# <(minizip_loc)/zip.c +# <(minizip_loc)/zip.h +# <(minizip_loc)/unzip.c +# <(minizip_loc)/unzip.h + +# platforms: win +# <(res_loc)/winrc/Telegram.rc + +# platforms: mac +# <(sp_media_key_tap_loc)/SPMediaKeyTap.m +# <(sp_media_key_tap_loc)/SPMediaKeyTap.h +# <(sp_media_key_tap_loc)/SPInvocationGrabbing/NSObject+SPInvocationGrabbing.m +# <(sp_media_key_tap_loc)/SPInvocationGrabbing/NSObject+SPInvocationGrabbing.h +) +nice_target_sources(Telegram ${src_loc} "${telegram_sources}") + +force_include(Telegram stdafx.h) + +target_include_directories(Telegram +PRIVATE + ${src_loc} +) + +target_compile_definitions(Telegram +PRIVATE + TDESKTOP_API_ID=17349 + TDESKTOP_API_HASH=344583e45741c457fe1862106095a5eb +) + +target_link_libraries(Telegram +PRIVATE + lib_base + lib_ui + lib_tl +) diff --git a/Telegram/cmake/generate_lang.cmake b/Telegram/cmake/generate_lang.cmake new file mode 100644 index 000000000..d93516b38 --- /dev/null +++ b/Telegram/cmake/generate_lang.cmake @@ -0,0 +1,20 @@ +function(generate_lang target_name lang_file) + set(gen_dst ${CMAKE_CURRENT_BINARY_DIR}/gen) + set(generated_files + ${gen_dst}/lang_auto.cpp + ${gen_dst}/lang_auto.h + ) + add_custom_command( + OUTPUT + ${generated_files} + COMMAND + codegen_lang + -o${gen_dst} + ${lang_file} + COMMENT "Generating lang (${target_name})" + DEPENDS + codegen_lang + ${lang_file} + ) + generate_target(${target_name} lang "${generated_files}" ${gen_dst}) +endfunction() diff --git a/Telegram/cmake/generate_numbers.cmake b/Telegram/cmake/generate_numbers.cmake new file mode 100644 index 000000000..0e5a0eb10 --- /dev/null +++ b/Telegram/cmake/generate_numbers.cmake @@ -0,0 +1,20 @@ +function(generate_numbers target_name numbers_file) + set(gen_dst ${CMAKE_CURRENT_BINARY_DIR}/gen) + set(generated_files + ${gen_dst}/numbers.cpp + ${gen_dst}/numbers.h + ) + add_custom_command( + OUTPUT + ${generated_files} + COMMAND + codegen_numbers + -o${gen_dst} + ${numbers_file} + COMMENT "Generating numbers (${target_name})" + DEPENDS + codegen_numbers + ${gen_src} + ) + generate_target(${target_name} numbers "${generated_files}" ${gen_dst}) +endfunction() diff --git a/Telegram/cmake/generate_scheme.cmake b/Telegram/cmake/generate_scheme.cmake new file mode 100644 index 000000000..6cb2513f1 --- /dev/null +++ b/Telegram/cmake/generate_scheme.cmake @@ -0,0 +1,22 @@ +function(generate_scheme target_name script scheme_files) + set(gen_dst ${CMAKE_CURRENT_BINARY_DIR}/gen) + set(generated_files + ${gen_dst}/scheme.cpp + ${gen_dst}/scheme.h + ) + add_custom_command( + OUTPUT + ${generated_files} + COMMAND + python + ${script} + -o${gen_dst}/scheme + ${scheme_files} + COMMENT "Generating scheme (${target_name})" + DEPENDS + ${script} + ${submodules_loc}/lib_tl/tl/generate_tl.py + ${scheme_files} + ) + generate_target(${target_name} scheme "${generated_files}" ${gen_dst}) +endfunction() diff --git a/Telegram/codegen b/Telegram/codegen index 2f972846a..8e8d1de1a 160000 --- a/Telegram/codegen +++ b/Telegram/codegen @@ -1 +1 @@ -Subproject commit 2f972846ad4beb64f068dac236ab95b04aa343a9 +Subproject commit 8e8d1de1a1ad5fbc9db0ec797880b5c754be8be7 diff --git a/Telegram/lib_tl b/Telegram/lib_tl index 89a1e3fed..54f5073dc 160000 --- a/Telegram/lib_tl +++ b/Telegram/lib_tl @@ -1 +1 @@ -Subproject commit 89a1e3fed24bc0bfc268fa0352e7d2658ee4ef22 +Subproject commit 54f5073dc49b518f75e57352fde5df47973791d5 diff --git a/Telegram/lib_ui b/Telegram/lib_ui index ab76dcd08..d32f772e5 160000 --- a/Telegram/lib_ui +++ b/Telegram/lib_ui @@ -1 +1 @@ -Subproject commit ab76dcd0879e684b34c3de243e44e3751b68356f +Subproject commit d32f772e5274e8490ade20e88c6bfa10b8ecfee5 diff --git a/cmake/force_include.cmake b/cmake/force_include.cmake new file mode 100644 index 000000000..5e684c194 --- /dev/null +++ b/cmake/force_include.cmake @@ -0,0 +1,13 @@ +function(force_include target_name file_path) + if (MSVC) + target_compile_options(${target_name} + PRIVATE + /FI${file_path} + ) + else() + target_compile_options(${target_name} + PRIVATE + -include ${file_path} + ) + endif() +endfunction() diff --git a/cmake/generate_target.cmake b/cmake/generate_target.cmake new file mode 100644 index 000000000..e4e07aec7 --- /dev/null +++ b/cmake/generate_target.cmake @@ -0,0 +1,8 @@ +function(generate_target parent_name postfix generated_files gen_dst) + add_custom_target(${parent_name}_${postfix} DEPENDS ${generated_files}) + init_target(${parent_name}_${postfix} "(gen)") + add_dependencies(${parent_name} ${parent_name}_${postfix}) + target_sources(${parent_name} PRIVATE ${generated_files}) + target_include_directories(${parent_name} PUBLIC ${gen_dst}) + source_group("(gen)" FILES ${generated_files}) +endfunction() diff --git a/cmake/init_target.cmake b/cmake/init_target.cmake new file mode 100644 index 000000000..539371b79 --- /dev/null +++ b/cmake/init_target.cmake @@ -0,0 +1,9 @@ +function(init_target target_name) # init_target(my_target folder_name) + set(folder_name "${ARGV1}") + set_property(TARGET ${target_name} PROPERTY + MSVC_RUNTIME_LIBRARY "MultiThreaded$<$:Debug>") + if (NOT "${folder_name}" STREQUAL "") + set_target_properties(${target_name} PROPERTIES FOLDER ${folder_name}) + endif() +endfunction() + diff --git a/cmake/functions.cmake b/cmake/nice_target_sources.cmake similarity index 77% rename from cmake/functions.cmake rename to cmake/nice_target_sources.cmake index 7ee1f985d..afacbfdd3 100644 --- a/cmake/functions.cmake +++ b/cmake/nice_target_sources.cmake @@ -1,26 +1,3 @@ -function(force_include target_name file_path) -if (MSVC) - target_compile_options(${target_name} - PRIVATE - /FI${file_path} - ) -else() - target_compile_options(${target_name} - PRIVATE - -include ${file_path} - ) -endif() -endfunction() - -function(init_target target_name) # init_target(my_target folder_name) - set(folder_name "${ARGV1}") - set_property(TARGET ${target_name} PROPERTY - MSVC_RUNTIME_LIBRARY "MultiThreaded$<$:Debug>") - if (NOT "${folder_name}" STREQUAL "") - set_target_properties(${target_name} PROPERTIES FOLDER ${folder_name}) - endif() -endfunction() - function(nice_target_sources target_name src_loc list) set(writing_now "") set(private_sources "") @@ -55,7 +32,7 @@ function(nice_target_sources target_name src_loc list) else() message(FATAL_ERROR "Unknown sources scope for target ${target_name}") endif() - source_group(TREE ${src_loc} FILES ${full_name}) + source_group(TREE ${src_loc} PREFIX Sources FILES ${full_name}) endif() endforeach() diff --git a/cmake/constants.cmake b/cmake/paths.cmake similarity index 65% rename from cmake/constants.cmake rename to cmake/paths.cmake index f36dcd5fe..148a2f7f0 100644 --- a/cmake/constants.cmake +++ b/cmake/paths.cmake @@ -1,9 +1,3 @@ get_filename_component(libs_loc "../Libraries" REALPATH) get_filename_component(third_party_loc "Telegram/ThirdParty" REALPATH) get_filename_component(submodules_loc "Telegram" REALPATH) - -if(CMAKE_BUILD_TYPE STREQUAL "Debug") - set(build_debug 1) -else() - set(build_debug 0) -endif() From c4da31c21331a285f5563d2d9f9e10182f37768c Mon Sep 17 00:00:00 2001 From: John Preston Date: Fri, 8 Nov 2019 15:00:15 +0300 Subject: [PATCH 004/255] Add lib_storage as submodule. --- .gitmodules | 3 +++ Telegram/lib_storage | 1 + 2 files changed, 4 insertions(+) create mode 160000 Telegram/lib_storage diff --git a/.gitmodules b/.gitmodules index f51e8e319..2ae139598 100644 --- a/.gitmodules +++ b/.gitmodules @@ -49,3 +49,6 @@ [submodule "Telegram/lib_spellcheck"] path = Telegram/lib_spellcheck url = https://github.com/desktop-app/lib_spellcheck +[submodule "Telegram/lib_storage"] + path = Telegram/lib_storage + url = https://github.com/desktop-app/lib_storage.git diff --git a/Telegram/lib_storage b/Telegram/lib_storage new file mode 160000 index 000000000..6803e7411 --- /dev/null +++ b/Telegram/lib_storage @@ -0,0 +1 @@ +Subproject commit 6803e74111186443af5be9ed1eae190536309e33 From 85060cd6557b19a6268894e77b9f3df209d7c96b Mon Sep 17 00:00:00 2001 From: John Preston Date: Fri, 8 Nov 2019 15:02:15 +0300 Subject: [PATCH 005/255] Compile all code with cmake. --- CMakeLists.txt | 1 + Telegram/CMakeLists.txt | 47 +- Telegram/cmake/lib_export.cmake | 41 ++ Telegram/cmake/lib_ffmpeg.cmake | 20 + Telegram/cmake/lib_lz4.cmake | 22 + Telegram/cmake/lib_mtproto.cmake | 25 ++ Telegram/cmake/lib_scheme.cmake | 22 + Telegram/cmake/lib_tgvoip.cmake | 732 +++++++++++++++++++++++++++++++ Telegram/lib_lottie | 2 +- Telegram/lib_rlottie | 2 +- Telegram/lib_spellcheck | 2 +- cmake/CMakeLists.txt | 32 +- cmake/external/qt/CMakeLists.txt | 7 - cmake/external/qt/package.cmake | 17 + cmake/generate_target.cmake | 2 +- cmake/init_target.cmake | 18 +- cmake/nice_target_sources.cmake | 4 +- 17 files changed, 956 insertions(+), 40 deletions(-) create mode 100644 Telegram/cmake/lib_export.cmake create mode 100644 Telegram/cmake/lib_ffmpeg.cmake create mode 100644 Telegram/cmake/lib_lz4.cmake create mode 100644 Telegram/cmake/lib_mtproto.cmake create mode 100644 Telegram/cmake/lib_scheme.cmake create mode 100644 Telegram/cmake/lib_tgvoip.cmake create mode 100644 cmake/external/qt/package.cmake diff --git a/CMakeLists.txt b/CMakeLists.txt index 23802db1a..55281e0e7 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -16,6 +16,7 @@ include(cmake/force_include.cmake) include(cmake/init_target.cmake) include(cmake/generate_target.cmake) include(cmake/nice_target_sources.cmake) +include(cmake/external/qt/package.cmake) add_subdirectory(cmake) add_subdirectory(Telegram) diff --git a/Telegram/CMakeLists.txt b/Telegram/CMakeLists.txt index 440c7fec9..cab088303 100644 --- a/Telegram/CMakeLists.txt +++ b/Telegram/CMakeLists.txt @@ -6,15 +6,24 @@ add_subdirectory(lib_crl) add_subdirectory(lib_base) add_subdirectory(lib_ui) add_subdirectory(lib_tl) +add_subdirectory(lib_spellcheck) +add_subdirectory(lib_lottie) +add_subdirectory(lib_rlottie) add_subdirectory(codegen) include(lib_ui/cmake/generate_styles.cmake) -include(cmake/generate_scheme.cmake) include(cmake/generate_lang.cmake) include(cmake/generate_numbers.cmake) -get_filename_component(src_loc "./SourceFiles" REALPATH) -get_filename_component(res_loc "./Resources" REALPATH) +get_filename_component(src_loc SourceFiles REALPATH) +get_filename_component(res_loc Resources REALPATH) + +include(cmake/lib_export.cmake) +include(cmake/lib_ffmpeg.cmake) +include(cmake/lib_lz4.cmake) +include(cmake/lib_mtproto.cmake) +include(cmake/lib_scheme.cmake) +include(cmake/lib_tgvoip.cmake) set(style_files boxes/boxes.style @@ -41,16 +50,23 @@ set(dependent_style_files ${submodules_loc}/lib_ui/ui/widgets/widgets.style ) -set(scheme_files - ${res_loc}/tl/mtproto.tl - ${res_loc}/tl/api.tl -) - -generate_scheme(Telegram ${src_loc}/codegen/scheme/codegen_scheme.py "${scheme_files}") generate_styles(Telegram ${src_loc} "${style_files}" "${dependent_style_files}") generate_lang(Telegram ${res_loc}/langs/lang.strings) generate_numbers(Telegram ${res_loc}/numbers.txt) +target_link_libraries(Telegram +PRIVATE + lib_base + lib_ui + lib_tl + lib_spellcheck + lib_lottie + lib_scheme + lib_export + lib_ffmpeg + lib_tgvoip +) + set(telegram_sources PRIVATE api/api_common.h @@ -914,17 +930,16 @@ force_include(Telegram stdafx.h) target_include_directories(Telegram PRIVATE ${src_loc} + ${libs_loc}/zlib + ${libs_loc}/lzma/C + ${libs_loc}/openal-soft/include + ${third_party_loc}/minizip ) target_compile_definitions(Telegram PRIVATE TDESKTOP_API_ID=17349 TDESKTOP_API_HASH=344583e45741c457fe1862106095a5eb -) - -target_link_libraries(Telegram -PRIVATE - lib_base - lib_ui - lib_tl + AL_LIBTYPE_STATIC + AL_ALEXT_PROTOTYPES ) diff --git a/Telegram/cmake/lib_export.cmake b/Telegram/cmake/lib_export.cmake new file mode 100644 index 000000000..293043392 --- /dev/null +++ b/Telegram/cmake/lib_export.cmake @@ -0,0 +1,41 @@ +add_library(lib_export OBJECT) +init_target(lib_export) + +set(lib_export_sources +PRIVATE + export/export_api_wrap.cpp + export/export_api_wrap.h + export/export_controller.cpp + export/export_controller.h + export/export_settings.cpp + export/export_settings.h + export/data/export_data_types.cpp + export/data/export_data_types.h + export/output/export_output_abstract.cpp + export/output/export_output_abstract.h + export/output/export_output_file.cpp + export/output/export_output_file.h + export/output/export_output_html.cpp + export/output/export_output_html.h + export/output/export_output_json.cpp + export/output/export_output_json.h + export/output/export_output_result.h + export/output/export_output_stats.cpp + export/output/export_output_stats.h + export/output/export_output_text.cpp + export/output/export_output_text.h +) +nice_target_sources(lib_export ${src_loc} "${lib_export_sources}") + +force_include(lib_export export/export_pch.h) + +target_include_directories(lib_export +PUBLIC + ${src_loc} +) + +target_link_libraries(lib_export +PUBLIC + lib_base + lib_scheme +) diff --git a/Telegram/cmake/lib_ffmpeg.cmake b/Telegram/cmake/lib_ffmpeg.cmake new file mode 100644 index 000000000..0f38075bb --- /dev/null +++ b/Telegram/cmake/lib_ffmpeg.cmake @@ -0,0 +1,20 @@ +add_library(lib_ffmpeg OBJECT) +init_target(lib_ffmpeg) + +set(lib_ffmpeg_sources +PRIVATE + ffmpeg/ffmpeg_utility.cpp + ffmpeg/ffmpeg_utility.h +) +nice_target_sources(lib_ffmpeg ${src_loc} "${lib_ffmpeg_sources}") + +target_include_directories(lib_ffmpeg +PUBLIC + ${src_loc} + ${libs_loc}/ffmpeg +) + +target_link_libraries(lib_ffmpeg +PUBLIC + lib_base +) diff --git a/Telegram/cmake/lib_lz4.cmake b/Telegram/cmake/lib_lz4.cmake new file mode 100644 index 000000000..373c8366a --- /dev/null +++ b/Telegram/cmake/lib_lz4.cmake @@ -0,0 +1,22 @@ +add_library(lib_lz4 OBJECT) +init_target(lib_lz4) + +set(lz4_loc ${third_party_loc}/lz4/lib) + +target_sources(lib_lz4 +PRIVATE + ${lz4_loc}/lz4.c + ${lz4_loc}/lz4.h + ${lz4_loc}/lz4frame.c + ${lz4_loc}/lz4frame.h + ${lz4_loc}/lz4frame_static.h + ${lz4_loc}/lz4hc.c + ${lz4_loc}/lz4hc.h + ${lz4_loc}/xxhash.c + ${lz4_loc}/xxhash.h +) + +target_include_directories(lib_lz4 +PUBLIC + ${lz4_loc} +) diff --git a/Telegram/cmake/lib_mtproto.cmake b/Telegram/cmake/lib_mtproto.cmake new file mode 100644 index 000000000..74878a42f --- /dev/null +++ b/Telegram/cmake/lib_mtproto.cmake @@ -0,0 +1,25 @@ +add_library(lib_mtproto OBJECT) +init_target(lib_mtproto) + +set(lib_mtproto_sources +PRIVATE + mtproto/mtp_abstract_socket.cpp + mtproto/mtp_abstract_socket.h + mtproto/mtp_tcp_socket.cpp + mtproto/mtp_tcp_socket.h + mtproto/mtp_tls_socket.cpp + mtproto/mtp_tls_socket.h +) +nice_target_sources(lib_mtproto ${src_loc} "${lib_mtproto_sources}") + +force_include(lib_mtproto mtproto/mtp_pch.h) + +target_include_directories(lib_mtproto +PUBLIC + ${src_loc} +) + +target_link_libraries(lib_mtproto +PUBLIC + lib_scheme +) diff --git a/Telegram/cmake/lib_scheme.cmake b/Telegram/cmake/lib_scheme.cmake new file mode 100644 index 000000000..eaf1fa4e0 --- /dev/null +++ b/Telegram/cmake/lib_scheme.cmake @@ -0,0 +1,22 @@ +add_library(lib_scheme OBJECT) +init_target(lib_scheme) + +include(cmake/generate_scheme.cmake) + +set(scheme_files + ${res_loc}/tl/mtproto.tl + ${res_loc}/tl/api.tl +) + +generate_scheme(lib_scheme ${src_loc}/codegen/scheme/codegen_scheme.py "${scheme_files}") + +target_include_directories(lib_scheme +PUBLIC + ${src_loc} +) + +target_link_libraries(lib_scheme +PUBLIC + lib_base + lib_tl +) diff --git a/Telegram/cmake/lib_tgvoip.cmake b/Telegram/cmake/lib_tgvoip.cmake new file mode 100644 index 000000000..037b56423 --- /dev/null +++ b/Telegram/cmake/lib_tgvoip.cmake @@ -0,0 +1,732 @@ +add_library(lib_tgvoip OBJECT) +init_target_no_ranges(lib_tgvoip) + +set(tgvoip_loc ${third_party_loc}/libtgvoip) + +set(lib_tgvoip_sources +PRIVATE + BlockingQueue.cpp + BlockingQueue.h + Buffers.cpp + Buffers.h + CongestionControl.cpp + CongestionControl.h + EchoCanceller.cpp + EchoCanceller.h + JitterBuffer.cpp + JitterBuffer.h + logging.cpp + logging.h + MediaStreamItf.cpp + MediaStreamItf.h + OpusDecoder.cpp + OpusDecoder.h + OpusEncoder.cpp + OpusEncoder.h + threading.h + VoIPController.cpp + VoIPGroupController.cpp + VoIPController.h + PrivateDefines.h + VoIPServerConfig.cpp + VoIPServerConfig.h + audio/AudioInput.cpp + audio/AudioInput.h + audio/AudioOutput.cpp + audio/AudioOutput.h + audio/Resampler.cpp + audio/Resampler.h + NetworkSocket.cpp + NetworkSocket.h + PacketReassembler.cpp + PacketReassembler.h + MessageThread.cpp + MessageThread.h + audio/AudioIO.cpp + audio/AudioIO.h + video/ScreamCongestionController.cpp + video/ScreamCongestionController.h + video/VideoSource.cpp + video/VideoSource.h + video/VideoRenderer.cpp + video/VideoRenderer.h + json11.cpp + json11.hpp + + # Windows + os/windows/NetworkSocketWinsock.cpp + os/windows/NetworkSocketWinsock.h + os/windows/AudioInputWave.cpp + os/windows/AudioInputWave.h + os/windows/AudioOutputWave.cpp + os/windows/AudioOutputWave.h + os/windows/AudioOutputWASAPI.cpp + os/windows/AudioOutputWASAPI.h + os/windows/AudioInputWASAPI.cpp + os/windows/AudioInputWASAPI.h + os/windows/WindowsSpecific.cpp + os/windows/WindowsSpecific.h + + # macOS + os/darwin/AudioInputAudioUnit.cpp + os/darwin/AudioInputAudioUnit.h + os/darwin/AudioOutputAudioUnit.cpp + os/darwin/AudioOutputAudioUnit.h + os/darwin/AudioInputAudioUnitOSX.cpp + os/darwin/AudioInputAudioUnitOSX.h + os/darwin/AudioOutputAudioUnitOSX.cpp + os/darwin/AudioOutputAudioUnitOSX.h + os/darwin/AudioUnitIO.cpp + os/darwin/AudioUnitIO.h + os/darwin/DarwinSpecific.mm + os/darwin/DarwinSpecific.h + + # Linux + os/linux/AudioInputALSA.cpp + os/linux/AudioInputALSA.h + os/linux/AudioOutputALSA.cpp + os/linux/AudioOutputALSA.h + os/linux/AudioOutputPulse.cpp + os/linux/AudioOutputPulse.h + os/linux/AudioInputPulse.cpp + os/linux/AudioInputPulse.h + os/linux/AudioPulse.cpp + os/linux/AudioPulse.h + + # POSIX + os/posix/NetworkSocketPosix.cpp + os/posix/NetworkSocketPosix.h + + # WebRTC APM + webrtc_dsp/system_wrappers/include/field_trial.h + webrtc_dsp/system_wrappers/include/cpu_features_wrapper.h + webrtc_dsp/system_wrappers/include/asm_defines.h + webrtc_dsp/system_wrappers/include/metrics.h + webrtc_dsp/system_wrappers/include/compile_assert_c.h + webrtc_dsp/system_wrappers/source/field_trial.cc + webrtc_dsp/system_wrappers/source/metrics.cc + webrtc_dsp/system_wrappers/source/cpu_features.cc + webrtc_dsp/typedefs.h + webrtc_dsp/absl/strings/internal/memutil.h + webrtc_dsp/absl/strings/internal/memutil.cc + webrtc_dsp/absl/strings/string_view.cc + webrtc_dsp/absl/strings/ascii.h + webrtc_dsp/absl/strings/ascii.cc + webrtc_dsp/absl/strings/string_view.h + webrtc_dsp/absl/types/optional.h + webrtc_dsp/absl/types/bad_optional_access.h + webrtc_dsp/absl/types/bad_optional_access.cc + webrtc_dsp/absl/types/optional.cc + webrtc_dsp/absl/memory/memory.h + webrtc_dsp/absl/meta/type_traits.h + webrtc_dsp/absl/algorithm/algorithm.h + webrtc_dsp/absl/container/inlined_vector.h + webrtc_dsp/absl/base/policy_checks.h + webrtc_dsp/absl/base/port.h + webrtc_dsp/absl/base/config.h + webrtc_dsp/absl/base/internal/raw_logging.cc + webrtc_dsp/absl/base/internal/throw_delegate.cc + webrtc_dsp/absl/base/internal/invoke.h + webrtc_dsp/absl/base/internal/inline_variable.h + webrtc_dsp/absl/base/internal/atomic_hook.h + webrtc_dsp/absl/base/internal/identity.h + webrtc_dsp/absl/base/internal/raw_logging.h + webrtc_dsp/absl/base/internal/throw_delegate.h + webrtc_dsp/absl/base/attributes.h + webrtc_dsp/absl/base/macros.h + webrtc_dsp/absl/base/optimization.h + webrtc_dsp/absl/base/log_severity.h + webrtc_dsp/absl/utility/utility.h + webrtc_dsp/rtc_base/string_to_number.h + webrtc_dsp/rtc_base/constructormagic.h + webrtc_dsp/rtc_base/race_checker.cc + webrtc_dsp/rtc_base/strings/string_builder.h + webrtc_dsp/rtc_base/strings/string_builder.cc + webrtc_dsp/rtc_base/event_tracer.h + webrtc_dsp/rtc_base/stringencode.h + webrtc_dsp/rtc_base/memory/aligned_malloc.cc + webrtc_dsp/rtc_base/memory/aligned_malloc.h + webrtc_dsp/rtc_base/timeutils.cc + webrtc_dsp/rtc_base/event.h + webrtc_dsp/rtc_base/ignore_wundef.h + webrtc_dsp/rtc_base/stringutils.h + webrtc_dsp/rtc_base/arraysize.h + webrtc_dsp/rtc_base/platform_file.cc + webrtc_dsp/rtc_base/swap_queue.h + webrtc_dsp/rtc_base/string_to_number.cc + webrtc_dsp/rtc_base/trace_event.h + webrtc_dsp/rtc_base/checks.h + webrtc_dsp/rtc_base/deprecation.h + webrtc_dsp/rtc_base/thread_checker_impl.cc + webrtc_dsp/rtc_base/sanitizer.h + webrtc_dsp/rtc_base/scoped_ref_ptr.h + webrtc_dsp/rtc_base/logging.h + webrtc_dsp/rtc_base/timeutils.h + webrtc_dsp/rtc_base/atomicops.h + webrtc_dsp/rtc_base/stringencode.cc + webrtc_dsp/rtc_base/stringutils.cc + webrtc_dsp/rtc_base/checks.cc + webrtc_dsp/rtc_base/numerics/safe_minmax.h + webrtc_dsp/rtc_base/numerics/safe_conversions.h + webrtc_dsp/rtc_base/numerics/safe_conversions_impl.h + webrtc_dsp/rtc_base/numerics/safe_compare.h + webrtc_dsp/rtc_base/system/unused.h + webrtc_dsp/rtc_base/system/inline.h + webrtc_dsp/rtc_base/system/ignore_warnings.h + webrtc_dsp/rtc_base/system/asm_defines.h + webrtc_dsp/rtc_base/system/rtc_export.h + webrtc_dsp/rtc_base/system/arch.h + webrtc_dsp/rtc_base/platform_thread.cc + webrtc_dsp/rtc_base/platform_thread.h + webrtc_dsp/rtc_base/platform_thread_types.h + webrtc_dsp/rtc_base/protobuf_utils.h + webrtc_dsp/rtc_base/thread_annotations.h + webrtc_dsp/rtc_base/gtest_prod_util.h + webrtc_dsp/rtc_base/function_view.h + webrtc_dsp/rtc_base/criticalsection.h + webrtc_dsp/rtc_base/criticalsection.cc + webrtc_dsp/rtc_base/platform_thread_types.cc + webrtc_dsp/rtc_base/refcount.h + webrtc_dsp/rtc_base/event.cc + webrtc_dsp/rtc_base/thread_checker_impl.h + webrtc_dsp/rtc_base/event_tracer.cc + webrtc_dsp/rtc_base/compile_assert_c.h + webrtc_dsp/rtc_base/logging_webrtc.cc + webrtc_dsp/rtc_base/type_traits.h + webrtc_dsp/rtc_base/platform_file.h + webrtc_dsp/rtc_base/refcounter.h + webrtc_dsp/rtc_base/logging_mac.h + webrtc_dsp/rtc_base/thread_checker.h + webrtc_dsp/rtc_base/race_checker.h + webrtc_dsp/rtc_base/refcountedobject.h + webrtc_dsp/third_party/rnnoise/src/rnn_vad_weights.cc + webrtc_dsp/third_party/rnnoise/src/rnn_activations.h + webrtc_dsp/third_party/rnnoise/src/kiss_fft.h + webrtc_dsp/third_party/rnnoise/src/kiss_fft.cc + webrtc_dsp/third_party/rnnoise/src/rnn_vad_weights.h + webrtc_dsp/api/audio/audio_frame.cc + webrtc_dsp/api/audio/echo_canceller3_config.h + webrtc_dsp/api/audio/echo_control.h + webrtc_dsp/api/audio/audio_frame.h + webrtc_dsp/api/audio/echo_canceller3_config.cc + webrtc_dsp/api/audio/echo_canceller3_factory.h + webrtc_dsp/api/audio/echo_canceller3_factory.cc + webrtc_dsp/api/array_view.h + webrtc_dsp/modules/third_party/fft/fft.h + webrtc_dsp/modules/third_party/fft/fft.c + webrtc_dsp/modules/audio_coding/codecs/isac/bandwidth_info.h + webrtc_dsp/modules/audio_coding/codecs/isac/main/include/isac.h + webrtc_dsp/modules/audio_coding/codecs/isac/main/source/pitch_estimator.c + webrtc_dsp/modules/audio_coding/codecs/isac/main/source/lpc_shape_swb16_tables.c + webrtc_dsp/modules/audio_coding/codecs/isac/main/source/pitch_gain_tables.c + webrtc_dsp/modules/audio_coding/codecs/isac/main/source/arith_routines_logist.c + webrtc_dsp/modules/audio_coding/codecs/isac/main/source/os_specific_inline.h + webrtc_dsp/modules/audio_coding/codecs/isac/main/source/filterbanks.c + webrtc_dsp/modules/audio_coding/codecs/isac/main/source/entropy_coding.h + webrtc_dsp/modules/audio_coding/codecs/isac/main/source/isac_vad.h + webrtc_dsp/modules/audio_coding/codecs/isac/main/source/settings.h + webrtc_dsp/modules/audio_coding/codecs/isac/main/source/transform.c + webrtc_dsp/modules/audio_coding/codecs/isac/main/source/lpc_shape_swb12_tables.h + webrtc_dsp/modules/audio_coding/codecs/isac/main/source/arith_routines.h + webrtc_dsp/modules/audio_coding/codecs/isac/main/source/crc.h + webrtc_dsp/modules/audio_coding/codecs/isac/main/source/pitch_filter.c + webrtc_dsp/modules/audio_coding/codecs/isac/main/source/encode_lpc_swb.c + webrtc_dsp/modules/audio_coding/codecs/isac/main/source/filter_functions.c + webrtc_dsp/modules/audio_coding/codecs/isac/main/source/decode.c + webrtc_dsp/modules/audio_coding/codecs/isac/main/source/lattice.c + webrtc_dsp/modules/audio_coding/codecs/isac/main/source/intialize.c + webrtc_dsp/modules/audio_coding/codecs/isac/main/source/lpc_tables.c + webrtc_dsp/modules/audio_coding/codecs/isac/main/source/lpc_gain_swb_tables.c + webrtc_dsp/modules/audio_coding/codecs/isac/main/source/bandwidth_estimator.c + webrtc_dsp/modules/audio_coding/codecs/isac/main/source/isac_float_type.h + webrtc_dsp/modules/audio_coding/codecs/isac/main/source/pitch_lag_tables.h + webrtc_dsp/modules/audio_coding/codecs/isac/main/source/encode.c + webrtc_dsp/modules/audio_coding/codecs/isac/main/source/lpc_analysis.c + webrtc_dsp/modules/audio_coding/codecs/isac/main/source/spectrum_ar_model_tables.h + webrtc_dsp/modules/audio_coding/codecs/isac/main/source/arith_routines_hist.c + webrtc_dsp/modules/audio_coding/codecs/isac/main/source/codec.h + webrtc_dsp/modules/audio_coding/codecs/isac/main/source/pitch_gain_tables.h + webrtc_dsp/modules/audio_coding/codecs/isac/main/source/lpc_shape_swb16_tables.h + webrtc_dsp/modules/audio_coding/codecs/isac/main/source/pitch_estimator.h + webrtc_dsp/modules/audio_coding/codecs/isac/main/source/entropy_coding.c + webrtc_dsp/modules/audio_coding/codecs/isac/main/source/isac_vad.c + webrtc_dsp/modules/audio_coding/codecs/isac/main/source/structs.h + webrtc_dsp/modules/audio_coding/codecs/isac/main/source/filter_functions.h + webrtc_dsp/modules/audio_coding/codecs/isac/main/source/encode_lpc_swb.h + webrtc_dsp/modules/audio_coding/codecs/isac/main/source/pitch_filter.h + webrtc_dsp/modules/audio_coding/codecs/isac/main/source/arith_routines.c + webrtc_dsp/modules/audio_coding/codecs/isac/main/source/crc.c + webrtc_dsp/modules/audio_coding/codecs/isac/main/source/lpc_shape_swb12_tables.c + webrtc_dsp/modules/audio_coding/codecs/isac/main/source/lpc_analysis.h + webrtc_dsp/modules/audio_coding/codecs/isac/main/source/decode_bwe.c + webrtc_dsp/modules/audio_coding/codecs/isac/main/source/spectrum_ar_model_tables.c + webrtc_dsp/modules/audio_coding/codecs/isac/main/source/bandwidth_estimator.h + webrtc_dsp/modules/audio_coding/codecs/isac/main/source/pitch_lag_tables.c + webrtc_dsp/modules/audio_coding/codecs/isac/main/source/isac.c + webrtc_dsp/modules/audio_coding/codecs/isac/main/source/lpc_gain_swb_tables.h + webrtc_dsp/modules/audio_coding/codecs/isac/main/source/lpc_tables.h + webrtc_dsp/modules/audio_processing/rms_level.cc + webrtc_dsp/modules/audio_processing/echo_detector/moving_max.h + webrtc_dsp/modules/audio_processing/echo_detector/circular_buffer.h + webrtc_dsp/modules/audio_processing/echo_detector/normalized_covariance_estimator.h + webrtc_dsp/modules/audio_processing/echo_detector/normalized_covariance_estimator.cc + webrtc_dsp/modules/audio_processing/echo_detector/moving_max.cc + webrtc_dsp/modules/audio_processing/echo_detector/circular_buffer.cc + webrtc_dsp/modules/audio_processing/echo_detector/mean_variance_estimator.cc + webrtc_dsp/modules/audio_processing/echo_detector/mean_variance_estimator.h + webrtc_dsp/modules/audio_processing/gain_control_for_experimental_agc.h + webrtc_dsp/modules/audio_processing/splitting_filter.cc + webrtc_dsp/modules/audio_processing/gain_control_impl.cc + webrtc_dsp/modules/audio_processing/rms_level.h + webrtc_dsp/modules/audio_processing/ns/ns_core.h + webrtc_dsp/modules/audio_processing/ns/nsx_core.c + webrtc_dsp/modules/audio_processing/ns/noise_suppression_x.c + webrtc_dsp/modules/audio_processing/ns/nsx_core_c.c + webrtc_dsp/modules/audio_processing/ns/defines.h + webrtc_dsp/modules/audio_processing/ns/noise_suppression.h + webrtc_dsp/modules/audio_processing/ns/ns_core.c + webrtc_dsp/modules/audio_processing/ns/nsx_core.h + webrtc_dsp/modules/audio_processing/ns/windows_private.h + webrtc_dsp/modules/audio_processing/ns/noise_suppression_x.h + webrtc_dsp/modules/audio_processing/ns/noise_suppression.c + webrtc_dsp/modules/audio_processing/ns/nsx_defines.h + webrtc_dsp/modules/audio_processing/residual_echo_detector.h + webrtc_dsp/modules/audio_processing/audio_processing_impl.h + webrtc_dsp/modules/audio_processing/audio_buffer.cc + webrtc_dsp/modules/audio_processing/typing_detection.cc + webrtc_dsp/modules/audio_processing/render_queue_item_verifier.h + webrtc_dsp/modules/audio_processing/include/audio_generator.h + webrtc_dsp/modules/audio_processing/include/config.h + webrtc_dsp/modules/audio_processing/include/audio_frame_view.h + webrtc_dsp/modules/audio_processing/include/mock_audio_processing.h + webrtc_dsp/modules/audio_processing/include/gain_control.h + webrtc_dsp/modules/audio_processing/include/audio_generator_factory.h + webrtc_dsp/modules/audio_processing/include/audio_processing_statistics.cc + webrtc_dsp/modules/audio_processing/include/audio_generator_factory.cc + webrtc_dsp/modules/audio_processing/include/aec_dump.cc + webrtc_dsp/modules/audio_processing/include/aec_dump.h + webrtc_dsp/modules/audio_processing/include/audio_processing_statistics.h + webrtc_dsp/modules/audio_processing/include/audio_processing.h + webrtc_dsp/modules/audio_processing/include/audio_processing.cc + webrtc_dsp/modules/audio_processing/include/config.cc + webrtc_dsp/modules/audio_processing/agc2/interpolated_gain_curve.h + webrtc_dsp/modules/audio_processing/agc2/biquad_filter.h + webrtc_dsp/modules/audio_processing/agc2/interpolated_gain_curve.cc + webrtc_dsp/modules/audio_processing/agc2/agc2_common.cc + webrtc_dsp/modules/audio_processing/agc2/agc2_testing_common.h + webrtc_dsp/modules/audio_processing/agc2/adaptive_mode_level_estimator.h + webrtc_dsp/modules/audio_processing/agc2/gain_applier.cc + webrtc_dsp/modules/audio_processing/agc2/signal_classifier.h + webrtc_dsp/modules/audio_processing/agc2/adaptive_agc.cc + webrtc_dsp/modules/audio_processing/agc2/adaptive_digital_gain_applier.cc + webrtc_dsp/modules/audio_processing/agc2/limiter.cc + webrtc_dsp/modules/audio_processing/agc2/saturation_protector.cc + webrtc_dsp/modules/audio_processing/agc2/vector_float_frame.h + webrtc_dsp/modules/audio_processing/agc2/rnn_vad/spectral_features_internal.cc + webrtc_dsp/modules/audio_processing/agc2/rnn_vad/sequence_buffer.h + webrtc_dsp/modules/audio_processing/agc2/rnn_vad/rnn.h + webrtc_dsp/modules/audio_processing/agc2/rnn_vad/rnn.cc + webrtc_dsp/modules/audio_processing/agc2/rnn_vad/test_utils.h + webrtc_dsp/modules/audio_processing/agc2/rnn_vad/pitch_info.h + webrtc_dsp/modules/audio_processing/agc2/rnn_vad/lp_residual.h + webrtc_dsp/modules/audio_processing/agc2/rnn_vad/ring_buffer.h + webrtc_dsp/modules/audio_processing/agc2/rnn_vad/pitch_search_internal.cc + webrtc_dsp/modules/audio_processing/agc2/rnn_vad/symmetric_matrix_buffer.h + webrtc_dsp/modules/audio_processing/agc2/rnn_vad/spectral_features.h + webrtc_dsp/modules/audio_processing/agc2/rnn_vad/features_extraction.h + webrtc_dsp/modules/audio_processing/agc2/rnn_vad/common.h + webrtc_dsp/modules/audio_processing/agc2/rnn_vad/spectral_features_internal.h + webrtc_dsp/modules/audio_processing/agc2/rnn_vad/fft_util.h + webrtc_dsp/modules/audio_processing/agc2/rnn_vad/spectral_features.cc + webrtc_dsp/modules/audio_processing/agc2/rnn_vad/pitch_search_internal.h + webrtc_dsp/modules/audio_processing/agc2/rnn_vad/pitch_search.cc + webrtc_dsp/modules/audio_processing/agc2/rnn_vad/pitch_search.h + webrtc_dsp/modules/audio_processing/agc2/rnn_vad/features_extraction.cc + webrtc_dsp/modules/audio_processing/agc2/rnn_vad/fft_util.cc + webrtc_dsp/modules/audio_processing/agc2/rnn_vad/lp_residual.cc + webrtc_dsp/modules/audio_processing/agc2/fixed_gain_controller.h + webrtc_dsp/modules/audio_processing/agc2/adaptive_mode_level_estimator_agc.cc + webrtc_dsp/modules/audio_processing/agc2/vector_float_frame.cc + webrtc_dsp/modules/audio_processing/agc2/down_sampler.h + webrtc_dsp/modules/audio_processing/agc2/noise_level_estimator.cc + webrtc_dsp/modules/audio_processing/agc2/agc2_testing_common.cc + webrtc_dsp/modules/audio_processing/agc2/fixed_digital_level_estimator.cc + webrtc_dsp/modules/audio_processing/agc2/fixed_gain_controller.cc + webrtc_dsp/modules/audio_processing/agc2/saturation_protector.h + webrtc_dsp/modules/audio_processing/agc2/vad_with_level.cc + webrtc_dsp/modules/audio_processing/agc2/limiter_db_gain_curve.cc + webrtc_dsp/modules/audio_processing/agc2/agc2_common.h + webrtc_dsp/modules/audio_processing/agc2/adaptive_mode_level_estimator_agc.h + webrtc_dsp/modules/audio_processing/agc2/adaptive_digital_gain_applier.h + webrtc_dsp/modules/audio_processing/agc2/vad_with_level.h + webrtc_dsp/modules/audio_processing/agc2/limiter_db_gain_curve.h + webrtc_dsp/modules/audio_processing/agc2/fixed_digital_level_estimator.h + webrtc_dsp/modules/audio_processing/agc2/adaptive_agc.h + webrtc_dsp/modules/audio_processing/agc2/gain_applier.h + webrtc_dsp/modules/audio_processing/agc2/down_sampler.cc + webrtc_dsp/modules/audio_processing/agc2/noise_level_estimator.h + webrtc_dsp/modules/audio_processing/agc2/signal_classifier.cc + webrtc_dsp/modules/audio_processing/agc2/noise_spectrum_estimator.cc + webrtc_dsp/modules/audio_processing/agc2/compute_interpolated_gain_curve.cc + webrtc_dsp/modules/audio_processing/agc2/compute_interpolated_gain_curve.h + webrtc_dsp/modules/audio_processing/agc2/biquad_filter.cc + webrtc_dsp/modules/audio_processing/agc2/noise_spectrum_estimator.h + webrtc_dsp/modules/audio_processing/agc2/limiter.h + webrtc_dsp/modules/audio_processing/agc2/adaptive_mode_level_estimator.cc + webrtc_dsp/modules/audio_processing/transient/moving_moments.cc + webrtc_dsp/modules/audio_processing/transient/transient_detector.h + webrtc_dsp/modules/audio_processing/transient/wpd_tree.cc + webrtc_dsp/modules/audio_processing/transient/transient_suppressor.h + webrtc_dsp/modules/audio_processing/transient/daubechies_8_wavelet_coeffs.h + webrtc_dsp/modules/audio_processing/transient/common.h + webrtc_dsp/modules/audio_processing/transient/wpd_node.h + webrtc_dsp/modules/audio_processing/transient/moving_moments.h + webrtc_dsp/modules/audio_processing/transient/wpd_tree.h + webrtc_dsp/modules/audio_processing/transient/wpd_node.cc + webrtc_dsp/modules/audio_processing/transient/transient_suppressor.cc + webrtc_dsp/modules/audio_processing/transient/transient_detector.cc + webrtc_dsp/modules/audio_processing/transient/dyadic_decimator.h + webrtc_dsp/modules/audio_processing/low_cut_filter.cc + webrtc_dsp/modules/audio_processing/noise_suppression_impl.h + webrtc_dsp/modules/audio_processing/level_estimator_impl.cc + webrtc_dsp/modules/audio_processing/three_band_filter_bank.cc + webrtc_dsp/modules/audio_processing/aec/echo_cancellation.cc + webrtc_dsp/modules/audio_processing/aec/aec_resampler.h + webrtc_dsp/modules/audio_processing/aec/aec_resampler.cc + webrtc_dsp/modules/audio_processing/aec/echo_cancellation.h + webrtc_dsp/modules/audio_processing/aec/aec_core.cc + webrtc_dsp/modules/audio_processing/aec/aec_core.h + webrtc_dsp/modules/audio_processing/aec/aec_core_optimized_methods.h + webrtc_dsp/modules/audio_processing/aec/aec_core_sse2.cc + webrtc_dsp/modules/audio_processing/aec/aec_common.h + webrtc_dsp/modules/audio_processing/voice_detection_impl.h + webrtc_dsp/modules/audio_processing/voice_detection_impl.cc + webrtc_dsp/modules/audio_processing/echo_cancellation_impl.cc + webrtc_dsp/modules/audio_processing/gain_control_for_experimental_agc.cc + webrtc_dsp/modules/audio_processing/agc/agc.cc + webrtc_dsp/modules/audio_processing/agc/loudness_histogram.cc + webrtc_dsp/modules/audio_processing/agc/agc_manager_direct.cc + webrtc_dsp/modules/audio_processing/agc/legacy/analog_agc.h + webrtc_dsp/modules/audio_processing/agc/legacy/gain_control.h + webrtc_dsp/modules/audio_processing/agc/legacy/digital_agc.h + webrtc_dsp/modules/audio_processing/agc/legacy/analog_agc.c + webrtc_dsp/modules/audio_processing/agc/legacy/digital_agc.c + webrtc_dsp/modules/audio_processing/agc/utility.cc + webrtc_dsp/modules/audio_processing/agc/mock_agc.h + webrtc_dsp/modules/audio_processing/agc/loudness_histogram.h + webrtc_dsp/modules/audio_processing/agc/gain_map_internal.h + webrtc_dsp/modules/audio_processing/agc/utility.h + webrtc_dsp/modules/audio_processing/agc/agc_manager_direct.h + webrtc_dsp/modules/audio_processing/agc/agc.h + webrtc_dsp/modules/audio_processing/common.h + webrtc_dsp/modules/audio_processing/audio_processing_impl.cc + webrtc_dsp/modules/audio_processing/audio_buffer.h + webrtc_dsp/modules/audio_processing/echo_control_mobile_impl.h + webrtc_dsp/modules/audio_processing/splitting_filter.h + webrtc_dsp/modules/audio_processing/low_cut_filter.h + webrtc_dsp/modules/audio_processing/audio_generator/file_audio_generator.h + webrtc_dsp/modules/audio_processing/audio_generator/file_audio_generator.cc + webrtc_dsp/modules/audio_processing/gain_controller2.cc + webrtc_dsp/modules/audio_processing/three_band_filter_bank.h + webrtc_dsp/modules/audio_processing/residual_echo_detector.cc + webrtc_dsp/modules/audio_processing/echo_cancellation_impl.h + webrtc_dsp/modules/audio_processing/noise_suppression_impl.cc + webrtc_dsp/modules/audio_processing/level_estimator_impl.h + webrtc_dsp/modules/audio_processing/gain_controller2.h + webrtc_dsp/modules/audio_processing/aecm/aecm_core.h + webrtc_dsp/modules/audio_processing/aecm/aecm_defines.h + webrtc_dsp/modules/audio_processing/aecm/aecm_core.cc + webrtc_dsp/modules/audio_processing/aecm/aecm_core_c.cc + webrtc_dsp/modules/audio_processing/aecm/echo_control_mobile.h + webrtc_dsp/modules/audio_processing/aecm/echo_control_mobile.cc + webrtc_dsp/modules/audio_processing/aec3/render_reverb_model.cc + webrtc_dsp/modules/audio_processing/aec3/downsampled_render_buffer.h + webrtc_dsp/modules/audio_processing/aec3/subtractor_output_analyzer.h + webrtc_dsp/modules/audio_processing/aec3/reverb_model_fallback.cc + webrtc_dsp/modules/audio_processing/aec3/residual_echo_estimator.h + webrtc_dsp/modules/audio_processing/aec3/shadow_filter_update_gain.h + webrtc_dsp/modules/audio_processing/aec3/echo_remover_metrics.cc + webrtc_dsp/modules/audio_processing/aec3/matched_filter_lag_aggregator.cc + webrtc_dsp/modules/audio_processing/aec3/render_delay_buffer2.cc + webrtc_dsp/modules/audio_processing/aec3/aec_state.h + webrtc_dsp/modules/audio_processing/aec3/suppression_filter.h + webrtc_dsp/modules/audio_processing/aec3/echo_path_variability.cc + webrtc_dsp/modules/audio_processing/aec3/frame_blocker.cc + webrtc_dsp/modules/audio_processing/aec3/subtractor.cc + webrtc_dsp/modules/audio_processing/aec3/block_delay_buffer.h + webrtc_dsp/modules/audio_processing/aec3/adaptive_fir_filter.h + webrtc_dsp/modules/audio_processing/aec3/cascaded_biquad_filter.h + webrtc_dsp/modules/audio_processing/aec3/matched_filter.h + webrtc_dsp/modules/audio_processing/aec3/subtractor_output.h + webrtc_dsp/modules/audio_processing/aec3/render_signal_analyzer.h + webrtc_dsp/modules/audio_processing/aec3/aec3_fft.cc + webrtc_dsp/modules/audio_processing/aec3/aec3_fft.h + webrtc_dsp/modules/audio_processing/aec3/echo_remover_metrics.h + webrtc_dsp/modules/audio_processing/aec3/fullband_erle_estimator.cc + webrtc_dsp/modules/audio_processing/aec3/suppression_filter.cc + webrtc_dsp/modules/audio_processing/aec3/block_processor.cc + webrtc_dsp/modules/audio_processing/aec3/filter_analyzer.h + webrtc_dsp/modules/audio_processing/aec3/subtractor.h + webrtc_dsp/modules/audio_processing/aec3/echo_path_delay_estimator.h + webrtc_dsp/modules/audio_processing/aec3/subband_erle_estimator.cc + webrtc_dsp/modules/audio_processing/aec3/render_delay_controller_metrics.cc + webrtc_dsp/modules/audio_processing/aec3/render_delay_buffer.cc + webrtc_dsp/modules/audio_processing/aec3/block_processor_metrics.h + webrtc_dsp/modules/audio_processing/aec3/vector_buffer.cc + webrtc_dsp/modules/audio_processing/aec3/erl_estimator.cc + webrtc_dsp/modules/audio_processing/aec3/aec_state.cc + webrtc_dsp/modules/audio_processing/aec3/adaptive_fir_filter.cc + webrtc_dsp/modules/audio_processing/aec3/fft_data.h + webrtc_dsp/modules/audio_processing/aec3/render_delay_controller.cc + webrtc_dsp/modules/audio_processing/aec3/skew_estimator.cc + webrtc_dsp/modules/audio_processing/aec3/render_delay_controller_metrics.h + webrtc_dsp/modules/audio_processing/aec3/comfort_noise_generator.h + webrtc_dsp/modules/audio_processing/aec3/echo_path_delay_estimator.cc + webrtc_dsp/modules/audio_processing/aec3/erl_estimator.h + webrtc_dsp/modules/audio_processing/aec3/echo_remover.h + webrtc_dsp/modules/audio_processing/aec3/block_framer.cc + webrtc_dsp/modules/audio_processing/aec3/erle_estimator.cc + webrtc_dsp/modules/audio_processing/aec3/reverb_model.cc + webrtc_dsp/modules/audio_processing/aec3/cascaded_biquad_filter.cc + webrtc_dsp/modules/audio_processing/aec3/matrix_buffer.h + webrtc_dsp/modules/audio_processing/aec3/render_buffer.cc + webrtc_dsp/modules/audio_processing/aec3/reverb_model_estimator.h + webrtc_dsp/modules/audio_processing/aec3/subtractor_output.cc + webrtc_dsp/modules/audio_processing/aec3/stationarity_estimator.cc + webrtc_dsp/modules/audio_processing/aec3/render_signal_analyzer.cc + webrtc_dsp/modules/audio_processing/aec3/echo_path_variability.h + webrtc_dsp/modules/audio_processing/aec3/moving_average.h + webrtc_dsp/modules/audio_processing/aec3/render_reverb_model.h + webrtc_dsp/modules/audio_processing/aec3/subtractor_output_analyzer.cc + webrtc_dsp/modules/audio_processing/aec3/suppression_gain.cc + webrtc_dsp/modules/audio_processing/aec3/echo_audibility.cc + webrtc_dsp/modules/audio_processing/aec3/block_processor_metrics.cc + webrtc_dsp/modules/audio_processing/aec3/render_delay_controller.h + webrtc_dsp/modules/audio_processing/aec3/suppression_gain.h + webrtc_dsp/modules/audio_processing/aec3/moving_average.cc + webrtc_dsp/modules/audio_processing/aec3/erle_estimator.h + webrtc_dsp/modules/audio_processing/aec3/subband_erle_estimator.h + webrtc_dsp/modules/audio_processing/aec3/reverb_model_estimator.cc + webrtc_dsp/modules/audio_processing/aec3/aec3_common.cc + webrtc_dsp/modules/audio_processing/aec3/residual_echo_estimator.cc + webrtc_dsp/modules/audio_processing/aec3/block_processor.h + webrtc_dsp/modules/audio_processing/aec3/fullband_erle_estimator.h + webrtc_dsp/modules/audio_processing/aec3/matched_filter.cc + webrtc_dsp/modules/audio_processing/aec3/stationarity_estimator.h + webrtc_dsp/modules/audio_processing/aec3/echo_canceller3.h + webrtc_dsp/modules/audio_processing/aec3/skew_estimator.h + webrtc_dsp/modules/audio_processing/aec3/reverb_decay_estimator.cc + webrtc_dsp/modules/audio_processing/aec3/render_delay_controller2.cc + webrtc_dsp/modules/audio_processing/aec3/render_buffer.h + webrtc_dsp/modules/audio_processing/aec3/suppression_gain_limiter.cc + webrtc_dsp/modules/audio_processing/aec3/main_filter_update_gain.cc + webrtc_dsp/modules/audio_processing/aec3/echo_remover.cc + webrtc_dsp/modules/audio_processing/aec3/reverb_model_fallback.h + webrtc_dsp/modules/audio_processing/aec3/downsampled_render_buffer.cc + webrtc_dsp/modules/audio_processing/aec3/vector_buffer.h + webrtc_dsp/modules/audio_processing/aec3/matrix_buffer.cc + webrtc_dsp/modules/audio_processing/aec3/reverb_frequency_response.h + webrtc_dsp/modules/audio_processing/aec3/echo_audibility.h + webrtc_dsp/modules/audio_processing/aec3/fft_buffer.h + webrtc_dsp/modules/audio_processing/aec3/block_processor2.cc + webrtc_dsp/modules/audio_processing/aec3/echo_canceller3.cc + webrtc_dsp/modules/audio_processing/aec3/block_delay_buffer.cc + webrtc_dsp/modules/audio_processing/aec3/aec3_common.h + webrtc_dsp/modules/audio_processing/aec3/fft_buffer.cc + webrtc_dsp/modules/audio_processing/aec3/vector_math.h + webrtc_dsp/modules/audio_processing/aec3/decimator.h + webrtc_dsp/modules/audio_processing/aec3/frame_blocker.h + webrtc_dsp/modules/audio_processing/aec3/block_framer.h + webrtc_dsp/modules/audio_processing/aec3/suppression_gain_limiter.h + webrtc_dsp/modules/audio_processing/aec3/delay_estimate.h + webrtc_dsp/modules/audio_processing/aec3/comfort_noise_generator.cc + webrtc_dsp/modules/audio_processing/aec3/reverb_model.h + webrtc_dsp/modules/audio_processing/aec3/main_filter_update_gain.h + webrtc_dsp/modules/audio_processing/aec3/matched_filter_lag_aggregator.h + webrtc_dsp/modules/audio_processing/aec3/shadow_filter_update_gain.cc + webrtc_dsp/modules/audio_processing/aec3/filter_analyzer.cc + webrtc_dsp/modules/audio_processing/aec3/reverb_decay_estimator.h + webrtc_dsp/modules/audio_processing/aec3/reverb_frequency_response.cc + webrtc_dsp/modules/audio_processing/aec3/decimator.cc + webrtc_dsp/modules/audio_processing/aec3/render_delay_buffer.h + webrtc_dsp/modules/audio_processing/echo_control_mobile_impl.cc + webrtc_dsp/modules/audio_processing/gain_control_impl.h + webrtc_dsp/modules/audio_processing/typing_detection.h + webrtc_dsp/modules/audio_processing/logging/apm_data_dumper.cc + webrtc_dsp/modules/audio_processing/logging/apm_data_dumper.h + webrtc_dsp/modules/audio_processing/vad/voice_activity_detector.cc + webrtc_dsp/modules/audio_processing/vad/standalone_vad.cc + webrtc_dsp/modules/audio_processing/vad/vad_audio_proc_internal.h + webrtc_dsp/modules/audio_processing/vad/pitch_internal.cc + webrtc_dsp/modules/audio_processing/vad/vad_circular_buffer.cc + webrtc_dsp/modules/audio_processing/vad/vad_circular_buffer.h + webrtc_dsp/modules/audio_processing/vad/pitch_based_vad.h + webrtc_dsp/modules/audio_processing/vad/vad_audio_proc.cc + webrtc_dsp/modules/audio_processing/vad/pole_zero_filter.cc + webrtc_dsp/modules/audio_processing/vad/pole_zero_filter.h + webrtc_dsp/modules/audio_processing/vad/pitch_based_vad.cc + webrtc_dsp/modules/audio_processing/vad/gmm.h + webrtc_dsp/modules/audio_processing/vad/common.h + webrtc_dsp/modules/audio_processing/vad/vad_audio_proc.h + webrtc_dsp/modules/audio_processing/vad/voice_gmm_tables.h + webrtc_dsp/modules/audio_processing/vad/noise_gmm_tables.h + webrtc_dsp/modules/audio_processing/vad/pitch_internal.h + webrtc_dsp/modules/audio_processing/vad/gmm.cc + webrtc_dsp/modules/audio_processing/vad/standalone_vad.h + webrtc_dsp/modules/audio_processing/vad/voice_activity_detector.h + webrtc_dsp/modules/audio_processing/utility/delay_estimator_internal.h + webrtc_dsp/modules/audio_processing/utility/ooura_fft.cc + webrtc_dsp/modules/audio_processing/utility/ooura_fft.h + webrtc_dsp/modules/audio_processing/utility/delay_estimator_wrapper.cc + webrtc_dsp/modules/audio_processing/utility/ooura_fft_sse2.cc + webrtc_dsp/modules/audio_processing/utility/delay_estimator.cc + webrtc_dsp/modules/audio_processing/utility/block_mean_calculator.h + webrtc_dsp/modules/audio_processing/utility/block_mean_calculator.cc + webrtc_dsp/modules/audio_processing/utility/delay_estimator.h + webrtc_dsp/modules/audio_processing/utility/ooura_fft_tables_common.h + webrtc_dsp/modules/audio_processing/utility/delay_estimator_wrapper.h + webrtc_dsp/common_audio/mocks/mock_smoothing_filter.h + webrtc_dsp/common_audio/wav_file.h + webrtc_dsp/common_audio/window_generator.cc + webrtc_dsp/common_audio/channel_buffer.cc + webrtc_dsp/common_audio/fir_filter_factory.cc + webrtc_dsp/common_audio/sparse_fir_filter.h + webrtc_dsp/common_audio/fir_filter_sse.h + webrtc_dsp/common_audio/window_generator.h + webrtc_dsp/common_audio/ring_buffer.h + webrtc_dsp/common_audio/fir_filter.h + webrtc_dsp/common_audio/include/audio_util.h + webrtc_dsp/common_audio/wav_header.cc + webrtc_dsp/common_audio/real_fourier_ooura.cc + webrtc_dsp/common_audio/audio_util.cc + webrtc_dsp/common_audio/real_fourier_ooura.h + webrtc_dsp/common_audio/fir_filter_sse.cc + webrtc_dsp/common_audio/smoothing_filter.h + webrtc_dsp/common_audio/resampler/push_sinc_resampler.cc + webrtc_dsp/common_audio/resampler/sinc_resampler.h + webrtc_dsp/common_audio/resampler/resampler.cc + webrtc_dsp/common_audio/resampler/sinc_resampler_sse.cc + webrtc_dsp/common_audio/resampler/include/push_resampler.h + webrtc_dsp/common_audio/resampler/include/resampler.h + webrtc_dsp/common_audio/resampler/push_sinc_resampler.h + webrtc_dsp/common_audio/resampler/push_resampler.cc + webrtc_dsp/common_audio/resampler/sinusoidal_linear_chirp_source.h + webrtc_dsp/common_audio/resampler/sinc_resampler.cc + webrtc_dsp/common_audio/resampler/sinusoidal_linear_chirp_source.cc + webrtc_dsp/common_audio/fir_filter_factory.h + webrtc_dsp/common_audio/audio_converter.h + webrtc_dsp/common_audio/wav_file.cc + webrtc_dsp/common_audio/third_party/spl_sqrt_floor/spl_sqrt_floor.c + webrtc_dsp/common_audio/third_party/spl_sqrt_floor/spl_sqrt_floor.h + webrtc_dsp/common_audio/third_party/fft4g/fft4g.c + webrtc_dsp/common_audio/third_party/fft4g/fft4g.h + webrtc_dsp/common_audio/audio_converter.cc + webrtc_dsp/common_audio/real_fourier.cc + webrtc_dsp/common_audio/channel_buffer.h + webrtc_dsp/common_audio/real_fourier.h + webrtc_dsp/common_audio/sparse_fir_filter.cc + webrtc_dsp/common_audio/smoothing_filter.cc + webrtc_dsp/common_audio/fir_filter_c.cc + webrtc_dsp/common_audio/ring_buffer.c + webrtc_dsp/common_audio/fir_filter_c.h + webrtc_dsp/common_audio/signal_processing/complex_fft_tables.h + webrtc_dsp/common_audio/signal_processing/complex_fft.c + webrtc_dsp/common_audio/signal_processing/filter_ma_fast_q12.c + webrtc_dsp/common_audio/signal_processing/levinson_durbin.c + webrtc_dsp/common_audio/signal_processing/dot_product_with_scale.cc + webrtc_dsp/common_audio/signal_processing/auto_corr_to_refl_coef.c + webrtc_dsp/common_audio/signal_processing/resample_by_2_internal.c + webrtc_dsp/common_audio/signal_processing/energy.c + webrtc_dsp/common_audio/signal_processing/sqrt_of_one_minus_x_squared.c + webrtc_dsp/common_audio/signal_processing/downsample_fast.c + webrtc_dsp/common_audio/signal_processing/splitting_filter1.c + webrtc_dsp/common_audio/signal_processing/filter_ar_fast_q12.c + webrtc_dsp/common_audio/signal_processing/spl_init.c + webrtc_dsp/common_audio/signal_processing/lpc_to_refl_coef.c + webrtc_dsp/common_audio/signal_processing/cross_correlation.c + webrtc_dsp/common_audio/signal_processing/include/signal_processing_library.h + webrtc_dsp/common_audio/signal_processing/include/real_fft.h + webrtc_dsp/common_audio/signal_processing/include/spl_inl.h + webrtc_dsp/common_audio/signal_processing/division_operations.c + webrtc_dsp/common_audio/signal_processing/auto_correlation.c + webrtc_dsp/common_audio/signal_processing/get_scaling_square.c + webrtc_dsp/common_audio/signal_processing/dot_product_with_scale.h + webrtc_dsp/common_audio/signal_processing/resample_by_2_internal.h + webrtc_dsp/common_audio/signal_processing/resample.c + webrtc_dsp/common_audio/signal_processing/min_max_operations.c + webrtc_dsp/common_audio/signal_processing/refl_coef_to_lpc.c + webrtc_dsp/common_audio/signal_processing/filter_ar.c + webrtc_dsp/common_audio/signal_processing/vector_scaling_operations.c + webrtc_dsp/common_audio/signal_processing/resample_fractional.c + webrtc_dsp/common_audio/signal_processing/real_fft.c + webrtc_dsp/common_audio/signal_processing/ilbc_specific_functions.c + webrtc_dsp/common_audio/signal_processing/complex_bit_reverse.c + webrtc_dsp/common_audio/signal_processing/randomization_functions.c + webrtc_dsp/common_audio/signal_processing/copy_set_operations.c + webrtc_dsp/common_audio/signal_processing/resample_by_2.c + webrtc_dsp/common_audio/signal_processing/get_hanning_window.c + webrtc_dsp/common_audio/signal_processing/resample_48khz.c + webrtc_dsp/common_audio/signal_processing/spl_inl.c + webrtc_dsp/common_audio/signal_processing/spl_sqrt.c + webrtc_dsp/common_audio/wav_header.h + webrtc_dsp/common_audio/vad/vad_sp.c + webrtc_dsp/common_audio/vad/vad.cc + webrtc_dsp/common_audio/vad/webrtc_vad.c + webrtc_dsp/common_audio/vad/vad_core.h + webrtc_dsp/common_audio/vad/include/vad.h + webrtc_dsp/common_audio/vad/include/webrtc_vad.h + webrtc_dsp/common_audio/vad/vad_gmm.h + webrtc_dsp/common_audio/vad/vad_filterbank.c + webrtc_dsp/common_audio/vad/vad_core.c + webrtc_dsp/common_audio/vad/vad_sp.h + webrtc_dsp/common_audio/vad/vad_filterbank.h + webrtc_dsp/common_audio/vad/vad_gmm.c + + # ARM/NEON sources + # TODO check if there's a good way to make these compile with ARM ports of TDesktop + # webrtc_dsp/modules/audio_processing/ns/nsx_core_neon.c + # webrtc_dsp/modules/audio_processing/aec/aec_core_neon.cc + # webrtc_dsp/modules/audio_processing/aecm/aecm_core_neon.cc + # webrtc_dsp/modules/audio_processing/utility/ooura_fft_tables_neon_sse2.h + # webrtc_dsp/modules/audio_processing/utility/ooura_fft_neon.cc + # webrtc_dsp/common_audio/fir_filter_neon.cc + # webrtc_dsp/common_audio/resampler/sinc_resampler_neon.cc + # webrtc_dsp/common_audio/third_party/spl_sqrt_floor/spl_sqrt_floor_arm.S + # webrtc_dsp/common_audio/fir_filter_neon.h + # webrtc_dsp/common_audio/signal_processing/downsample_fast_neon.c + # webrtc_dsp/common_audio/signal_processing/complex_bit_reverse_arm.S + # webrtc_dsp/common_audio/signal_processing/include/spl_inl_armv7.h + # webrtc_dsp/common_audio/signal_processing/min_max_operations_neon.c + # webrtc_dsp/common_audio/signal_processing/cross_correlation_neon.c + # webrtc_dsp/common_audio/signal_processing/filter_ar_fast_q12_armv7.S +) + +nice_target_sources(lib_tgvoip ${tgvoip_loc} "${lib_tgvoip_sources}") + +target_compile_definitions(lib_tgvoip +PRIVATE + WEBRTC_APM_DEBUG_DUMP=0 + TGVOIP_USE_DESKTOP_DSP + WEBRTC_NS_FLOAT + WEBRTC_WIN +) + +if (WIN32) + target_compile_options(lib_tgvoip + PRIVATE + /wd4005 + ) +endif() + +target_include_directories(lib_tgvoip +PUBLIC + ${tgvoip_loc} +PRIVATE + ${tgvoip_loc}/webrtc_dsp + ${libs_loc}/opus/include +) + +target_link_libraries(lib_tgvoip +PRIVATE + external_openssl +) diff --git a/Telegram/lib_lottie b/Telegram/lib_lottie index 94efb93b0..b8127c8aa 160000 --- a/Telegram/lib_lottie +++ b/Telegram/lib_lottie @@ -1 +1 @@ -Subproject commit 94efb93b07ca46a3f0142cf75059093f8dfe6f06 +Subproject commit b8127c8aa2d55a3e110249e63b766db5cbe82f97 diff --git a/Telegram/lib_rlottie b/Telegram/lib_rlottie index 0671bf705..3f9823f93 160000 --- a/Telegram/lib_rlottie +++ b/Telegram/lib_rlottie @@ -1 +1 @@ -Subproject commit 0671bf70547381effcf442ec9618e04502a8adbc +Subproject commit 3f9823f939eeb9524d5b15d30993589b8860a168 diff --git a/Telegram/lib_spellcheck b/Telegram/lib_spellcheck index 0269666de..01f028516 160000 --- a/Telegram/lib_spellcheck +++ b/Telegram/lib_spellcheck @@ -1 +1 @@ -Subproject commit 0269666dea57837f56f0eca965fc1f1a61bb9e27 +Subproject commit 01f028516bcb2041b6ad2aaba1bcd4d62bc32e90 diff --git a/cmake/CMakeLists.txt b/cmake/CMakeLists.txt index 6126263fa..ec3b9b5e6 100644 --- a/cmake/CMakeLists.txt +++ b/cmake/CMakeLists.txt @@ -1,19 +1,29 @@ add_subdirectory(external) -add_library(common INTERFACE) +add_library(with_ranges INTERFACE) -target_compile_features(common +if (WIN32) + target_compile_options(with_ranges + INTERFACE + /experimental:preprocessor # need for range-v3 see https://github.com/ericniebler/range-v3#supported-compilers + /wd5105 # needed for `/experimental:preprocessor`, suppressing C5105 "macro expansion producing 'defined' has undefined behavior" + ) +endif() + +add_library(common_no_ranges INTERFACE) + +target_compile_features(common_no_ranges INTERFACE cxx_std_17 ) -target_compile_definitions(common +target_compile_definitions(common_no_ranges INTERFACE UNICODE ) if (WIN32) - target_compile_definitions(common + target_compile_definitions(common_no_ranges INTERFACE WIN32 _WINDOWS @@ -25,7 +35,7 @@ if (WIN32) _USING_V110_SDK71_ NOMINMAX ) - target_compile_options(common + target_compile_options(common_no_ranges INTERFACE /permissive- # /Qspectre @@ -36,11 +46,11 @@ if (WIN32) /w14834 # [[nodiscard]] /w15038 # wrong initialization order /w14265 # class has virtual functions, but destructor is not virtual - /experimental:preprocessor # need for range-v3 see https://github.com/ericniebler/range-v3#supported-compilers + /wd4068 # Disable "warning C4068: unknown pragma" /wd5105 # needed for `/experimental:preprocessor`, suppressing C5105 "macro expansion producing 'defined' has undefined behavior" /Zc:wchar_t- # don't tread wchar_t as builtin type ) - target_link_libraries(common + target_link_libraries(common_no_ranges INTERFACE winmm imm32 @@ -72,3 +82,11 @@ if (WIN32) ) else() endif() + +add_library(common INTERFACE) + +target_link_libraries(common +INTERFACE + common_no_ranges + with_ranges +) \ No newline at end of file diff --git a/cmake/external/qt/CMakeLists.txt b/cmake/external/qt/CMakeLists.txt index edd03a6d2..bf16462a9 100644 --- a/cmake/external/qt/CMakeLists.txt +++ b/cmake/external/qt/CMakeLists.txt @@ -1,12 +1,5 @@ add_library(external_qt INTERFACE IMPORTED GLOBAL) -set(qt_version 5.12.5) - -if (WIN32) - set(qt_loc ${libs_loc}/Qt-${qt_version}) -else() -endif() - target_include_directories(external_qt SYSTEM INTERFACE ${qt_loc}/include diff --git a/cmake/external/qt/package.cmake b/cmake/external/qt/package.cmake new file mode 100644 index 000000000..8c9cfb1e3 --- /dev/null +++ b/cmake/external/qt/package.cmake @@ -0,0 +1,17 @@ +set(qt_version 5.12.5) + +if (WIN32) + set(qt_loc ${libs_loc}/Qt-${qt_version}) +else() +endif() + +set(Qt5_DIR ${qt_loc}/lib/cmake/Qt5) + +find_package(Qt5 COMPONENTS Core Gui Widgets Network REQUIRED) + +if (LINUX) + find_package(Qt5 COMPONENTS DBus) +endif() + +set_property(GLOBAL PROPERTY AUTOGEN_SOURCE_GROUP "(gen)") +set_property(GLOBAL PROPERTY AUTOGEN_TARGETS_FOLDER "(gen)") diff --git a/cmake/generate_target.cmake b/cmake/generate_target.cmake index e4e07aec7..cca0f5a5e 100644 --- a/cmake/generate_target.cmake +++ b/cmake/generate_target.cmake @@ -1,6 +1,6 @@ function(generate_target parent_name postfix generated_files gen_dst) add_custom_target(${parent_name}_${postfix} DEPENDS ${generated_files}) - init_target(${parent_name}_${postfix} "(gen)") + init_target_folder(${parent_name}_${postfix} "(gen)") add_dependencies(${parent_name} ${parent_name}_${postfix}) target_sources(${parent_name} PRIVATE ${generated_files}) target_include_directories(${parent_name} PUBLIC ${gen_dst}) diff --git a/cmake/init_target.cmake b/cmake/init_target.cmake index 539371b79..20da15d9d 100644 --- a/cmake/init_target.cmake +++ b/cmake/init_target.cmake @@ -1,9 +1,19 @@ -function(init_target target_name) # init_target(my_target folder_name) - set(folder_name "${ARGV1}") - set_property(TARGET ${target_name} PROPERTY - MSVC_RUNTIME_LIBRARY "MultiThreaded$<$:Debug>") +function(init_target_folder target_name folder_name) if (NOT "${folder_name}" STREQUAL "") set_target_properties(${target_name} PROPERTIES FOLDER ${folder_name}) endif() endfunction() +function(init_target_no_ranges target_name) # init_target(my_target folder_name) + init_target_folder(${target_name} "${ARGV1}") + set_property(TARGET ${target_name} PROPERTY + MSVC_RUNTIME_LIBRARY "MultiThreaded$<$:Debug>") + target_link_libraries(${target_name} PUBLIC common_no_ranges) +endfunction() + +function(init_target target_name) # init_target(my_target folder_name) + init_target_folder(${target_name} "${ARGV1}") + init_target_no_ranges(${target_name}) + target_link_libraries(${target_name} PUBLIC common) +endfunction() + diff --git a/cmake/nice_target_sources.cmake b/cmake/nice_target_sources.cmake index afacbfdd3..113ab0c97 100644 --- a/cmake/nice_target_sources.cmake +++ b/cmake/nice_target_sources.cmake @@ -11,10 +11,10 @@ function(nice_target_sources target_name src_loc list) set(writing_now ${file}) else() set(full_name ${src_loc}/${file}) - if (${file} MATCHES "/win/" OR ${file} MATCHES "_win\\.") + if (${file} MATCHES "/win/" OR ${file} MATCHES "_win\\." OR ${file} MATCHES "/windows/") list(APPEND not_mac_sources ${full_name}) list(APPEND not_linux_sources ${full_name}) - elseif (${file} MATCHES "/mac/" OR ${file} MATCHES "_mac\\.") + elseif (${file} MATCHES "/mac/" OR ${file} MATCHES "_mac\\." OR ${file} MATCHES "/darwin/") list(APPEND not_win_sources ${full_name}) list(APPEND not_linux_sources ${full_name}) elseif (${file} MATCHES "/linux/" OR ${file} MATCHES "_linux\\.") From 61723bd7948f569e6a0dcc6b0f13eabab8339df9 Mon Sep 17 00:00:00 2001 From: John Preston Date: Mon, 11 Nov 2019 10:56:25 +0300 Subject: [PATCH 006/255] Initial Windows Debug build with cmake. --- CMakeLists.txt | 2 +- Telegram/CMakeLists.txt | 79 ++++++++++++++----- Telegram/ThirdParty/libtgvoip | 2 +- Telegram/cmake/lib_ffmpeg.cmake | 10 +++ Telegram/cmake/lib_tgvoip.cmake | 5 ++ Telegram/lib_lottie | 2 +- Telegram/lib_rlottie | 2 +- Telegram/lib_storage | 2 +- Telegram/lib_ui | 2 +- cmake/CMakeLists.txt | 9 ++- cmake/external/CMakeLists.txt | 4 + cmake/external/auto_updates/CMakeLists.txt | 15 ++++ .../external/auto_updates/lzma/CMakeLists.txt | 16 ++++ cmake/external/crash_reports/CMakeLists.txt | 3 +- cmake/external/openal/CMakeLists.txt | 16 ++++ cmake/external/openssl/CMakeLists.txt | 11 +++ cmake/external/opus/CMakeLists.txt | 16 ++++ cmake/external/zlib/CMakeLists.txt | 24 ++++++ cmake/init_target.cmake | 6 ++ cmake/nice_target_sources.cmake | 11 ++- 20 files changed, 201 insertions(+), 36 deletions(-) create mode 100644 cmake/external/auto_updates/CMakeLists.txt create mode 100644 cmake/external/auto_updates/lzma/CMakeLists.txt create mode 100644 cmake/external/openal/CMakeLists.txt create mode 100644 cmake/external/opus/CMakeLists.txt create mode 100644 cmake/external/zlib/CMakeLists.txt diff --git a/CMakeLists.txt b/CMakeLists.txt index 55281e0e7..d9a0829d8 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,4 +1,4 @@ -cmake_minimum_required(VERSION 3.12) +cmake_minimum_required(VERSION 3.15) cmake_policy(SET CMP0076 NEW) cmake_policy(SET CMP0091 NEW) diff --git a/Telegram/CMakeLists.txt b/Telegram/CMakeLists.txt index cab088303..10dd973c5 100644 --- a/Telegram/CMakeLists.txt +++ b/Telegram/CMakeLists.txt @@ -7,6 +7,7 @@ add_subdirectory(lib_base) add_subdirectory(lib_ui) add_subdirectory(lib_tl) add_subdirectory(lib_spellcheck) +add_subdirectory(lib_storage) add_subdirectory(lib_lottie) add_subdirectory(lib_rlottie) add_subdirectory(codegen) @@ -54,17 +55,33 @@ generate_styles(Telegram ${src_loc} "${style_files}" "${dependent_style_files}") generate_lang(Telegram ${res_loc}/langs/lang.strings) generate_numbers(Telegram ${res_loc}/numbers.txt) +set_target_properties(Telegram PROPERTIES AUTOMOC ON) +set_target_properties(Telegram PROPERTIES AUTORCC ON) +set_target_properties(Telegram PROPERTIES RUNTIME_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}") + target_link_libraries(Telegram PRIVATE lib_base + lib_crl lib_ui lib_tl lib_spellcheck + lib_storage lib_lottie + lib_rlottie + lib_mtproto lib_scheme lib_export lib_ffmpeg lib_tgvoip + lib_lz4 + external_qt + external_openssl + external_crash_reports + external_auto_updates + external_zlib + external_opus + external_openal ) set(telegram_sources @@ -904,35 +921,55 @@ PRIVATE qt_static_plugins.cpp settings.cpp settings.h - -# platforms: !win -# <(minizip_loc)/crypt.h -# <(minizip_loc)/ioapi.c -# <(minizip_loc)/ioapi.h -# <(minizip_loc)/zip.c -# <(minizip_loc)/zip.h -# <(minizip_loc)/unzip.c -# <(minizip_loc)/unzip.h - -# platforms: win -# <(res_loc)/winrc/Telegram.rc - -# platforms: mac -# <(sp_media_key_tap_loc)/SPMediaKeyTap.m -# <(sp_media_key_tap_loc)/SPMediaKeyTap.h -# <(sp_media_key_tap_loc)/SPInvocationGrabbing/NSObject+SPInvocationGrabbing.m -# <(sp_media_key_tap_loc)/SPInvocationGrabbing/NSObject+SPInvocationGrabbing.h ) nice_target_sources(Telegram ${src_loc} "${telegram_sources}") +set(telegram_resources +PRIVATE + qrc/emoji_1.qrc + qrc/emoji_2.qrc + qrc/emoji_3.qrc + qrc/emoji_4.qrc + qrc/emoji_5.qrc + qrc/emoji_preview.qrc + qrc/telegram/telegram.qrc + qrc/telegram/sounds.qrc + winrc/Telegram.rc + winrc/Telegram.manifest +) +nice_target_sources(Telegram ${res_loc} "${telegram_resources}") + force_include(Telegram stdafx.h) +if (WIN32) + # message(${CMAKE_GENERATOR}) + # mt.exe -manifest "${res_loc}/winrc/Telegram.manifest" "-inputresource:\"$\";#1" "-outputresource:\"$\";#1" >NUL + # set(hash_symbol "#") + # set(release $) + # add_custom_command( + # TARGET + # Telegram + # POST_BUILD COMMAND + # $ $<${release}:-manifest> $<${release}:"${res_loc}/winrc/Telegram.manifest"> $<${release}:-inputresource:"$"$${hash_symbol}1> $<${release}:-outputresource:"$"$${hash_symbol}1> $<${release}:$NUL> + # COMMENT + # $ + # ) +else() + target_link_libraries(Telegram + PRIVATE + external_minizip + ) + if (APPLE) + target_link_libraries(Telegram + PRIVATE + external_sp_media_key_tap + ) + endif() +endif() + target_include_directories(Telegram PRIVATE ${src_loc} - ${libs_loc}/zlib - ${libs_loc}/lzma/C - ${libs_loc}/openal-soft/include ${third_party_loc}/minizip ) diff --git a/Telegram/ThirdParty/libtgvoip b/Telegram/ThirdParty/libtgvoip index 302d42fc2..782436c56 160000 --- a/Telegram/ThirdParty/libtgvoip +++ b/Telegram/ThirdParty/libtgvoip @@ -1 +1 @@ -Subproject commit 302d42fc201f9a8b973ba152e04cf804b0d9d521 +Subproject commit 782436c567ba1a6a7aa294a5a6e09965506d3395 diff --git a/Telegram/cmake/lib_ffmpeg.cmake b/Telegram/cmake/lib_ffmpeg.cmake index 0f38075bb..870a89f44 100644 --- a/Telegram/cmake/lib_ffmpeg.cmake +++ b/Telegram/cmake/lib_ffmpeg.cmake @@ -14,7 +14,17 @@ PUBLIC ${libs_loc}/ffmpeg ) +target_link_directories(lib_ffmpeg +PUBLIC + ${libs_loc}/ffmpeg +) + target_link_libraries(lib_ffmpeg PUBLIC lib_base + ${libs_loc}/ffmpeg/libavformat/libavformat.a + ${libs_loc}/ffmpeg/libavcodec/libavcodec.a + ${libs_loc}/ffmpeg/libavutil/libavutil.a + ${libs_loc}/ffmpeg/libswresample/libswresample.a + ${libs_loc}/ffmpeg/libswscale/libswscale.a ) diff --git a/Telegram/cmake/lib_tgvoip.cmake b/Telegram/cmake/lib_tgvoip.cmake index 037b56423..d5fba61fa 100644 --- a/Telegram/cmake/lib_tgvoip.cmake +++ b/Telegram/cmake/lib_tgvoip.cmake @@ -726,6 +726,11 @@ PRIVATE ${libs_loc}/opus/include ) +target_compile_options(lib_tgvoip +PRIVATE + /wd4244 # conversion from 'int' to 'float', possible loss of data (several in webrtc) +) + target_link_libraries(lib_tgvoip PRIVATE external_openssl diff --git a/Telegram/lib_lottie b/Telegram/lib_lottie index b8127c8aa..3ef08c5ae 160000 --- a/Telegram/lib_lottie +++ b/Telegram/lib_lottie @@ -1 +1 @@ -Subproject commit b8127c8aa2d55a3e110249e63b766db5cbe82f97 +Subproject commit 3ef08c5aec24e544b8fbc6372c9baf56993aa0b0 diff --git a/Telegram/lib_rlottie b/Telegram/lib_rlottie index 3f9823f93..348f27fcc 160000 --- a/Telegram/lib_rlottie +++ b/Telegram/lib_rlottie @@ -1 +1 @@ -Subproject commit 3f9823f939eeb9524d5b15d30993589b8860a168 +Subproject commit 348f27fcc64a82e0a3ae3ec4dbb302e5bd9f5bab diff --git a/Telegram/lib_storage b/Telegram/lib_storage index 6803e7411..3f375807e 160000 --- a/Telegram/lib_storage +++ b/Telegram/lib_storage @@ -1 +1 @@ -Subproject commit 6803e74111186443af5be9ed1eae190536309e33 +Subproject commit 3f375807eacd3411dfe8644df7b0dc494536d3de diff --git a/Telegram/lib_ui b/Telegram/lib_ui index d32f772e5..110a17089 160000 --- a/Telegram/lib_ui +++ b/Telegram/lib_ui @@ -1 +1 @@ -Subproject commit d32f772e5274e8490ade20e88c6bfa10b8ecfee5 +Subproject commit 110a17089a2b18e93edf77a0adf596df92e9def0 diff --git a/cmake/CMakeLists.txt b/cmake/CMakeLists.txt index ec3b9b5e6..d3e9e057e 100644 --- a/cmake/CMakeLists.txt +++ b/cmake/CMakeLists.txt @@ -29,8 +29,6 @@ if (WIN32) _WINDOWS _UNICODE UNICODE - # HAVE_STDINT_H - # ZLIB_WINAPI _SCL_SECURE_NO_WARNINGS _USING_V110_SDK71_ NOMINMAX @@ -50,6 +48,10 @@ if (WIN32) /wd5105 # needed for `/experimental:preprocessor`, suppressing C5105 "macro expansion producing 'defined' has undefined behavior" /Zc:wchar_t- # don't tread wchar_t as builtin type ) + target_link_options(common_no_ranges + INTERFACE + /NODEFAULTLIB:LIBCMT + ) target_link_libraries(common_no_ranges INTERFACE winmm @@ -79,7 +81,8 @@ if (WIN32) UxTheme DbgHelp Rstrtmgr - ) + Crypt32 + ) else() endif() diff --git a/cmake/external/CMakeLists.txt b/cmake/external/CMakeLists.txt index 6e7ea170e..e232a576c 100644 --- a/cmake/external/CMakeLists.txt +++ b/cmake/external/CMakeLists.txt @@ -4,3 +4,7 @@ add_subdirectory(variant) add_subdirectory(ranges) add_subdirectory(gsl) add_subdirectory(crash_reports) +add_subdirectory(auto_updates) +add_subdirectory(zlib) +add_subdirectory(opus) +add_subdirectory(openal) diff --git a/cmake/external/auto_updates/CMakeLists.txt b/cmake/external/auto_updates/CMakeLists.txt new file mode 100644 index 000000000..4a2ff4bca --- /dev/null +++ b/cmake/external/auto_updates/CMakeLists.txt @@ -0,0 +1,15 @@ +add_library(external_auto_updates INTERFACE IMPORTED GLOBAL) + +if (WIN32) + add_subdirectory(lzma) + target_link_libraries(external_auto_updates + INTERFACE + external_lzma + ) +else() + add_subdirectory(xz) + target_link_libraries(external_auto_updates + INTERFACE + external_xz + ) +endif() diff --git a/cmake/external/auto_updates/lzma/CMakeLists.txt b/cmake/external/auto_updates/lzma/CMakeLists.txt new file mode 100644 index 000000000..a58fbaab8 --- /dev/null +++ b/cmake/external/auto_updates/lzma/CMakeLists.txt @@ -0,0 +1,16 @@ +add_library(external_lzma INTERFACE IMPORTED GLOBAL) + +target_include_directories(external_lzma SYSTEM +INTERFACE + ${libs_loc}/lzma/C +) + +target_link_directories(external_lzma +INTERFACE + ${libs_loc}/lzma/C/Util/LzmaLib/$,Debug,Release> +) + +target_link_libraries(external_lzma +INTERFACE + LzmaLib +) diff --git a/cmake/external/crash_reports/CMakeLists.txt b/cmake/external/crash_reports/CMakeLists.txt index 76485e43c..8633b4a51 100644 --- a/cmake/external/crash_reports/CMakeLists.txt +++ b/cmake/external/crash_reports/CMakeLists.txt @@ -1,8 +1,7 @@ add_library(external_crash_reports INTERFACE IMPORTED GLOBAL) -add_subdirectory(breakpad) - if (WIN32) + add_subdirectory(breakpad) target_link_libraries(external_crash_reports INTERFACE external_breakpad diff --git a/cmake/external/openal/CMakeLists.txt b/cmake/external/openal/CMakeLists.txt new file mode 100644 index 000000000..58f0a5c87 --- /dev/null +++ b/cmake/external/openal/CMakeLists.txt @@ -0,0 +1,16 @@ +add_library(external_openal INTERFACE IMPORTED GLOBAL) + +target_include_directories(external_openal SYSTEM +INTERFACE + ${libs_loc}/openal-soft/include +) + +target_link_directories(external_openal +INTERFACE + ${libs_loc}/openal-soft/build/$,Debug,Release> +) + +target_link_libraries(external_openal +INTERFACE + OpenAL32 +) diff --git a/cmake/external/openssl/CMakeLists.txt b/cmake/external/openssl/CMakeLists.txt index 1d476d4e1..8ebdd5901 100644 --- a/cmake/external/openssl/CMakeLists.txt +++ b/cmake/external/openssl/CMakeLists.txt @@ -4,3 +4,14 @@ target_include_directories(external_openssl SYSTEM INTERFACE ${libs_loc}/openssl_1_1_1/include ) + +target_link_directories(external_openssl +INTERFACE + ${libs_loc}/openssl_1_1_1/out32$<$:.dbg> +) + +target_link_libraries(external_openssl +INTERFACE + libcrypto + libssl +) diff --git a/cmake/external/opus/CMakeLists.txt b/cmake/external/opus/CMakeLists.txt new file mode 100644 index 000000000..3aed144fe --- /dev/null +++ b/cmake/external/opus/CMakeLists.txt @@ -0,0 +1,16 @@ +add_library(external_opus INTERFACE IMPORTED GLOBAL) + +target_include_directories(external_opus SYSTEM +INTERFACE + ${libs_loc}/opus/include +) + +target_link_directories(external_opus +INTERFACE + ${libs_loc}/opus/win32/VS2015/Win32/$,Debug,Release> +) + +target_link_libraries(external_opus +INTERFACE + opus +) diff --git a/cmake/external/zlib/CMakeLists.txt b/cmake/external/zlib/CMakeLists.txt new file mode 100644 index 000000000..b29adf098 --- /dev/null +++ b/cmake/external/zlib/CMakeLists.txt @@ -0,0 +1,24 @@ +add_library(external_zlib INTERFACE IMPORTED GLOBAL) + +target_include_directories(external_zlib SYSTEM +INTERFACE + ${libs_loc}/zlib + ${libs_loc}/zlib/contrib/minizip +) + +if (WIN32) + target_compile_definitions(external_zlib + INTERFACE + ZLIB_WINAPI + ) +endif() + +target_link_directories(external_zlib +INTERFACE + ${libs_loc}/zlib/contrib/vstudio/vc14/x86/ZlibStat$,Debug,ReleaseWithoutAsm> +) + +target_link_libraries(external_zlib +INTERFACE + zlibstat +) diff --git a/cmake/init_target.cmake b/cmake/init_target.cmake index 20da15d9d..5753dee6a 100644 --- a/cmake/init_target.cmake +++ b/cmake/init_target.cmake @@ -8,6 +8,12 @@ function(init_target_no_ranges target_name) # init_target(my_target folder_name) init_target_folder(${target_name} "${ARGV1}") set_property(TARGET ${target_name} PROPERTY MSVC_RUNTIME_LIBRARY "MultiThreaded$<$:Debug>") + if (WIN32) + target_compile_options(${target_name} + INTERFACE + /W1 + ) + endif() target_link_libraries(${target_name} PUBLIC common_no_ranges) endfunction() diff --git a/cmake/nice_target_sources.cmake b/cmake/nice_target_sources.cmake index 113ab0c97..85166bc46 100644 --- a/cmake/nice_target_sources.cmake +++ b/cmake/nice_target_sources.cmake @@ -11,16 +11,16 @@ function(nice_target_sources target_name src_loc list) set(writing_now ${file}) else() set(full_name ${src_loc}/${file}) - if (${file} MATCHES "/win/" OR ${file} MATCHES "_win\\." OR ${file} MATCHES "/windows/") + if (${file} MATCHES "(^|/)win/" OR ${file} MATCHES "(^|/)winrc/" OR ${file} MATCHES "(^|/)windows/" OR ${file} MATCHES "[_\\/]win\\.") list(APPEND not_mac_sources ${full_name}) list(APPEND not_linux_sources ${full_name}) - elseif (${file} MATCHES "/mac/" OR ${file} MATCHES "_mac\\." OR ${file} MATCHES "/darwin/") + elseif (${file} MATCHES "(^|/)mac/" OR ${file} MATCHES "(^|/)darwin/" OR ${file} MATCHES "[_\\/]mac\\.") list(APPEND not_win_sources ${full_name}) list(APPEND not_linux_sources ${full_name}) - elseif (${file} MATCHES "/linux/" OR ${file} MATCHES "_linux\\.") + elseif (${file} MATCHES "(^|/)linux/" OR ${file} MATCHES "[_\\/]linux\\.") list(APPEND not_win_sources ${full_name}) list(APPEND not_mac_sources ${full_name}) - elseif (${file} MATCHES "/posix/" OR ${file} MATCHES "_posix\\.") + elseif (${file} MATCHES "(^|/)posix/" OR ${file} MATCHES "[_\\/]posix\\.") list(APPEND not_win_sources ${full_name}) endif() if ("${writing_now}" STREQUAL "PRIVATE") @@ -47,9 +47,12 @@ function(nice_target_sources target_name src_loc list) endif() if (WIN32) set_source_files_properties(${not_win_sources} PROPERTIES HEADER_FILE_ONLY TRUE) + set_source_files_properties(${not_win_sources} PROPERTIES SKIP_AUTOGEN TRUE) elseif (APPLE) set_source_files_properties(${not_mac_sources} PROPERTIES HEADER_FILE_ONLY TRUE) + set_source_files_properties(${not_mac_sources} PROPERTIES SKIP_AUTOGEN TRUE) elseif (LINUX) set_source_files_properties(${not_linux_sources} PROPERTIES HEADER_FILE_ONLY TRUE) + set_source_files_properties(${not_linux_sources} PROPERTIES SKIP_AUTOGEN TRUE) endif() endfunction() From 793862bee641e3b0eee59451897f50f1ab6e2ed2 Mon Sep 17 00:00:00 2001 From: Nicholas Guriev Date: Tue, 12 Nov 2019 18:15:34 +0300 Subject: [PATCH 007/255] Fix -Wredundant-move and -Wdeprecated-copy warnings (#6663) * Do not move result at end of function This makes GCC 9.1.2 happy with the active -Wredundant-move warning. Indeed, such moving of local variables or local arguments before returning is unnecessary and prevents the compiler from copy elision optimization. --- Telegram/SourceFiles/boxes/connection_box.cpp | 2 +- Telegram/SourceFiles/boxes/create_poll_box.cpp | 2 +- Telegram/SourceFiles/boxes/peers/edit_linked_chat_box.cpp | 2 +- .../SourceFiles/boxes/peers/edit_participants_box.cpp | 4 ++-- Telegram/SourceFiles/boxes/peers/edit_peer_info_box.cpp | 8 ++++---- Telegram/SourceFiles/boxes/peers/edit_peer_type_box.cpp | 6 +++--- Telegram/SourceFiles/calls/calls_box_controller.cpp | 3 +-- Telegram/SourceFiles/chat_helpers/emoji_list_widget.cpp | 2 +- Telegram/SourceFiles/chat_helpers/gifs_list_widget.cpp | 2 +- Telegram/SourceFiles/chat_helpers/stickers.cpp | 2 +- .../SourceFiles/chat_helpers/stickers_list_widget.cpp | 2 +- Telegram/SourceFiles/chat_helpers/tabbed_section.cpp | 2 +- .../history/admin_log/history_admin_log_section.cpp | 4 ++-- .../SourceFiles/history/feed/history_feed_section.cpp | 4 ++-- .../history/view/history_view_scheduled_section.cpp | 4 ++-- .../SourceFiles/info/channels/info_channels_widget.cpp | 4 ++-- .../info/common_groups/info_common_groups_widget.cpp | 4 ++-- .../info/feed/info_feed_profile_inner_widget.cpp | 2 +- .../SourceFiles/info/feed/info_feed_profile_widget.cpp | 4 ++-- Telegram/SourceFiles/info/info_memento.cpp | 4 ++-- Telegram/SourceFiles/info/info_wrap_widget.cpp | 2 +- Telegram/SourceFiles/info/media/info_media_buttons.h | 6 +++--- Telegram/SourceFiles/info/media/info_media_widget.cpp | 4 ++-- Telegram/SourceFiles/info/members/info_members_widget.cpp | 4 ++-- .../SourceFiles/info/profile/info_profile_actions.cpp | 8 ++++---- .../info/profile/info_profile_inner_widget.cpp | 4 ++-- Telegram/SourceFiles/info/profile/info_profile_widget.cpp | 4 ++-- .../SourceFiles/info/settings/info_settings_widget.cpp | 4 ++-- .../SourceFiles/media/streaming/media_streaming_file.cpp | 2 +- .../SourceFiles/passport/passport_panel_controller.cpp | 4 ++-- .../SourceFiles/settings/settings_privacy_controllers.cpp | 4 ++-- .../SourceFiles/settings/settings_privacy_security.cpp | 4 ++-- Telegram/SourceFiles/window/window_outdated_bar.cpp | 2 +- Telegram/lib_base | 2 +- 34 files changed, 60 insertions(+), 61 deletions(-) diff --git a/Telegram/SourceFiles/boxes/connection_box.cpp b/Telegram/SourceFiles/boxes/connection_box.cpp index a4873f019..663739f26 100644 --- a/Telegram/SourceFiles/boxes/connection_box.cpp +++ b/Telegram/SourceFiles/boxes/connection_box.cpp @@ -1148,7 +1148,7 @@ object_ptr ProxiesBoxController::create() { for (const auto &item : _list) { updateView(item); } - return std::move(result); + return result; } auto ProxiesBoxController::findById(int id) -> std::vector::iterator { diff --git a/Telegram/SourceFiles/boxes/create_poll_box.cpp b/Telegram/SourceFiles/boxes/create_poll_box.cpp index ad9a1db47..11d44d311 100644 --- a/Telegram/SourceFiles/boxes/create_poll_box.cpp +++ b/Telegram/SourceFiles/boxes/create_poll_box.cpp @@ -768,7 +768,7 @@ object_ptr CreatePollBox::setupContent() { FocusAtEnd(question); }, lifetime()); - return std::move(result); + return result; } void CreatePollBox::prepare() { diff --git a/Telegram/SourceFiles/boxes/peers/edit_linked_chat_box.cpp b/Telegram/SourceFiles/boxes/peers/edit_linked_chat_box.cpp index d490a38f4..cc55265a8 100644 --- a/Telegram/SourceFiles/boxes/peers/edit_linked_chat_box.cpp +++ b/Telegram/SourceFiles/boxes/peers/edit_linked_chat_box.cpp @@ -223,7 +223,7 @@ object_ptr SetupAbout( tr::now, Ui::Text::WithEntities); }()); - return std::move(about); + return about; } object_ptr SetupFooter( diff --git a/Telegram/SourceFiles/boxes/peers/edit_participants_box.cpp b/Telegram/SourceFiles/boxes/peers/edit_participants_box.cpp index 09a0960f6..892b5a6a6 100644 --- a/Telegram/SourceFiles/boxes/peers/edit_participants_box.cpp +++ b/Telegram/SourceFiles/boxes/peers/edit_participants_box.cpp @@ -1786,7 +1786,7 @@ std::unique_ptr ParticipantsBoxController::createRow( row->setActionLink(tr::lng_profile_kick(tr::now)); } } - return std::move(row); + return row; } auto ParticipantsBoxController::computeType( @@ -1931,7 +1931,7 @@ auto ParticipantsBoxSearchController::saveState() const result->offset = _offset; result->allLoaded = _allLoaded; result->wasLoading = (_requestId != 0); - return std::move(result); + return result; } void ParticipantsBoxSearchController::restoreState( diff --git a/Telegram/SourceFiles/boxes/peers/edit_peer_info_box.cpp b/Telegram/SourceFiles/boxes/peers/edit_peer_info_box.cpp index 918901b88..c84e6be4e 100644 --- a/Telegram/SourceFiles/boxes/peers/edit_peer_info_box.cpp +++ b/Telegram/SourceFiles/boxes/peers/edit_peer_info_box.cpp @@ -478,7 +478,7 @@ object_ptr Controller::createTitleEdit() { [=] { submitTitle(); }); _controls.title = result->entity(); - return std::move(result); + return result; } object_ptr Controller::createDescriptionEdit() { @@ -512,7 +512,7 @@ object_ptr Controller::createDescriptionEdit() { [=] { submitDescription(); }); _controls.description = result->entity(); - return std::move(result); + return result; } object_ptr Controller::createManageGroupButtons() { @@ -526,7 +526,7 @@ object_ptr Controller::createManageGroupButtons() { fillManageSection(); - return std::move(result); + return result; } object_ptr Controller::createStickersEdit() { @@ -564,7 +564,7 @@ object_ptr Controller::createStickersEdit() { Ui::show(Box(channel), Ui::LayerOption::KeepOther); }); - return std::move(result); + return result; } bool Controller::canEditInformation() const { diff --git a/Telegram/SourceFiles/boxes/peers/edit_peer_type_box.cpp b/Telegram/SourceFiles/boxes/peers/edit_peer_type_box.cpp index 7c67aba61..8dd0c2eaa 100644 --- a/Telegram/SourceFiles/boxes/peers/edit_peer_type_box.cpp +++ b/Telegram/SourceFiles/boxes/peers/edit_peer_type_box.cpp @@ -364,7 +364,7 @@ object_ptr Controller::createUsernameEdit() { const auto shown = (_controls.privacy->value() == Privacy::HasUsername); result->toggle(shown, anim::type::instant); - return std::move(result); + return result; } void Controller::privacyChanged(Privacy value) { @@ -630,7 +630,7 @@ object_ptr Controller::createInviteLinkEdit() { observeInviteLink(); - return std::move(result); + return result; } void Controller::refreshEditInviteLink() { @@ -692,7 +692,7 @@ object_ptr Controller::createInviteLinkCreate() { observeInviteLink(); - return std::move(result); + return result; } void Controller::refreshCreateInviteLink() { diff --git a/Telegram/SourceFiles/calls/calls_box_controller.cpp b/Telegram/SourceFiles/calls/calls_box_controller.cpp index 937c34a74..ab5189452 100644 --- a/Telegram/SourceFiles/calls/calls_box_controller.cpp +++ b/Telegram/SourceFiles/calls/calls_box_controller.cpp @@ -404,8 +404,7 @@ BoxController::Row *BoxController::rowForItem(not_null item) std::unique_ptr BoxController::createRow( not_null item) const { - auto row = std::make_unique(item); - return std::move(row); + return std::make_unique(item); } } // namespace Calls diff --git a/Telegram/SourceFiles/chat_helpers/emoji_list_widget.cpp b/Telegram/SourceFiles/chat_helpers/emoji_list_widget.cpp index a9b4129f0..3f597b931 100644 --- a/Telegram/SourceFiles/chat_helpers/emoji_list_widget.cpp +++ b/Telegram/SourceFiles/chat_helpers/emoji_list_widget.cpp @@ -427,7 +427,7 @@ object_ptr EmojiListWidget::createFooter() { Expects(_footer == nullptr); auto result = object_ptr