diff --git a/.appveyor/install.bat b/.appveyor/install.bat index 1e2e5e0b8c..c45fef4b84 100644 --- a/.appveyor/install.bat +++ b/.appveyor/install.bat @@ -34,6 +34,8 @@ GOTO:EOF call:logInfo "Setup GYP/Ninja and generate VS solution" cd %LIB_DIR% git clone https://chromium.googlesource.com/external/gyp + cd gyp + git checkout a478c1ab51 SET PATH=%PATH%;C:\TBuild\Libraries\gyp;C:\TBuild\Libraries\ninja; cd %SRC_DIR% git submodule init diff --git a/Telegram/SourceFiles/codegen/scheme/codegen_scheme.py b/Telegram/SourceFiles/codegen/scheme/codegen_scheme.py index 89ad9bcab4..b559c15f26 100644 --- a/Telegram/SourceFiles/codegen/scheme/codegen_scheme.py +++ b/Telegram/SourceFiles/codegen/scheme/codegen_scheme.py @@ -22,8 +22,14 @@ import glob, re, binascii, os, sys input_file = '' output_path = '' +next_output_path = False for arg in sys.argv[1:]: - if re.match(r'^-o(.+)', arg): + if next_output_path: + next_output_path = False + output_path = arg + elif arg == '-o': + next_output_path = True + elif re.match(r'^-o(.+)', arg): output_path = arg[2:] else: input_file = arg diff --git a/Telegram/gyp/codegen_rules.gypi b/Telegram/gyp/codegen_rules.gypi index bbdca962f3..b52a91bb9d 100644 --- a/Telegram/gyp/codegen_rules.gypi +++ b/Telegram/gyp/codegen_rules.gypi @@ -29,8 +29,8 @@ ], 'action': [ 'python', '<(DEPTH)/update_dependent.py', '--styles', - '-I<(res_loc)', '-I<(src_loc)', - '-o<(SHARED_INTERMEDIATE_DIR)/update_dependent_styles.timestamp', + '-I', '<(res_loc)', '-I', '<(src_loc)', + '-o', '<(SHARED_INTERMEDIATE_DIR)/update_dependent_styles.timestamp', '<@(style_files)', ], 'message': 'Updating dependent style files..', @@ -46,7 +46,7 @@ ], 'action': [ 'python', '<(DEPTH)/update_dependent.py', '--qrc', - '-o<(SHARED_INTERMEDIATE_DIR)/update_dependent_qrc.timestamp', + '-o', '<(SHARED_INTERMEDIATE_DIR)/update_dependent_qrc.timestamp', '<@(qrc_files)', ], 'message': 'Updating dependent qrc files..', @@ -63,9 +63,9 @@ ], 'action': [ '<(PRODUCT_DIR)/codegen_style<(exe_ext)', - '-I<(res_loc)', '-I<(src_loc)', - '-o<(SHARED_INTERMEDIATE_DIR)/styles', - '-w<(PRODUCT_DIR)/../..', + '-I', '<(res_loc)', '-I', '<(src_loc)', + '-o', '<(SHARED_INTERMEDIATE_DIR)/styles', + '-w', '<(PRODUCT_DIR)/../..', # GYP/Ninja bug workaround: if we specify just <(RULE_INPUT_PATH) # the <(RULE_INPUT_ROOT) variables won't be available in Ninja, @@ -89,8 +89,8 @@ ], 'action': [ '<(PRODUCT_DIR)/codegen_lang<(exe_ext)', - '-o<(SHARED_INTERMEDIATE_DIR)', '<(res_loc)/langs/lang.strings', - '-w<(PRODUCT_DIR)/../..', + '-o', '<(SHARED_INTERMEDIATE_DIR)', '<(res_loc)/langs/lang.strings', + '-w', '<(PRODUCT_DIR)/../..', ], 'message': 'codegen_lang-ing lang.strings..', 'process_outputs_as_sources': 1, @@ -106,8 +106,8 @@ ], 'action': [ '<(PRODUCT_DIR)/codegen_numbers<(exe_ext)', - '-o<(SHARED_INTERMEDIATE_DIR)', '<(res_loc)/numbers.txt', - '-w<(PRODUCT_DIR)/../..', + '-o', '<(SHARED_INTERMEDIATE_DIR)', '<(res_loc)/numbers.txt', + '-w', '<(PRODUCT_DIR)/../..', ], 'message': 'codegen_numbers-ing numbers.txt..', 'process_outputs_as_sources': 1, @@ -123,7 +123,7 @@ ], 'action': [ 'python', '<(src_loc)/codegen/scheme/codegen_scheme.py', - '-o<(SHARED_INTERMEDIATE_DIR)', '<(res_loc)/scheme.tl', + '-o', '<(SHARED_INTERMEDIATE_DIR)', '<(res_loc)/scheme.tl', ], 'message': 'codegen_scheme-ing scheme.tl..', 'process_outputs_as_sources': 1, @@ -138,7 +138,7 @@ ], 'action': [ '<(PRODUCT_DIR)/codegen_emoji<(exe_ext)', - '-o<(SHARED_INTERMEDIATE_DIR)', + '-o', '<(SHARED_INTERMEDIATE_DIR)', ], 'message': 'codegen_emoji-ing..', 'process_outputs_as_sources': 1, @@ -156,9 +156,9 @@ ], 'action': [ '<(PRODUCT_DIR)/codegen_style<(exe_ext)', - '-I<(res_loc)', '-I<(src_loc)', - '-o<(SHARED_INTERMEDIATE_DIR)/styles', - '-w<(PRODUCT_DIR)/../..', + '-I', '<(res_loc)', '-I', '<(src_loc)', + '-o', '<(SHARED_INTERMEDIATE_DIR)/styles', + '-w', '<(PRODUCT_DIR)/../..', # GYP/Ninja bug workaround: if we specify just <(RULE_INPUT_PATH) # the <(RULE_INPUT_ROOT) variables won't be available in Ninja, diff --git a/Telegram/gyp/refresh.bat b/Telegram/gyp/refresh.bat index 3049291901..78caadc883 100644 --- a/Telegram/gyp/refresh.bat +++ b/Telegram/gyp/refresh.bat @@ -19,6 +19,8 @@ if not "%TDESKTOP_BUILD_DEFINES%" == "" ( echo [INFO] Set build defines to !BUILD_DEFINES! ) +set GYP_MSVS_VERSION=2015 + cd "%FullScriptPath%" call gyp --depth=. --generator-output=../.. -Goutput_dir=out !BUILD_DEFINES! Telegram.gyp --format=ninja if %errorlevel% neq 0 goto error diff --git a/docs/building-msvc.md b/docs/building-msvc.md index 41846f3ec8..ee1d6229c8 100644 --- a/docs/building-msvc.md +++ b/docs/building-msvc.md @@ -277,8 +277,10 @@ run `git reset --hard HEAD` and execute `gclient` again git clone https://chromium.googlesource.com/external/gyp + cd gyp + git checkout a478c1ab51 SET PATH=%PATH%;D:\TBuild\Libraries\gyp;D:\TBuild\Libraries\ninja; - cd ..\tdesktop\Telegram + cd ..\..\tdesktop\Telegram Also, actually add **D:\\TBuild\\Libraries\\ninja\\** (not just for running the **gyp** command) to your path environment variable, since Telegram needs it for the build process.