From a4c98e74ce0e9ed50fcae37482f3e045e22c03d8 Mon Sep 17 00:00:00 2001 From: John Preston Date: Sat, 13 Aug 2016 20:43:21 +0300 Subject: [PATCH] GYP/Ninja Windows build: codegen done, WinXP done, Release done. MetaLang, codegen_style and codegen_numbers utilities are now built by GYP targets, rules added for codegen_style and actions added for codegen_numbers and MetaLang. WinXP supported without Windows 7.1A SDK, but with explicitly setting MinimumRequiredVersion=5.01. It works (and that is strange). If you attempt to use MSBuild instead of Ninja you should add the latest Windows SDK include paths to include_dirs, because v140_xp toolset implies the Windows 7.1A SDK (and is ignored by Ninja). --- .gitignore | 6 +- Telegram/gyp/Telegram.gyp | 1006 +++++++++++++++++--------------- Telegram/gyp/codegen.gyp | 124 ++++ Telegram/gyp/create_env.py | 57 ++ Telegram/gyp/qt.gypi | 18 +- Telegram/gyp/refresh.bat | 39 +- Telegram/gyp/settings_win.gypi | 37 +- 7 files changed, 769 insertions(+), 518 deletions(-) create mode 100644 Telegram/gyp/codegen.gyp create mode 100644 Telegram/gyp/create_env.py diff --git a/.gitignore b/.gitignore index d48712a69..22e5fc55f 100644 --- a/.gitignore +++ b/.gitignore @@ -1,6 +1,8 @@ /out/ +/Debug/ +/Release/ +/Deploy/ /Telegram/build/target -/Telegram/build/msvs/ /Telegram/GeneratedFiles/ /Telegram/SourceFiles/art/grid.png /Telegram/SourceFiles/art/grid_125x.png @@ -15,7 +17,7 @@ /Telegram/Resources/art/sprite_125x.png /Telegram/Resources/art/sprite_150x.png /Telegram/*.user -*.vcxproj.user +*.vcxproj* *.suo *.sdf *.opensdf diff --git a/Telegram/gyp/Telegram.gyp b/Telegram/gyp/Telegram.gyp index 03bdd8174..75d661587 100644 --- a/Telegram/gyp/Telegram.gyp +++ b/Telegram/gyp/Telegram.gyp @@ -18,485 +18,531 @@ # Copyright (c) 2014 John Preston, https://desktop.telegram.org { - 'targets': [ - { - 'target_name': 'Telegram', - 'variables': { - 'libs_loc': '../../../Libraries', - 'src_loc': '../SourceFiles', - 'gen_loc': '../GeneratedFiles', - 'res_loc': '../Resources', - }, - 'includes': [ - 'common_executable.gypi', - 'qt.gypi', - ], - - 'dependencies': [ -# 'codegen.gyp:codegen_style', -# 'codegen.gyp:codegen_numbers', -# 'codegen.gyp:MetaLang', -# 'utils.gyp:Packer', -# 'utils.gyp:Updater', - ], - - 'defines': [ - 'AL_LIBTYPE_STATIC', - ], - - 'include_dirs': [ - '<(src_loc)', - '<(gen_loc)', - '<(libs_loc)/breakpad/src', - '<(libs_loc)/lzma/C', - '<(libs_loc)/libexif-0.6.20', - '<(libs_loc)/zlib-1.2.8', - '<(libs_loc)/ffmpeg', - '<(libs_loc)/openal-soft/include', - '../ThirdParty/minizip', - '<(libs_loc)/openssl/Release/include', - '<(libs_loc)/openssl_debug/Debug/include', - ], - 'library_dirs': [ - '<(libs_loc)/lzma/C/Util/LzmaLib/Debug', - '<(libs_loc)/libexif-0.6.20/win32/Debug', - '<(libs_loc)/ffmpeg', - '<(libs_loc)/opus/win32/VS2010/Win32/Debug', - '<(libs_loc)/openal-soft/build/Debug', - '<(libs_loc)/zlib-1.2.8/contrib/vstudio/vc11/x86/ZlibStatDebug', - '<(libs_loc)/openssl_debug/Debug/lib', - '<(libs_loc)/breakpad/src/client/windows/Debug', - ], - 'sources': [ - '<(res_loc)/telegram.qrc', - '<(res_loc)/telegram_emojis.qrc', - '<(res_loc)/telegram_wnd.qrc', - '<(res_loc)/telegram_mac.qrc', - '<(gen_loc)/lang_auto.cpp', - '<(gen_loc)/lang_auto.h', - '<(gen_loc)/numbers.cpp', - '<(gen_loc)/numbers.h', - '<(gen_loc)/styles/style_basic.cpp', - '<(gen_loc)/styles/style_basic.h', - '<(gen_loc)/styles/style_basic_types.cpp', - '<(gen_loc)/styles/style_basic_types.h', - '<(gen_loc)/styles/style_boxes.cpp', - '<(gen_loc)/styles/style_boxes.h', - '<(gen_loc)/styles/style_dialogs.cpp', - '<(gen_loc)/styles/style_dialogs.h', - '<(gen_loc)/styles/style_history.cpp', - '<(gen_loc)/styles/style_history.h', - '<(gen_loc)/styles/style_mediaview.cpp', - '<(gen_loc)/styles/style_mediaview.h', - '<(gen_loc)/styles/style_overview.cpp', - '<(gen_loc)/styles/style_overview.h', - '<(gen_loc)/styles/style_profile.cpp', - '<(gen_loc)/styles/style_profile.h', - '<(gen_loc)/styles/style_widgets.cpp', - '<(gen_loc)/styles/style_widgets.h', - '<(src_loc)/main.cpp', - '<(src_loc)/stdafx.cpp', - '<(src_loc)/stdafx.h', - '<(src_loc)/apiwrap.cpp', - '<(src_loc)/apiwrap.h', - '<(src_loc)/app.cpp', - '<(src_loc)/app.h', - '<(src_loc)/application.cpp', - '<(src_loc)/application.h', - '<(src_loc)/autoupdater.cpp', - '<(src_loc)/autoupdater.h', - '<(src_loc)/dialogswidget.cpp', - '<(src_loc)/dialogswidget.h', - '<(src_loc)/dropdown.cpp', - '<(src_loc)/dropdown.h', - '<(src_loc)/facades.cpp', - '<(src_loc)/facades.h', - '<(src_loc)/fileuploader.cpp', - '<(src_loc)/fileuploader.h', - '<(src_loc)/history.cpp', - '<(src_loc)/history.h', - '<(src_loc)/historywidget.cpp', - '<(src_loc)/historywidget.h', - '<(src_loc)/lang.cpp', - '<(src_loc)/lang.h', - '<(src_loc)/langloaderplain.cpp', - '<(src_loc)/langloaderplain.h', - '<(src_loc)/layerwidget.cpp', - '<(src_loc)/layerwidget.h', - '<(src_loc)/layout.cpp', - '<(src_loc)/layout.h', - '<(src_loc)/mediaview.cpp', - '<(src_loc)/mediaview.h', - '<(src_loc)/observer_peer.cpp', - '<(src_loc)/observer_peer.h', - '<(src_loc)/overviewwidget.cpp', - '<(src_loc)/overviewwidget.h', - '<(src_loc)/passcodewidget.cpp', - '<(src_loc)/passcodewidget.h', - '<(src_loc)/playerwidget.cpp', - '<(src_loc)/playerwidget.h', - '<(src_loc)/localimageloader.cpp', - '<(src_loc)/localimageloader.h', - '<(src_loc)/localstorage.cpp', - '<(src_loc)/localstorage.h', - '<(src_loc)/logs.cpp', - '<(src_loc)/logs.h', - '<(src_loc)/mainwidget.cpp', - '<(src_loc)/mainwidget.h', - '<(src_loc)/settings.cpp', - '<(src_loc)/settings.h', - '<(src_loc)/settingswidget.cpp', - '<(src_loc)/settingswidget.h', - '<(src_loc)/shortcuts.cpp', - '<(src_loc)/shortcuts.h', - '<(src_loc)/structs.cpp', - '<(src_loc)/structs.h', - '<(src_loc)/sysbuttons.cpp', - '<(src_loc)/sysbuttons.h', - '<(src_loc)/title.cpp', - '<(src_loc)/title.h', - '<(src_loc)/mainwindow.cpp', - '<(src_loc)/mainwindow.h', - '<(src_loc)/boxes/aboutbox.cpp', - '<(src_loc)/boxes/aboutbox.h', - '<(src_loc)/boxes/abstractbox.cpp', - '<(src_loc)/boxes/abstractbox.h', - '<(src_loc)/boxes/addcontactbox.cpp', - '<(src_loc)/boxes/addcontactbox.h', - '<(src_loc)/boxes/autolockbox.cpp', - '<(src_loc)/boxes/autolockbox.h', - '<(src_loc)/boxes/backgroundbox.cpp', - '<(src_loc)/boxes/backgroundbox.h', - '<(src_loc)/boxes/confirmbox.cpp', - '<(src_loc)/boxes/confirmbox.h', - '<(src_loc)/boxes/confirmphonebox.cpp', - '<(src_loc)/boxes/confirmphonebox.h', - '<(src_loc)/boxes/connectionbox.cpp', - '<(src_loc)/boxes/connectionbox.h', - '<(src_loc)/boxes/contactsbox.cpp', - '<(src_loc)/boxes/contactsbox.h', - '<(src_loc)/boxes/downloadpathbox.cpp', - '<(src_loc)/boxes/downloadpathbox.h', - '<(src_loc)/boxes/emojibox.cpp', - '<(src_loc)/boxes/emojibox.h', - '<(src_loc)/boxes/languagebox.cpp', - '<(src_loc)/boxes/languagebox.h', - '<(src_loc)/boxes/passcodebox.cpp', - '<(src_loc)/boxes/passcodebox.h', - '<(src_loc)/boxes/photocropbox.cpp', - '<(src_loc)/boxes/photocropbox.h', - '<(src_loc)/boxes/photosendbox.cpp', - '<(src_loc)/boxes/photosendbox.h', - '<(src_loc)/boxes/report_box.cpp', - '<(src_loc)/boxes/report_box.h', - '<(src_loc)/boxes/sessionsbox.cpp', - '<(src_loc)/boxes/sessionsbox.h', - '<(src_loc)/boxes/stickersetbox.cpp', - '<(src_loc)/boxes/stickersetbox.h', - '<(src_loc)/boxes/usernamebox.cpp', - '<(src_loc)/boxes/usernamebox.h', - '<(src_loc)/core/basic_types.cpp', - '<(src_loc)/core/basic_types.h', - '<(src_loc)/core/click_handler.cpp', - '<(src_loc)/core/click_handler.h', - '<(src_loc)/core/click_handler_types.cpp', - '<(src_loc)/core/click_handler_types.h', - '<(src_loc)/core/observer.cpp', - '<(src_loc)/core/observer.h', - '<(src_loc)/core/qthelp_url.cpp', - '<(src_loc)/core/qthelp_url.h', - '<(src_loc)/data/data_abstract_structure.cpp', - '<(src_loc)/data/data_abstract_structure.h', - '<(src_loc)/data/data_drafts.cpp', - '<(src_loc)/data/data_drafts.h', - '<(src_loc)/dialogs/dialogs_indexed_list.cpp', - '<(src_loc)/dialogs/dialogs_indexed_list.h', - '<(src_loc)/dialogs/dialogs_layout.cpp', - '<(src_loc)/dialogs/dialogs_layout.h', - '<(src_loc)/dialogs/dialogs_list.cpp', - '<(src_loc)/dialogs/dialogs_list.h', - '<(src_loc)/dialogs/dialogs_row.cpp', - '<(src_loc)/dialogs/dialogs_row.h', - '<(src_loc)/history/field_autocomplete.cpp', - '<(src_loc)/history/field_autocomplete.h', - '<(src_loc)/history/history_service_layout.cpp', - '<(src_loc)/history/history_service_layout.h', - '<(src_loc)/inline_bots/inline_bot_layout_internal.cpp', - '<(src_loc)/inline_bots/inline_bot_layout_internal.h', - '<(src_loc)/inline_bots/inline_bot_layout_item.cpp', - '<(src_loc)/inline_bots/inline_bot_layout_item.h', - '<(src_loc)/inline_bots/inline_bot_result.cpp', - '<(src_loc)/inline_bots/inline_bot_result.h', - '<(src_loc)/inline_bots/inline_bot_send_data.cpp', - '<(src_loc)/inline_bots/inline_bot_send_data.h', - '<(src_loc)/intro/introwidget.cpp', - '<(src_loc)/intro/introwidget.h', - '<(src_loc)/intro/introcode.cpp', - '<(src_loc)/intro/introcode.h', - '<(src_loc)/intro/introphone.cpp', - '<(src_loc)/intro/introphone.h', - '<(src_loc)/intro/intropwdcheck.cpp', - '<(src_loc)/intro/intropwdcheck.h', - '<(src_loc)/intro/introsignup.cpp', - '<(src_loc)/intro/introsignup.h', - '<(src_loc)/intro/introstart.cpp', - '<(src_loc)/intro/introstart.h', - '<(src_loc)/media/view/media_clip_controller.cpp', - '<(src_loc)/media/view/media_clip_controller.h', - '<(src_loc)/media/view/media_clip_playback.cpp', - '<(src_loc)/media/view/media_clip_playback.h', - '<(src_loc)/media/view/media_clip_volume_controller.cpp', - '<(src_loc)/media/view/media_clip_volume_controller.h', - '<(src_loc)/media/media_audio.cpp', - '<(src_loc)/media/media_audio.h', - '<(src_loc)/media/media_audio_ffmpeg_loader.cpp', - '<(src_loc)/media/media_audio_ffmpeg_loader.h', - '<(src_loc)/media/media_audio_loader.cpp', - '<(src_loc)/media/media_audio_loader.h', - '<(src_loc)/media/media_audio_loaders.cpp', - '<(src_loc)/media/media_audio_loaders.h', - '<(src_loc)/media/media_child_ffmpeg_loader.cpp', - '<(src_loc)/media/media_child_ffmpeg_loader.h', - '<(src_loc)/media/media_clip_ffmpeg.cpp', - '<(src_loc)/media/media_clip_ffmpeg.h', - '<(src_loc)/media/media_clip_implementation.cpp', - '<(src_loc)/media/media_clip_implementation.h', - '<(src_loc)/media/media_clip_qtgif.cpp', - '<(src_loc)/media/media_clip_qtgif.h', - '<(src_loc)/media/media_clip_reader.cpp', - '<(src_loc)/media/media_clip_reader.h', - '<(src_loc)/mtproto/facade.cpp', - '<(src_loc)/mtproto/facade.h', - '<(src_loc)/mtproto/auth_key.cpp', - '<(src_loc)/mtproto/auth_key.h', - '<(src_loc)/mtproto/connection.cpp', - '<(src_loc)/mtproto/connection.h', - '<(src_loc)/mtproto/connection_abstract.cpp', - '<(src_loc)/mtproto/connection_abstract.h', - '<(src_loc)/mtproto/connection_auto.cpp', - '<(src_loc)/mtproto/connection_auto.h', - '<(src_loc)/mtproto/connection_http.cpp', - '<(src_loc)/mtproto/connection_http.h', - '<(src_loc)/mtproto/connection_tcp.cpp', - '<(src_loc)/mtproto/connection_tcp.h', - '<(src_loc)/mtproto/core_types.cpp', - '<(src_loc)/mtproto/core_types.h', - '<(src_loc)/mtproto/dcenter.cpp', - '<(src_loc)/mtproto/dcenter.h', - '<(src_loc)/mtproto/file_download.cpp', - '<(src_loc)/mtproto/file_download.h', - '<(src_loc)/mtproto/rsa_public_key.cpp', - '<(src_loc)/mtproto/rsa_public_key.h', - '<(src_loc)/mtproto/rpc_sender.cpp', - '<(src_loc)/mtproto/rpc_sender.h', - '<(src_loc)/mtproto/scheme_auto.cpp', - '<(src_loc)/mtproto/scheme_auto.h', - '<(src_loc)/mtproto/session.cpp', - '<(src_loc)/mtproto/session.h', - '<(src_loc)/overview/overview_layout.cpp', - '<(src_loc)/overview/overview_layout.h', - '<(src_loc)/pspecific_win.cpp', - '<(src_loc)/pspecific_win.h', - '<(src_loc)/platform/linux/linux_gdk_helper.cpp', - '<(src_loc)/platform/linux/linux_gdk_helper.h', - '<(src_loc)/platform/linux/linux_libs.cpp', - '<(src_loc)/platform/linux/linux_libs.h', - '<(src_loc)/platform/linux/file_dialog_linux.cpp', - '<(src_loc)/platform/linux/file_dialog_linux.h', - '<(src_loc)/platform/linux/main_window_linux.cpp', - '<(src_loc)/platform/linux/main_window_linux.h', - '<(src_loc)/platform/win/main_window_win.cpp', - '<(src_loc)/platform/win/main_window_win.h', - '<(src_loc)/platform/win/windows_app_user_model_id.cpp', - '<(src_loc)/platform/win/windows_app_user_model_id.h', - '<(src_loc)/platform/win/windows_dlls.cpp', - '<(src_loc)/platform/win/windows_dlls.h', - '<(src_loc)/platform/win/windows_event_filter.cpp', - '<(src_loc)/platform/win/windows_event_filter.h', - '<(src_loc)/platform/win/windows_toasts.cpp', - '<(src_loc)/platform/win/windows_toasts.h', - '<(src_loc)/profile/profile_actions_widget.cpp', - '<(src_loc)/profile/profile_actions_widget.h', - '<(src_loc)/profile/profile_block_widget.cpp', - '<(src_loc)/profile/profile_block_widget.h', - '<(src_loc)/profile/profile_cover_drop_area.cpp', - '<(src_loc)/profile/profile_cover_drop_area.h', - '<(src_loc)/profile/profile_cover.cpp', - '<(src_loc)/profile/profile_cover.h', - '<(src_loc)/profile/profile_fixed_bar.cpp', - '<(src_loc)/profile/profile_fixed_bar.h', - '<(src_loc)/profile/profile_info_widget.cpp', - '<(src_loc)/profile/profile_info_widget.h', - '<(src_loc)/profile/profile_inner_widget.cpp', - '<(src_loc)/profile/profile_inner_widget.h', - '<(src_loc)/profile/profile_invite_link_widget.cpp', - '<(src_loc)/profile/profile_invite_link_widget.h', - '<(src_loc)/profile/profile_members_widget.cpp', - '<(src_loc)/profile/profile_members_widget.h', - '<(src_loc)/profile/profile_section_memento.cpp', - '<(src_loc)/profile/profile_section_memento.h', - '<(src_loc)/profile/profile_settings_widget.cpp', - '<(src_loc)/profile/profile_settings_widget.h', - '<(src_loc)/profile/profile_shared_media_widget.cpp', - '<(src_loc)/profile/profile_shared_media_widget.h', - '<(src_loc)/profile/profile_userpic_button.cpp', - '<(src_loc)/profile/profile_userpic_button.h', - '<(src_loc)/profile/profile_widget.cpp', - '<(src_loc)/profile/profile_widget.h', - '<(src_loc)/serialize/serialize_common.cpp', - '<(src_loc)/serialize/serialize_common.h', - '<(src_loc)/serialize/serialize_document.cpp', - '<(src_loc)/serialize/serialize_document.h', - '<(src_loc)/ui/buttons/history_down_button.cpp', - '<(src_loc)/ui/buttons/history_down_button.h', - '<(src_loc)/ui/buttons/icon_button.cpp', - '<(src_loc)/ui/buttons/icon_button.h', - '<(src_loc)/ui/buttons/left_outline_button.cpp', - '<(src_loc)/ui/buttons/left_outline_button.h', - '<(src_loc)/ui/buttons/peer_avatar_button.cpp', - '<(src_loc)/ui/buttons/peer_avatar_button.h', - '<(src_loc)/ui/buttons/round_button.cpp', - '<(src_loc)/ui/buttons/round_button.h', - '<(src_loc)/ui/effects/fade_animation.cpp', - '<(src_loc)/ui/effects/fade_animation.h', - '<(src_loc)/ui/style/style_core.cpp', - '<(src_loc)/ui/style/style_core.h', - '<(src_loc)/ui/style/style_core_color.cpp', - '<(src_loc)/ui/style/style_core_color.h', - '<(src_loc)/ui/style/style_core_font.cpp', - '<(src_loc)/ui/style/style_core_font.h', - '<(src_loc)/ui/style/style_core_icon.cpp', - '<(src_loc)/ui/style/style_core_icon.h', - '<(src_loc)/ui/style/style_core_types.cpp', - '<(src_loc)/ui/style/style_core_types.h', - '<(src_loc)/ui/text/text.cpp', - '<(src_loc)/ui/text/text.h', - '<(src_loc)/ui/text/text_block.cpp', - '<(src_loc)/ui/text/text_block.h', - '<(src_loc)/ui/text/text_entity.cpp', - '<(src_loc)/ui/text/text_entity.h', - '<(src_loc)/ui/toast/toast.cpp', - '<(src_loc)/ui/toast/toast.h', - '<(src_loc)/ui/toast/toast_manager.cpp', - '<(src_loc)/ui/toast/toast_manager.h', - '<(src_loc)/ui/toast/toast_widget.cpp', - '<(src_loc)/ui/toast/toast_widget.h', - '<(src_loc)/ui/widgets/label_simple.cpp', - '<(src_loc)/ui/widgets/label_simple.h', - '<(src_loc)/ui/animation.cpp', - '<(src_loc)/ui/animation.h', - '<(src_loc)/ui/boxshadow.cpp', - '<(src_loc)/ui/boxshadow.h', - '<(src_loc)/ui/button.cpp', - '<(src_loc)/ui/button.h', - '<(src_loc)/ui/popupmenu.cpp', - '<(src_loc)/ui/popupmenu.h', - '<(src_loc)/ui/countryinput.cpp', - '<(src_loc)/ui/countryinput.h', - '<(src_loc)/ui/emoji_config.cpp', - '<(src_loc)/ui/emoji_config.h', - '<(src_loc)/ui/filedialog.cpp', - '<(src_loc)/ui/filedialog.h', - '<(src_loc)/ui/flatbutton.cpp', - '<(src_loc)/ui/flatbutton.h', - '<(src_loc)/ui/flatcheckbox.cpp', - '<(src_loc)/ui/flatcheckbox.h', - '<(src_loc)/ui/flatinput.cpp', - '<(src_loc)/ui/flatinput.h', - '<(src_loc)/ui/flatlabel.cpp', - '<(src_loc)/ui/flatlabel.h', - '<(src_loc)/ui/flattextarea.cpp', - '<(src_loc)/ui/flattextarea.h', - '<(src_loc)/ui/images.cpp', - '<(src_loc)/ui/images.h', - '<(src_loc)/ui/inner_dropdown.cpp', - '<(src_loc)/ui/inner_dropdown.h', - '<(src_loc)/ui/scrollarea.cpp', - '<(src_loc)/ui/scrollarea.h', - '<(src_loc)/ui/twidget.cpp', - '<(src_loc)/ui/twidget.h', - '<(src_loc)/window/main_window.cpp', - '<(src_loc)/window/main_window.h', - '<(src_loc)/window/section_widget.cpp', - '<(src_loc)/window/section_widget.h', - '<(src_loc)/window/slide_animation.cpp', - '<(src_loc)/window/slide_animation.h', - '<(src_loc)/window/top_bar_widget.cpp', - '<(src_loc)/window/top_bar_widget.h', - ], - 'libraries': [ - 'libeay32', - 'ssleay32', - 'Crypt32', - 'zlibstat', - 'LzmaLib', - 'lib_exif', - 'UxTheme', - 'DbgHelp', - 'OpenAL32', - 'common', - 'libavformat\libavformat.a', - 'libavcodec\libavcodec.a', - 'libavutil\libavutil.a', - 'libswresample\libswresample.a', - 'libswscale\libswscale.a', - 'opus', - 'celt', - 'silk_common', - 'silk_float', - 'lib\common', - 'lib\exception_handler', - 'lib\crash_generation_client', - ], - 'conditions': [ - [ '"<(build_linux)" != "1"', { - 'sources!': [ - '<(src_loc)/platform/linux/linux_gdk_helper.cpp', - '<(src_loc)/platform/linux/linux_gdk_helper.h', - '<(src_loc)/platform/linux/linux_libs.cpp', - '<(src_loc)/platform/linux/linux_libs.h', - '<(src_loc)/platform/linux/file_dialog_linux.cpp', - '<(src_loc)/platform/linux/file_dialog_linux.h', - '<(src_loc)/platform/linux/main_window_linux.cpp', - '<(src_loc)/platform/linux/main_window_linux.h', - ], - }], - [ '"<(build_mac)" != "1"', { - 'sources!': [ - '<(res_loc)/telegram_mac.qrc', - ], - }], - [ '"<(build_win)" != "1"', { - 'sources!': [ - '<(src_loc)/platform/win/main_window_win.cpp', - '<(src_loc)/platform/win/main_window_win.h', - '<(src_loc)/platform/win/windows_app_user_model_id.cpp', - '<(src_loc)/platform/win/windows_app_user_model_id.h', - '<(src_loc)/platform/win/windows_dlls.cpp', - '<(src_loc)/platform/win/windows_dlls.h', - '<(src_loc)/platform/win/windows_event_filter.cpp', - '<(src_loc)/platform/win/windows_event_filter.h', - '<(src_loc)/platform/win/windows_toasts.cpp', - '<(src_loc)/platform/win/windows_toasts.h', - '<(res_loc)/telegram_wnd.qrc', - ], - }], - [ 'build_win', { - 'msvs_precompiled_source': '<(src_loc)/stdafx.cpp', - 'msvs_precompiled_header': '<(src_loc)/stdafx.h', - 'msbuild_toolset': 'v140_xp', #Windows7.1SDK',# - 'msvs_settings': { - 'VCLinkerTool': { - 'IgnoreDefaultLibraryNames': 'LIBCMT', - }, - 'VCResourceCompilerTool': { - }, - }, - 'sources': [ - '<(res_loc)/winrc/Telegram.rc', - ], - }], - ], + 'targets': [{ + 'target_name': 'Telegram', + 'variables': { + 'libs_loc': '../../../Libraries', + 'src_loc': '../SourceFiles', + 'res_loc': '../Resources', }, - ], + 'includes': [ + 'common_executable.gypi', + 'qt.gypi', + ], + + 'dependencies': [ + 'codegen.gyp:codegen_style', + 'codegen.gyp:codegen_numbers', + 'codegen.gyp:MetaLang', +# 'utils.gyp:Packer', +# 'utils.gyp:Updater', + ], + + 'defines': [ + 'AL_LIBTYPE_STATIC', + ], + + 'include_dirs': [ + '<(src_loc)', + '<(SHARED_INTERMEDIATE_DIR)', + '<(libs_loc)/breakpad/src', + '<(libs_loc)/lzma/C', + '<(libs_loc)/libexif-0.6.20', + '<(libs_loc)/zlib-1.2.8', + '<(libs_loc)/ffmpeg', + '<(libs_loc)/openal-soft/include', + '../ThirdParty/minizip', + '<(libs_loc)/openssl/Release/include', + '<(libs_loc)/openssl_debug/Debug/include', + ], + 'library_dirs': [ + '<(libs_loc)/ffmpeg', + ], + 'sources': [ + '<(res_loc)/telegram.qrc', + '<(res_loc)/telegram_emojis.qrc', + '<(res_loc)/telegram_wnd.qrc', + '<(res_loc)/telegram_mac.qrc', + '<(res_loc)/basic.style', + '<(res_loc)/basic_types.style', + '<(src_loc)/boxes/boxes.style', + '<(src_loc)/dialogs/dialogs.style', + '<(src_loc)/history/history.style', + '<(src_loc)/media/view/mediaview.style', + '<(src_loc)/overview/overview.style', + '<(src_loc)/profile/profile.style', + '<(src_loc)/ui/widgets/widgets.style', + '<(src_loc)/main.cpp', + '<(src_loc)/stdafx.cpp', + '<(src_loc)/stdafx.h', + '<(src_loc)/apiwrap.cpp', + '<(src_loc)/apiwrap.h', + '<(src_loc)/app.cpp', + '<(src_loc)/app.h', + '<(src_loc)/application.cpp', + '<(src_loc)/application.h', + '<(src_loc)/autoupdater.cpp', + '<(src_loc)/autoupdater.h', + '<(src_loc)/dialogswidget.cpp', + '<(src_loc)/dialogswidget.h', + '<(src_loc)/dropdown.cpp', + '<(src_loc)/dropdown.h', + '<(src_loc)/facades.cpp', + '<(src_loc)/facades.h', + '<(src_loc)/fileuploader.cpp', + '<(src_loc)/fileuploader.h', + '<(src_loc)/history.cpp', + '<(src_loc)/history.h', + '<(src_loc)/historywidget.cpp', + '<(src_loc)/historywidget.h', + '<(src_loc)/lang.cpp', + '<(src_loc)/lang.h', + '<(src_loc)/langloaderplain.cpp', + '<(src_loc)/langloaderplain.h', + '<(src_loc)/layerwidget.cpp', + '<(src_loc)/layerwidget.h', + '<(src_loc)/layout.cpp', + '<(src_loc)/layout.h', + '<(src_loc)/mediaview.cpp', + '<(src_loc)/mediaview.h', + '<(src_loc)/observer_peer.cpp', + '<(src_loc)/observer_peer.h', + '<(src_loc)/overviewwidget.cpp', + '<(src_loc)/overviewwidget.h', + '<(src_loc)/passcodewidget.cpp', + '<(src_loc)/passcodewidget.h', + '<(src_loc)/playerwidget.cpp', + '<(src_loc)/playerwidget.h', + '<(src_loc)/localimageloader.cpp', + '<(src_loc)/localimageloader.h', + '<(src_loc)/localstorage.cpp', + '<(src_loc)/localstorage.h', + '<(src_loc)/logs.cpp', + '<(src_loc)/logs.h', + '<(src_loc)/mainwidget.cpp', + '<(src_loc)/mainwidget.h', + '<(src_loc)/settings.cpp', + '<(src_loc)/settings.h', + '<(src_loc)/settingswidget.cpp', + '<(src_loc)/settingswidget.h', + '<(src_loc)/shortcuts.cpp', + '<(src_loc)/shortcuts.h', + '<(src_loc)/structs.cpp', + '<(src_loc)/structs.h', + '<(src_loc)/sysbuttons.cpp', + '<(src_loc)/sysbuttons.h', + '<(src_loc)/title.cpp', + '<(src_loc)/title.h', + '<(src_loc)/mainwindow.cpp', + '<(src_loc)/mainwindow.h', + '<(src_loc)/boxes/aboutbox.cpp', + '<(src_loc)/boxes/aboutbox.h', + '<(src_loc)/boxes/abstractbox.cpp', + '<(src_loc)/boxes/abstractbox.h', + '<(src_loc)/boxes/addcontactbox.cpp', + '<(src_loc)/boxes/addcontactbox.h', + '<(src_loc)/boxes/autolockbox.cpp', + '<(src_loc)/boxes/autolockbox.h', + '<(src_loc)/boxes/backgroundbox.cpp', + '<(src_loc)/boxes/backgroundbox.h', + '<(src_loc)/boxes/confirmbox.cpp', + '<(src_loc)/boxes/confirmbox.h', + '<(src_loc)/boxes/confirmphonebox.cpp', + '<(src_loc)/boxes/confirmphonebox.h', + '<(src_loc)/boxes/connectionbox.cpp', + '<(src_loc)/boxes/connectionbox.h', + '<(src_loc)/boxes/contactsbox.cpp', + '<(src_loc)/boxes/contactsbox.h', + '<(src_loc)/boxes/downloadpathbox.cpp', + '<(src_loc)/boxes/downloadpathbox.h', + '<(src_loc)/boxes/emojibox.cpp', + '<(src_loc)/boxes/emojibox.h', + '<(src_loc)/boxes/languagebox.cpp', + '<(src_loc)/boxes/languagebox.h', + '<(src_loc)/boxes/passcodebox.cpp', + '<(src_loc)/boxes/passcodebox.h', + '<(src_loc)/boxes/photocropbox.cpp', + '<(src_loc)/boxes/photocropbox.h', + '<(src_loc)/boxes/photosendbox.cpp', + '<(src_loc)/boxes/photosendbox.h', + '<(src_loc)/boxes/report_box.cpp', + '<(src_loc)/boxes/report_box.h', + '<(src_loc)/boxes/sessionsbox.cpp', + '<(src_loc)/boxes/sessionsbox.h', + '<(src_loc)/boxes/stickersetbox.cpp', + '<(src_loc)/boxes/stickersetbox.h', + '<(src_loc)/boxes/usernamebox.cpp', + '<(src_loc)/boxes/usernamebox.h', + '<(src_loc)/core/basic_types.cpp', + '<(src_loc)/core/basic_types.h', + '<(src_loc)/core/click_handler.cpp', + '<(src_loc)/core/click_handler.h', + '<(src_loc)/core/click_handler_types.cpp', + '<(src_loc)/core/click_handler_types.h', + '<(src_loc)/core/observer.cpp', + '<(src_loc)/core/observer.h', + '<(src_loc)/core/qthelp_url.cpp', + '<(src_loc)/core/qthelp_url.h', + '<(src_loc)/data/data_abstract_structure.cpp', + '<(src_loc)/data/data_abstract_structure.h', + '<(src_loc)/data/data_drafts.cpp', + '<(src_loc)/data/data_drafts.h', + '<(src_loc)/dialogs/dialogs_indexed_list.cpp', + '<(src_loc)/dialogs/dialogs_indexed_list.h', + '<(src_loc)/dialogs/dialogs_layout.cpp', + '<(src_loc)/dialogs/dialogs_layout.h', + '<(src_loc)/dialogs/dialogs_list.cpp', + '<(src_loc)/dialogs/dialogs_list.h', + '<(src_loc)/dialogs/dialogs_row.cpp', + '<(src_loc)/dialogs/dialogs_row.h', + '<(src_loc)/history/field_autocomplete.cpp', + '<(src_loc)/history/field_autocomplete.h', + '<(src_loc)/history/history_service_layout.cpp', + '<(src_loc)/history/history_service_layout.h', + '<(src_loc)/inline_bots/inline_bot_layout_internal.cpp', + '<(src_loc)/inline_bots/inline_bot_layout_internal.h', + '<(src_loc)/inline_bots/inline_bot_layout_item.cpp', + '<(src_loc)/inline_bots/inline_bot_layout_item.h', + '<(src_loc)/inline_bots/inline_bot_result.cpp', + '<(src_loc)/inline_bots/inline_bot_result.h', + '<(src_loc)/inline_bots/inline_bot_send_data.cpp', + '<(src_loc)/inline_bots/inline_bot_send_data.h', + '<(src_loc)/intro/introwidget.cpp', + '<(src_loc)/intro/introwidget.h', + '<(src_loc)/intro/introcode.cpp', + '<(src_loc)/intro/introcode.h', + '<(src_loc)/intro/introphone.cpp', + '<(src_loc)/intro/introphone.h', + '<(src_loc)/intro/intropwdcheck.cpp', + '<(src_loc)/intro/intropwdcheck.h', + '<(src_loc)/intro/introsignup.cpp', + '<(src_loc)/intro/introsignup.h', + '<(src_loc)/intro/introstart.cpp', + '<(src_loc)/intro/introstart.h', + '<(src_loc)/media/view/media_clip_controller.cpp', + '<(src_loc)/media/view/media_clip_controller.h', + '<(src_loc)/media/view/media_clip_playback.cpp', + '<(src_loc)/media/view/media_clip_playback.h', + '<(src_loc)/media/view/media_clip_volume_controller.cpp', + '<(src_loc)/media/view/media_clip_volume_controller.h', + '<(src_loc)/media/media_audio.cpp', + '<(src_loc)/media/media_audio.h', + '<(src_loc)/media/media_audio_ffmpeg_loader.cpp', + '<(src_loc)/media/media_audio_ffmpeg_loader.h', + '<(src_loc)/media/media_audio_loader.cpp', + '<(src_loc)/media/media_audio_loader.h', + '<(src_loc)/media/media_audio_loaders.cpp', + '<(src_loc)/media/media_audio_loaders.h', + '<(src_loc)/media/media_child_ffmpeg_loader.cpp', + '<(src_loc)/media/media_child_ffmpeg_loader.h', + '<(src_loc)/media/media_clip_ffmpeg.cpp', + '<(src_loc)/media/media_clip_ffmpeg.h', + '<(src_loc)/media/media_clip_implementation.cpp', + '<(src_loc)/media/media_clip_implementation.h', + '<(src_loc)/media/media_clip_qtgif.cpp', + '<(src_loc)/media/media_clip_qtgif.h', + '<(src_loc)/media/media_clip_reader.cpp', + '<(src_loc)/media/media_clip_reader.h', + '<(src_loc)/mtproto/facade.cpp', + '<(src_loc)/mtproto/facade.h', + '<(src_loc)/mtproto/auth_key.cpp', + '<(src_loc)/mtproto/auth_key.h', + '<(src_loc)/mtproto/connection.cpp', + '<(src_loc)/mtproto/connection.h', + '<(src_loc)/mtproto/connection_abstract.cpp', + '<(src_loc)/mtproto/connection_abstract.h', + '<(src_loc)/mtproto/connection_auto.cpp', + '<(src_loc)/mtproto/connection_auto.h', + '<(src_loc)/mtproto/connection_http.cpp', + '<(src_loc)/mtproto/connection_http.h', + '<(src_loc)/mtproto/connection_tcp.cpp', + '<(src_loc)/mtproto/connection_tcp.h', + '<(src_loc)/mtproto/core_types.cpp', + '<(src_loc)/mtproto/core_types.h', + '<(src_loc)/mtproto/dcenter.cpp', + '<(src_loc)/mtproto/dcenter.h', + '<(src_loc)/mtproto/file_download.cpp', + '<(src_loc)/mtproto/file_download.h', + '<(src_loc)/mtproto/rsa_public_key.cpp', + '<(src_loc)/mtproto/rsa_public_key.h', + '<(src_loc)/mtproto/rpc_sender.cpp', + '<(src_loc)/mtproto/rpc_sender.h', + '<(src_loc)/mtproto/scheme_auto.cpp', + '<(src_loc)/mtproto/scheme_auto.h', + '<(src_loc)/mtproto/session.cpp', + '<(src_loc)/mtproto/session.h', + '<(src_loc)/overview/overview_layout.cpp', + '<(src_loc)/overview/overview_layout.h', + '<(src_loc)/pspecific_win.cpp', + '<(src_loc)/pspecific_win.h', + '<(src_loc)/platform/linux/linux_gdk_helper.cpp', + '<(src_loc)/platform/linux/linux_gdk_helper.h', + '<(src_loc)/platform/linux/linux_libs.cpp', + '<(src_loc)/platform/linux/linux_libs.h', + '<(src_loc)/platform/linux/file_dialog_linux.cpp', + '<(src_loc)/platform/linux/file_dialog_linux.h', + '<(src_loc)/platform/linux/main_window_linux.cpp', + '<(src_loc)/platform/linux/main_window_linux.h', + '<(src_loc)/platform/win/main_window_win.cpp', + '<(src_loc)/platform/win/main_window_win.h', + '<(src_loc)/platform/win/windows_app_user_model_id.cpp', + '<(src_loc)/platform/win/windows_app_user_model_id.h', + '<(src_loc)/platform/win/windows_dlls.cpp', + '<(src_loc)/platform/win/windows_dlls.h', + '<(src_loc)/platform/win/windows_event_filter.cpp', + '<(src_loc)/platform/win/windows_event_filter.h', + '<(src_loc)/platform/win/windows_toasts.cpp', + '<(src_loc)/platform/win/windows_toasts.h', + '<(src_loc)/profile/profile_actions_widget.cpp', + '<(src_loc)/profile/profile_actions_widget.h', + '<(src_loc)/profile/profile_block_widget.cpp', + '<(src_loc)/profile/profile_block_widget.h', + '<(src_loc)/profile/profile_cover_drop_area.cpp', + '<(src_loc)/profile/profile_cover_drop_area.h', + '<(src_loc)/profile/profile_cover.cpp', + '<(src_loc)/profile/profile_cover.h', + '<(src_loc)/profile/profile_fixed_bar.cpp', + '<(src_loc)/profile/profile_fixed_bar.h', + '<(src_loc)/profile/profile_info_widget.cpp', + '<(src_loc)/profile/profile_info_widget.h', + '<(src_loc)/profile/profile_inner_widget.cpp', + '<(src_loc)/profile/profile_inner_widget.h', + '<(src_loc)/profile/profile_invite_link_widget.cpp', + '<(src_loc)/profile/profile_invite_link_widget.h', + '<(src_loc)/profile/profile_members_widget.cpp', + '<(src_loc)/profile/profile_members_widget.h', + '<(src_loc)/profile/profile_section_memento.cpp', + '<(src_loc)/profile/profile_section_memento.h', + '<(src_loc)/profile/profile_settings_widget.cpp', + '<(src_loc)/profile/profile_settings_widget.h', + '<(src_loc)/profile/profile_shared_media_widget.cpp', + '<(src_loc)/profile/profile_shared_media_widget.h', + '<(src_loc)/profile/profile_userpic_button.cpp', + '<(src_loc)/profile/profile_userpic_button.h', + '<(src_loc)/profile/profile_widget.cpp', + '<(src_loc)/profile/profile_widget.h', + '<(src_loc)/serialize/serialize_common.cpp', + '<(src_loc)/serialize/serialize_common.h', + '<(src_loc)/serialize/serialize_document.cpp', + '<(src_loc)/serialize/serialize_document.h', + '<(src_loc)/ui/buttons/history_down_button.cpp', + '<(src_loc)/ui/buttons/history_down_button.h', + '<(src_loc)/ui/buttons/icon_button.cpp', + '<(src_loc)/ui/buttons/icon_button.h', + '<(src_loc)/ui/buttons/left_outline_button.cpp', + '<(src_loc)/ui/buttons/left_outline_button.h', + '<(src_loc)/ui/buttons/peer_avatar_button.cpp', + '<(src_loc)/ui/buttons/peer_avatar_button.h', + '<(src_loc)/ui/buttons/round_button.cpp', + '<(src_loc)/ui/buttons/round_button.h', + '<(src_loc)/ui/effects/fade_animation.cpp', + '<(src_loc)/ui/effects/fade_animation.h', + '<(src_loc)/ui/style/style_core.cpp', + '<(src_loc)/ui/style/style_core.h', + '<(src_loc)/ui/style/style_core_color.cpp', + '<(src_loc)/ui/style/style_core_color.h', + '<(src_loc)/ui/style/style_core_font.cpp', + '<(src_loc)/ui/style/style_core_font.h', + '<(src_loc)/ui/style/style_core_icon.cpp', + '<(src_loc)/ui/style/style_core_icon.h', + '<(src_loc)/ui/style/style_core_types.cpp', + '<(src_loc)/ui/style/style_core_types.h', + '<(src_loc)/ui/text/text.cpp', + '<(src_loc)/ui/text/text.h', + '<(src_loc)/ui/text/text_block.cpp', + '<(src_loc)/ui/text/text_block.h', + '<(src_loc)/ui/text/text_entity.cpp', + '<(src_loc)/ui/text/text_entity.h', + '<(src_loc)/ui/toast/toast.cpp', + '<(src_loc)/ui/toast/toast.h', + '<(src_loc)/ui/toast/toast_manager.cpp', + '<(src_loc)/ui/toast/toast_manager.h', + '<(src_loc)/ui/toast/toast_widget.cpp', + '<(src_loc)/ui/toast/toast_widget.h', + '<(src_loc)/ui/widgets/label_simple.cpp', + '<(src_loc)/ui/widgets/label_simple.h', + '<(src_loc)/ui/animation.cpp', + '<(src_loc)/ui/animation.h', + '<(src_loc)/ui/boxshadow.cpp', + '<(src_loc)/ui/boxshadow.h', + '<(src_loc)/ui/button.cpp', + '<(src_loc)/ui/button.h', + '<(src_loc)/ui/popupmenu.cpp', + '<(src_loc)/ui/popupmenu.h', + '<(src_loc)/ui/countryinput.cpp', + '<(src_loc)/ui/countryinput.h', + '<(src_loc)/ui/emoji_config.cpp', + '<(src_loc)/ui/emoji_config.h', + '<(src_loc)/ui/filedialog.cpp', + '<(src_loc)/ui/filedialog.h', + '<(src_loc)/ui/flatbutton.cpp', + '<(src_loc)/ui/flatbutton.h', + '<(src_loc)/ui/flatcheckbox.cpp', + '<(src_loc)/ui/flatcheckbox.h', + '<(src_loc)/ui/flatinput.cpp', + '<(src_loc)/ui/flatinput.h', + '<(src_loc)/ui/flatlabel.cpp', + '<(src_loc)/ui/flatlabel.h', + '<(src_loc)/ui/flattextarea.cpp', + '<(src_loc)/ui/flattextarea.h', + '<(src_loc)/ui/images.cpp', + '<(src_loc)/ui/images.h', + '<(src_loc)/ui/inner_dropdown.cpp', + '<(src_loc)/ui/inner_dropdown.h', + '<(src_loc)/ui/scrollarea.cpp', + '<(src_loc)/ui/scrollarea.h', + '<(src_loc)/ui/twidget.cpp', + '<(src_loc)/ui/twidget.h', + '<(src_loc)/window/main_window.cpp', + '<(src_loc)/window/main_window.h', + '<(src_loc)/window/section_widget.cpp', + '<(src_loc)/window/section_widget.h', + '<(src_loc)/window/slide_animation.cpp', + '<(src_loc)/window/slide_animation.h', + '<(src_loc)/window/top_bar_widget.cpp', + '<(src_loc)/window/top_bar_widget.h', + ], + 'configurations': { + 'Debug': { + 'library_dirs': [ + '<(libs_loc)/lzma/C/Util/LzmaLib/Debug', + '<(libs_loc)/libexif-0.6.20/win32/Debug', + '<(libs_loc)/opus/win32/VS2010/Win32/Debug', + '<(libs_loc)/openal-soft/build/Debug', + '<(libs_loc)/zlib-1.2.8/contrib/vstudio/vc11/x86/ZlibStatDebug', + '<(libs_loc)/openssl_debug/Debug/lib', + '<(libs_loc)/breakpad/src/client/windows/Debug', + ], + }, + 'Release': { + 'library_dirs': [ + '<(libs_loc)/lzma/C/Util/LzmaLib/Release', + '<(libs_loc)/libexif-0.6.20/win32/Release', + '<(libs_loc)/opus/win32/VS2010/Win32/Release', + '<(libs_loc)/openal-soft/build/Release', + '<(libs_loc)/zlib-1.2.8/contrib/vstudio/vc11/x86/ZlibStatRelease', + '<(libs_loc)/openssl/Release/lib', + '<(libs_loc)/breakpad/src/client/windows/Release', + ], + }, + }, + 'libraries': [ + 'libeay32', + 'ssleay32', + 'Crypt32', + 'zlibstat', + 'LzmaLib', + 'lib_exif', + 'UxTheme', + 'DbgHelp', + 'OpenAL32', + 'common', + 'libavformat\libavformat.a', + 'libavcodec\libavcodec.a', + 'libavutil\libavutil.a', + 'libswresample\libswresample.a', + 'libswscale\libswscale.a', + 'opus', + 'celt', + 'silk_common', + 'silk_float', + 'lib\common', + 'lib\exception_handler', + 'lib\crash_generation_client', + ], + 'actions': [{ + 'action_name': 'codegen_lang', + 'inputs': [ + '<(PRODUCT_DIR)/MetaLang.exe', + '<(res_loc)/langs/lang.strings', + ], + 'outputs': [ + '<(SHARED_INTERMEDIATE_DIR)/lang_auto.cpp', + '<(SHARED_INTERMEDIATE_DIR)/lang_auto.h', + ], + 'action': [ + '<(PRODUCT_DIR)/MetaLang.exe', + '-lang_in', '<(res_loc)/langs/lang.strings', + '-lang_out', '<(SHARED_INTERMEDIATE_DIR)/lang_auto', + ], + 'message': 'codegen_lang-ing lang.strings..', + 'process_outputs_as_sources': 1, + }, { + 'action_name': 'codegen_numbers', + 'inputs': [ + '<(PRODUCT_DIR)/codegen_numbers.exe', + '<(res_loc)/numbers.txt', + ], + 'outputs': [ + '<(SHARED_INTERMEDIATE_DIR)/numbers.cpp', + '<(SHARED_INTERMEDIATE_DIR)/numbers.h', + ], + 'action': [ + '<(PRODUCT_DIR)/codegen_numbers.exe', + '-o<(SHARED_INTERMEDIATE_DIR)', '<(res_loc)/numbers.txt', + ], + 'message': 'codegen_numbers-ing numbers.txt..', + 'process_outputs_as_sources': 1, + }], + 'rules': [{ + 'rule_name': 'gen_style', + 'extension': 'style', + 'inputs': [ + '<(PRODUCT_DIR)/codegen_style.exe', + ], + 'outputs': [ + '<(SHARED_INTERMEDIATE_DIR)/styles/style_<(RULE_INPUT_ROOT).h', + '<(SHARED_INTERMEDIATE_DIR)/styles/style_<(RULE_INPUT_ROOT).cpp', + ], + 'action': [ + '<(PRODUCT_DIR)/codegen_style.exe', + '-I<(res_loc)', '-I<(src_loc)', + '-o<(SHARED_INTERMEDIATE_DIR)/styles', '<(RULE_INPUT_PATH)', + ], + 'message': 'codegen_style-ing <(RULE_INPUT_ROOT).style..', + 'process_outputs_as_sources': 1, + }], + 'conditions': [ + [ '"<(build_linux)" != "1"', { + 'sources!': [ + '<(src_loc)/platform/linux/linux_gdk_helper.cpp', + '<(src_loc)/platform/linux/linux_gdk_helper.h', + '<(src_loc)/platform/linux/linux_libs.cpp', + '<(src_loc)/platform/linux/linux_libs.h', + '<(src_loc)/platform/linux/file_dialog_linux.cpp', + '<(src_loc)/platform/linux/file_dialog_linux.h', + '<(src_loc)/platform/linux/main_window_linux.cpp', + '<(src_loc)/platform/linux/main_window_linux.h', + ], + }], + [ '"<(build_mac)" != "1"', { + 'sources!': [ + '<(res_loc)/telegram_mac.qrc', + ], + }], + [ '"<(build_win)" != "1"', { + 'sources!': [ + '<(src_loc)/platform/win/main_window_win.cpp', + '<(src_loc)/platform/win/main_window_win.h', + '<(src_loc)/platform/win/windows_app_user_model_id.cpp', + '<(src_loc)/platform/win/windows_app_user_model_id.h', + '<(src_loc)/platform/win/windows_dlls.cpp', + '<(src_loc)/platform/win/windows_dlls.h', + '<(src_loc)/platform/win/windows_event_filter.cpp', + '<(src_loc)/platform/win/windows_event_filter.h', + '<(src_loc)/platform/win/windows_toasts.cpp', + '<(src_loc)/platform/win/windows_toasts.h', + '<(res_loc)/telegram_wnd.qrc', + ], + }], + [ 'build_win', { + 'msvs_precompiled_source': '<(src_loc)/stdafx.cpp', + 'msvs_precompiled_header': '<(src_loc)/stdafx.h', + 'msbuild_toolset': 'v140_xp', #Windows7.1SDK + 'sources': [ + '<(res_loc)/winrc/Telegram.rc', + ], + }], + ], + }], } diff --git a/Telegram/gyp/codegen.gyp b/Telegram/gyp/codegen.gyp new file mode 100644 index 000000000..ecdd46014 --- /dev/null +++ b/Telegram/gyp/codegen.gyp @@ -0,0 +1,124 @@ +# This file is part of Telegram Desktop, +# the official desktop version of Telegram messaging app, see https://telegram.org +# +# Telegram Desktop is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. +# +# It is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# In addition, as a special exception, the copyright holders give permission +# to link the code of portions of this program with the OpenSSL library. +# +# Full license: https://github.com/telegramdesktop/tdesktop/blob/master/LICENSE +# Copyright (c) 2014 John Preston, https://desktop.telegram.org + +{ + 'targets': [{ + 'target_name': 'MetaLang', + 'variables': { + 'libs_loc': '../../../Libraries', + 'src_loc': '../SourceFiles', + 'gen_loc': '../GeneratedFiles', + }, + 'includes': [ + 'common_executable.gypi', + 'qt.gypi', + ], + + 'include_dirs': [ + '<(src_loc)', + '<(gen_loc)', + ], + 'sources': [ + '<(src_loc)/_other/mlmain.cpp', + '<(src_loc)/_other/mlmain.h', + '<(src_loc)/_other/genlang.cpp', + '<(src_loc)/_other/genlang.h', + ], + }, { + 'target_name': 'codegen_style', + 'variables': { + 'libs_loc': '../../../Libraries', + 'src_loc': '../SourceFiles', + }, + 'includes': [ + 'common_executable.gypi', + 'qt.gypi', + ], + + 'include_dirs': [ + '<(src_loc)', + ], + 'sources': [ + '<(src_loc)/codegen/common/basic_tokenized_file.cpp', + '<(src_loc)/codegen/common/basic_tokenized_file.h', + '<(src_loc)/codegen/common/checked_utf8_string.cpp', + '<(src_loc)/codegen/common/checked_utf8_string.h', + '<(src_loc)/codegen/common/clean_file.cpp', + '<(src_loc)/codegen/common/clean_file.h', + '<(src_loc)/codegen/common/clean_file_reader.h', + '<(src_loc)/codegen/common/const_utf8_string.h', + '<(src_loc)/codegen/common/cpp_file.cpp', + '<(src_loc)/codegen/common/cpp_file.h', + '<(src_loc)/codegen/common/logging.cpp', + '<(src_loc)/codegen/common/logging.h', + '<(src_loc)/codegen/style/generator.cpp', + '<(src_loc)/codegen/style/generator.h', + '<(src_loc)/codegen/style/main.cpp', + '<(src_loc)/codegen/style/module.cpp', + '<(src_loc)/codegen/style/module.h', + '<(src_loc)/codegen/style/options.cpp', + '<(src_loc)/codegen/style/options.h', + '<(src_loc)/codegen/style/parsed_file.cpp', + '<(src_loc)/codegen/style/parsed_file.h', + '<(src_loc)/codegen/style/processor.cpp', + '<(src_loc)/codegen/style/processor.h', + '<(src_loc)/codegen/style/sprite_generator.cpp', + '<(src_loc)/codegen/style/sprite_generator.h', + '<(src_loc)/codegen/style/structure_types.cpp', + '<(src_loc)/codegen/style/structure_types.h', + ], + }, { + 'target_name': 'codegen_numbers', + 'variables': { + 'libs_loc': '../../../Libraries', + 'src_loc': '../SourceFiles', + }, + 'includes': [ + 'common_executable.gypi', + 'qt.gypi', + ], + + 'include_dirs': [ + '<(src_loc)', + ], + 'sources': [ + '<(src_loc)/codegen/common/basic_tokenized_file.cpp', + '<(src_loc)/codegen/common/basic_tokenized_file.h', + '<(src_loc)/codegen/common/checked_utf8_string.cpp', + '<(src_loc)/codegen/common/checked_utf8_string.h', + '<(src_loc)/codegen/common/clean_file.cpp', + '<(src_loc)/codegen/common/clean_file.h', + '<(src_loc)/codegen/common/clean_file_reader.h', + '<(src_loc)/codegen/common/const_utf8_string.h', + '<(src_loc)/codegen/common/cpp_file.cpp', + '<(src_loc)/codegen/common/cpp_file.h', + '<(src_loc)/codegen/common/logging.cpp', + '<(src_loc)/codegen/common/logging.h', + '<(src_loc)/codegen/numbers/generator.cpp', + '<(src_loc)/codegen/numbers/generator.h', + '<(src_loc)/codegen/numbers/main.cpp', + '<(src_loc)/codegen/numbers/options.cpp', + '<(src_loc)/codegen/numbers/options.h', + '<(src_loc)/codegen/numbers/parsed_file.cpp', + '<(src_loc)/codegen/numbers/parsed_file.h', + '<(src_loc)/codegen/numbers/processor.cpp', + '<(src_loc)/codegen/numbers/processor.h', + ], + }], +} diff --git a/Telegram/gyp/create_env.py b/Telegram/gyp/create_env.py new file mode 100644 index 000000000..e20836792 --- /dev/null +++ b/Telegram/gyp/create_env.py @@ -0,0 +1,57 @@ +''' +This file is part of Telegram Desktop, +the official desktop version of Telegram messaging app, see https://telegram.org + +Telegram Desktop is free software: you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation, either version 3 of the License, or +(at your option) any later version. + +It is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +In addition, as a special exception, the copyright holders give permission +to link the code of portions of this program with the OpenSSL library. + +Full license: https://github.com/telegramdesktop/tdesktop/blob/master/LICENSE +Copyright (c) 2014 John Preston, https://desktop.telegram.org +''' +import glob +import re +import os + +# Generate custom environment.x86 for ninja +# We use msbuild.log to extract some variables +variables = [ + 'TMP', + 'SYSTEMROOT', + 'TEMP', + 'LIB', + 'LIBPATH', + 'PATH', + 'PATHEXT', + 'INCLUDE', +] +var_values = {} +for var_name in variables: + var_values[var_name] = os.environ[var_name] + +next_contains_var = 0 +with open('msbuild.log') as f: + for line in f: + if (re.match(r'^\s*Task "SetEnv"\s*$', line)): + next_contains_var = 1 + elif next_contains_var: + cleanline = re.sub(r'^\s*|\s*$', '', line) + name_value_pair = re.match(r'^([A-Z]+)=(.+)$', cleanline) + if name_value_pair: + var_values[name_value_pair.group(1)] = name_value_pair.group(2) + next_contains_var = 0 + +out = open('environment.x86', 'wb') +for var_name in variables: + out.write(var_name + '=' + var_values[var_name] + '\0') +out.write('\0') +out.close() diff --git a/Telegram/gyp/qt.gypi b/Telegram/gyp/qt.gypi index 40b46eb45..4ad8b7555 100644 --- a/Telegram/gyp/qt.gypi +++ b/Telegram/gyp/qt.gypi @@ -118,34 +118,34 @@ 'rules': [{ 'rule_name': 'qt_moc', 'extension': 'h', - 'inputs': [ - ], 'outputs': [ - '<(gen_loc)/moc/moc_<(RULE_INPUT_ROOT).cpp', + '<(SHARED_INTERMEDIATE_DIR)/<(_target_name)/moc/moc_<(RULE_INPUT_ROOT).cpp', ], 'action': [ '<(qt_loc)/bin/moc.exe', + + # Silence "Note: No relevant classes found. No output generated." + '--no-notes', + 'nul" +if "%1" == "-v" set "Silence=" +cd "%FullScriptPath%" +call gyp --depth=. --generator-output=../.. -Goutput_dir=out Telegram.gyp --format=ninja +if %errorlevel% neq 0 goto error +call gyp --depth=. --generator-output=../.. -Goutput_dir=out Telegram.gyp --format=msvs-ninja +if %errorlevel% neq 0 goto error +cd ../.. + +rem looks like ninja build works without sdk 7.1 which was used by generating custom environment.arch files + +rem cd "%FullScriptPath%" +rem call gyp --depth=. --generator-output=../.. -Goutput_dir=out -Gninja_use_custom_environment_files=1 Telegram.gyp --format=ninja +rem if %errorlevel% neq 0 goto error +rem call gyp --depth=. --generator-output=../.. -Goutput_dir=out -Gninja_use_custom_environment_files=1 Telegram.gyp --format=msvs-ninja +rem if %errorlevel% neq 0 goto error +rem cd ../.. + +rem call msbuild /target:SetBuildDefaultEnvironmentVariables Telegram.vcxproj /fileLogger %Silence% +rem if %errorlevel% neq 0 goto error + +rem call python "%FullScriptPath%create_env.py" +rem if %errorlevel% neq 0 goto error + +rem call move environment.x86 out\Debug\ %Silence% +rem if %errorlevel% neq 0 goto error + +cd "%FullExecPath%" exit /b + +:error +echo FAILED +if exist "%FullScriptPath%..\..\msbuild.log" del "%FullScriptPath%..\..\msbuild.log" +if exist "%FullScriptPath%..\..\environment.x86" del "%FullScriptPath%..\..\environment.x86" +cd "%FullExecPath%" +exit /b 1 diff --git a/Telegram/gyp/settings_win.gypi b/Telegram/gyp/settings_win.gypi index 02c877f91..873ff21a9 100644 --- a/Telegram/gyp/settings_win.gypi +++ b/Telegram/gyp/settings_win.gypi @@ -37,12 +37,15 @@ 'HAVE_STDINT_H', 'ZLIB_WINAPI', '_SCL_SECURE_NO_WARNINGS', + '_USING_V110_SDK71_', ], 'TreatWChar_tAsBuiltInType': 'false', }, 'VCLinkerTool': { 'SubSystem': '<(win_subsystem)', + 'MinimumRequiredVersion': '5.01', 'ImageHasSafeExceptionHandlers': 'false', # Disable /SAFESEH + 'ImportLibrary': '<(PRODUCT_DIR)/<(_target_name).lib', }, }, 'libraries': [ @@ -61,8 +64,6 @@ 'uuid', 'odbc32', 'odbccp32', -# 'glu32', -# 'opengl32', 'Shlwapi', 'Iphlpapi', 'Gdiplus', @@ -74,40 +75,30 @@ 'msvs_settings': { 'VCCLCompilerTool': { 'Optimization': '0', # Disabled (/Od) - 'PreprocessorDefinitions': [ - ], 'RuntimeLibrary': '1', # Multi-threaded Debug (/MTd) }, 'VCLinkerTool': { 'GenerateDebugInformation': 'true', # true (/DEBUG) + 'IgnoreDefaultLibraryNames': 'LIBCMT', 'LinkIncremental': '2', # Yes (/INCREMENTAL) - 'AdditionalDependencies': [ - 'msvcrtd.lib', - ], - 'AdditionalOptions': [ - '/NODEFAULTLIB:LIBCMTD' - ], }, }, }, 'Release': { 'msvs_settings': { 'VCCLCompilerTool': { - 'Optimization': '2', # Maximize Speed (/O2) - 'PreprocessorDefinitions': [ - ], - 'FavorSizeOrSpeed': '1', # Favor fast code (/Ot) - 'RuntimeLibrary': '0', # Multi-threaded (/MT) - 'EnableEnhancedInstructionSet': '2',# Streaming SIMD Extensions 2 (/arch:SSE2) + 'Optimization': '2', # Maximize Speed (/O2) + 'InlineFunctionExpansion': '2', # Any suitable (/Ob2) + 'EnableIntrinsicFunctions': 'true', # Yes (/Oi) + 'FavorSizeOrSpeed': '1', # Favor fast code (/Ot) + 'RuntimeLibrary': '0', # Multi-threaded (/MT) + 'EnableEnhancedInstructionSet': '2', # Streaming SIMD Extensions 2 (/arch:SSE2) + 'WholeProgramOptimization': 'true', # /GL }, 'VCLinkerTool': { - 'GenerateDebugInformation': 'true', # /DEBUG - 'AdditionalDependencies': [ - 'msvcrt.lib', - ], - 'AdditionalOptions': [ - '/NODEFAULTLIB:LIBCMT' - ], + 'GenerateDebugInformation': 'true', # /DEBUG + 'OptimizeReferences': '2', + 'LinkTimeCodeGeneration': '1', # /LTCG }, }, },