mirror of
https://github.com/telegramdesktop/tdesktop
synced 2025-01-03 21:32:16 +00:00
GYP build for Linux done: GYP -> CMake -> make. Testing.
This commit is contained in:
parent
58933df54b
commit
b5640fdb0a
@ -1,5 +1,33 @@
|
||||
diff --git a/pylib/gyp/generator/cmake.py b/pylib/gyp/generator/cmake.py
|
||||
index a2b9629..68d7020 100644
|
||||
--- a/pylib/gyp/generator/cmake.py
|
||||
+++ b/pylib/gyp/generator/cmake.py
|
||||
@@ -1070,6 +1070,23 @@ def WriteTarget(namer, qualified_target, target_dicts, build_dir, config_to_use,
|
||||
|
||||
output.write(')\n')
|
||||
|
||||
+ # Precompile header
|
||||
+ precompiled_header = config.get('cmake_precompiled_header', '')
|
||||
+ if precompiled_header:
|
||||
+ precompiled_header_script = config.get('cmake_precompiled_header_script', '')
|
||||
+ if not precompiled_header_script:
|
||||
+ print ('ERROR: cmake_precompiled_header requires cmake_precompiled_header_script')
|
||||
+ cmake_precompiled_header = NormjoinPath(path_from_cmakelists_to_gyp, precompiled_header)
|
||||
+ cmake_precompiled_header_script = NormjoinPathForceCMakeSource(path_from_cmakelists_to_gyp, precompiled_header_script)
|
||||
+ output.write('include(')
|
||||
+ output.write(cmake_precompiled_header_script)
|
||||
+ output.write(')\n')
|
||||
+ output.write('add_precompiled_header(')
|
||||
+ output.write(cmake_target_name)
|
||||
+ output.write(' ')
|
||||
+ output.write(cmake_precompiled_header)
|
||||
+ output.write(')\n')
|
||||
+
|
||||
UnsetVariable(output, 'TOOLSET')
|
||||
UnsetVariable(output, 'TARGET')
|
||||
|
||||
diff --git a/pylib/gyp/generator/xcode.py b/pylib/gyp/generator/xcode.py
|
||||
index 0e3fb93..0679660 100644
|
||||
index db99d6a..f8398cc 100644
|
||||
--- a/pylib/gyp/generator/xcode.py
|
||||
+++ b/pylib/gyp/generator/xcode.py
|
||||
@@ -72,6 +72,10 @@ generator_additional_non_configuration_keys = [
|
||||
@ -13,7 +41,7 @@ index 0e3fb93..0679660 100644
|
||||
'mac_bundle',
|
||||
'mac_bundle_resources',
|
||||
'mac_framework_headers',
|
||||
@@ -761,6 +765,26 @@ def GenerateOutput(target_list, target_dicts, data, params):
|
||||
@@ -772,6 +776,26 @@ def GenerateOutput(target_list, target_dicts, data, params):
|
||||
xcode_targets[qualified_target] = xct
|
||||
xcode_target_to_target_dict[xct] = spec
|
||||
|
||||
|
@ -155,9 +155,9 @@ void QGtkDialog::show(Qt::WindowFlags flags, Qt::WindowModality modality, QWindo
|
||||
|
||||
Libs::gtk_widget_realize(gtkWidget); // creates X window
|
||||
|
||||
if (parent) {
|
||||
Platform::internal::XSetTransientForHint(Libs::gtk_widget_get_window(gtkWidget), parent->winId());
|
||||
}
|
||||
if (parent) {
|
||||
Platform::internal::XSetTransientForHint(Libs::gtk_widget_get_window(gtkWidget), parent->winId());
|
||||
}
|
||||
|
||||
if (modality != Qt::NonModal) {
|
||||
Libs::gdk_window_set_modal_hint(Libs::gtk_widget_get_window(gtkWidget), true);
|
||||
|
@ -25,15 +25,19 @@ Copyright (c) 2014-2016 John Preston, https://desktop.telegram.org
|
||||
//Q_IMPORT_PLUGIN(QWinRTIntegrationPlugin)
|
||||
//Q_IMPORT_PLUGIN(QWbmpPlugin)
|
||||
#elif defined Q_OS_WIN // Q_OS_WINRT
|
||||
Q_IMPORT_PLUGIN(QWebpPlugin)
|
||||
Q_IMPORT_PLUGIN(QWindowsIntegrationPlugin)
|
||||
Q_IMPORT_PLUGIN(QWebpPlugin)
|
||||
#elif defined Q_OS_MAC // Q_OS_WIN
|
||||
Q_IMPORT_PLUGIN(QGenericEnginePlugin)
|
||||
Q_IMPORT_PLUGIN(QCocoaIntegrationPlugin)
|
||||
Q_IMPORT_PLUGIN(QWebpPlugin)
|
||||
Q_IMPORT_PLUGIN(QCocoaIntegrationPlugin)
|
||||
Q_IMPORT_PLUGIN(QGenericEnginePlugin)
|
||||
#elif defined Q_OS_LINUX // Q_OS_LINUX
|
||||
Q_IMPORT_PLUGIN(QWebpPlugin)
|
||||
Q_IMPORT_PLUGIN(QXcbIntegrationPlugin)
|
||||
Q_IMPORT_PLUGIN(QConnmanEnginePlugin)
|
||||
Q_IMPORT_PLUGIN(QGenericEnginePlugin)
|
||||
Q_IMPORT_PLUGIN(QNetworkManagerEnginePlugin)
|
||||
Q_IMPORT_PLUGIN(QComposePlatformInputContextPlugin)
|
||||
Q_IMPORT_PLUGIN(QIbusPlatformInputContextPlugin)
|
||||
Q_IMPORT_PLUGIN(QFcitxPlatformInputContextPlugin)
|
||||
Q_IMPORT_PLUGIN(QWebpPlugin)
|
||||
#endif
|
||||
|
@ -3,8 +3,6 @@ FullExecPath=$PWD
|
||||
pushd `dirname $0` > /dev/null
|
||||
FullScriptPath=`pwd`
|
||||
popd > /dev/null
|
||||
QMakePath="/usr/local/tdesktop/Qt-5.6.0/bin/qmake"
|
||||
QMakeArgs="INCLUDEPATH+=/usr/local/include INCLUDEPATH+=/usr/local/include/opus"
|
||||
|
||||
if [ ! -d "$FullScriptPath/../../../TelegramPrivate" ]; then
|
||||
echo ""
|
||||
@ -54,15 +52,13 @@ if [ "$BuildTarget" == "linux" ]; then
|
||||
echo "Building version $AppVersionStrFull for Linux 64bit.."
|
||||
UpdateFile="tlinuxupd$AppVersion"
|
||||
SetupFile="tsetup.$AppVersionStrFull.tar.xz"
|
||||
WorkPath="$HomePath/../Linux"
|
||||
ReleasePath="$WorkPath/Release"
|
||||
ReleasePath="$HomePath/../out/Release"
|
||||
BinaryName="Telegram"
|
||||
elif [ "$BuildTarget" == "linux32" ]; then
|
||||
echo "Building version $AppVersionStrFull for Linux 32bit.."
|
||||
UpdateFile="tlinux32upd$AppVersion"
|
||||
SetupFile="tsetup32.$AppVersionStrFull.tar.xz"
|
||||
WorkPath="$HomePath/../Linux"
|
||||
ReleasePath="$WorkPath/Release"
|
||||
ReleasePath="$HomePath/../out/Release"
|
||||
BinaryName="Telegram"
|
||||
elif [ "$BuildTarget" == "mac" ]; then
|
||||
echo "Building version $AppVersionStrFull for OS X 10.8+.."
|
||||
@ -127,20 +123,9 @@ if [ "$BuildTarget" == "linux" ] || [ "$BuildTarget" == "linux32" ]; then
|
||||
Error "Dropbox path not found!"
|
||||
fi
|
||||
|
||||
mkdir -p "$WorkPath/ReleaseIntermediateUpdater"
|
||||
cd "$WorkPath/ReleaseIntermediateUpdater"
|
||||
"$QMakePath" "$HomePath/Updater.pro" -r -spec linux-g++
|
||||
make
|
||||
echo "Updater build complete!"
|
||||
|
||||
mkdir -p "$WorkPath/ReleaseIntermediate"
|
||||
cd "$WorkPath/ReleaseIntermediate"
|
||||
"$QMakePath" $QMakeArgs "$HomePath/Telegram.pro" -r -spec linux-g++
|
||||
|
||||
eval "$HomePath/build/makefile_static.sh"
|
||||
./../codegen/Debug/codegen_style "-I./../../Telegram/Resources" "-I./../../Telegram/SourceFiles" "-o./GeneratedFiles/styles" all_files.style --rebuild
|
||||
./../codegen/Debug/codegen_numbers "-o./GeneratedFiles" "./../../Telegram/Resources/numbers.txt"
|
||||
./../DebugLang/MetaLang -lang_in ./../../Telegram/Resources/langs/lang.strings -lang_out ./GeneratedFiles/lang_auto
|
||||
gyp/refresh.sh
|
||||
|
||||
cd $ReleasePath
|
||||
make -j4
|
||||
echo "$BinaryName build complete!"
|
||||
|
||||
|
157
Telegram/gyp/PrecompiledHeader.cmake
Normal file
157
Telegram/gyp/PrecompiledHeader.cmake
Normal file
@ -0,0 +1,157 @@
|
||||
##
|
||||
## Modified for Telegram Desktop project by Telegram Desktop authors.
|
||||
##
|
||||
# Function for setting up precompiled headers. Usage:
|
||||
#
|
||||
# add_library/executable(target
|
||||
# pchheader.c pchheader.cpp pchheader.h)
|
||||
#
|
||||
# add_precompiled_header(target pchheader.h
|
||||
# [FORCEINCLUDE]
|
||||
# [SOURCE_C pchheader.c]
|
||||
# [SOURCE_CXX pchheader.cpp])
|
||||
#
|
||||
# Options:
|
||||
#
|
||||
# FORCEINCLUDE: Add compiler flags to automatically include the
|
||||
# pchheader.h from every source file. Works with both GCC and
|
||||
# MSVC. This is recommended.
|
||||
#
|
||||
# SOURCE_C/CXX: Specifies the .c/.cpp source file that includes
|
||||
# pchheader.h for generating the pre-compiled header
|
||||
# output. Defaults to pchheader.c. Only required for MSVC.
|
||||
#
|
||||
# Caveats:
|
||||
#
|
||||
# * Its not currently possible to use the same precompiled-header in
|
||||
# more than a single target in the same directory (No way to set
|
||||
# the source file properties differently for each target).
|
||||
#
|
||||
# * MSVC: A source file with the same name as the header must exist
|
||||
# and be included in the target (E.g. header.cpp). Name of file
|
||||
# can be changed using the SOURCE_CXX/SOURCE_C options.
|
||||
#
|
||||
# License:
|
||||
#
|
||||
# Copyright (C) 2009-2013 Lars Christensen <larsch@belunktum.dk>
|
||||
#
|
||||
# Permission is hereby granted, free of charge, to any person
|
||||
# obtaining a copy of this software and associated documentation files
|
||||
# (the 'Software') deal in the Software without restriction,
|
||||
# including without limitation the rights to use, copy, modify, merge,
|
||||
# publish, distribute, sublicense, and/or sell copies of the Software,
|
||||
# and to permit persons to whom the Software is furnished to do so,
|
||||
# subject to the following conditions:
|
||||
#
|
||||
# The above copyright notice and this permission notice shall be
|
||||
# included in all copies or substantial portions of the Software.
|
||||
#
|
||||
# THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND,
|
||||
# EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
||||
# MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
||||
# NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS
|
||||
# BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
|
||||
# ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
|
||||
# CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
# SOFTWARE.
|
||||
|
||||
include(CMakeParseArguments)
|
||||
|
||||
macro(combine_arguments _variable)
|
||||
set(_result "")
|
||||
foreach(_element ${${_variable}})
|
||||
set(_result "${_result} \"${_element}\"")
|
||||
endforeach()
|
||||
string(STRIP "${_result}" _result)
|
||||
set(${_variable} "${_result}")
|
||||
endmacro()
|
||||
|
||||
function(export_all_flags _filename _source_name_for_flags)
|
||||
set(_include_directories "$<TARGET_PROPERTY:${_target},INCLUDE_DIRECTORIES>")
|
||||
set(_compile_definitions "$<TARGET_PROPERTY:${_target},COMPILE_DEFINITIONS>")
|
||||
get_source_file_property(_compile_flags "${_source_name_for_flags}" COMPILE_FLAGS)
|
||||
set(_compile_options "$<TARGET_PROPERTY:${_target},COMPILE_OPTIONS>")
|
||||
set(_include_directories "$<$<BOOL:${_include_directories}>:-I$<JOIN:${_include_directories},\n-I>\n>")
|
||||
set(_compile_definitions "$<$<BOOL:${_compile_definitions}>:-D$<JOIN:${_compile_definitions},\n-D>\n>")
|
||||
set(_compile_flags "$<$<BOOL:${_compile_flags}>:$<JOIN:${_compile_flags},\n>\n>")
|
||||
set(_compile_options "$<$<BOOL:${_compile_options}>:$<JOIN:${_compile_options},\n>\n>")
|
||||
file(GENERATE OUTPUT "${_filename}" CONTENT "${_source_name_for_flags}\n${_compile_definitions}${_include_directories}${_compile_flags}${_compile_options}\n")
|
||||
endfunction()
|
||||
|
||||
function(add_precompiled_header _target _input)
|
||||
if(CMAKE_COMPILER_IS_GNUCXX)
|
||||
get_filename_component(_name ${_input} NAME)
|
||||
set(_pch_header "${CMAKE_CURRENT_SOURCE_DIR}/${_input}")
|
||||
set(_pch_binary_dir "${CMAKE_CURRENT_BINARY_DIR}/${_target}_pch")
|
||||
set(_pchfile "${_pch_binary_dir}/${_name}")
|
||||
set(_outdir "${_pch_binary_dir}/${_name}.gch")
|
||||
make_directory(${_outdir})
|
||||
set(_output_cxx "${_outdir}/.c++")
|
||||
set(_output_c "${_outdir}/.c")
|
||||
|
||||
get_property(_sources TARGET ${_target} PROPERTY SOURCES)
|
||||
foreach(_source ${_sources})
|
||||
if(_source MATCHES \\.\(c\)$ AND NOT _source_for_c_flags)
|
||||
set(_source_for_c_flags "${_source}")
|
||||
elseif(_source MATCHES \\.\(cc|cxx|cpp\)$ AND NOT _source_for_cpp_flags)
|
||||
set(_source_for_cpp_flags "${_source}")
|
||||
endif()
|
||||
endforeach()
|
||||
|
||||
add_custom_command(
|
||||
OUTPUT "${_pchfile}"
|
||||
COMMAND "${CMAKE_COMMAND}" -E copy "${_pch_header}" "${_pchfile}"
|
||||
DEPENDS "${_pch_header}"
|
||||
COMMENT "Updating ${_name}")
|
||||
|
||||
if(_source_for_c_flags)
|
||||
set(_pch_c_flags_file "${_pch_binary_dir}/compile_flags_c.rsp")
|
||||
export_all_flags("${_pch_c_flags_file}" "${_source_for_c_flags}")
|
||||
set(_compiler_FLAGS "@${_pch_c_flags_file}")
|
||||
add_custom_command(
|
||||
OUTPUT "${_output_c}"
|
||||
COMMAND "${CMAKE_C_COMPILER}" ${_compiler_FLAGS} -x c-header -o "${_output_c}" -c "${_pchfile}"
|
||||
DEPENDS "${_pchfile}" "${_pch_c_flags_file}"
|
||||
COMMENT "Precompiling ${_name} for ${_target} (C)")
|
||||
endif()
|
||||
if(_source_for_cpp_flags)
|
||||
set(_pch_cpp_flags_file "${_pch_binary_dir}/compile_flags_cpp.rsp")
|
||||
export_all_flags("${_pch_cpp_flags_file}" "${_source_for_cpp_flags}")
|
||||
set(_compiler_FLAGS "@${_pch_cpp_flags_file}")
|
||||
add_custom_command(
|
||||
OUTPUT "${_output_cxx}"
|
||||
COMMAND "${CMAKE_CXX_COMPILER}" ${_compiler_FLAGS} -x c++-header -o "${_output_cxx}" -c "${_pchfile}"
|
||||
DEPENDS "${_pchfile}" "${_pch_cpp_flags_file}"
|
||||
COMMENT "Precompiling ${_name} for ${_target} (C++)")
|
||||
endif()
|
||||
|
||||
foreach(_source ${_sources})
|
||||
set(_pch_compile_flags "")
|
||||
|
||||
if(_source MATCHES \\.\(cc|cxx|cpp|c\)$)
|
||||
get_source_file_property(_pch_compile_flags "${_source}" COMPILE_FLAGS)
|
||||
if(NOT _pch_compile_flags)
|
||||
set(_pch_compile_flags)
|
||||
endif()
|
||||
separate_arguments(_pch_compile_flags)
|
||||
list(APPEND _pch_compile_flags -Winvalid-pch -include "${_pchfile}")
|
||||
|
||||
get_source_file_property(_object_depends "${_source}" OBJECT_DEPENDS)
|
||||
if(NOT _object_depends)
|
||||
set(_object_depends)
|
||||
endif()
|
||||
list(APPEND _object_depends "${_pchfile}")
|
||||
if(_source MATCHES \\.\(cc|cxx|cpp\)$)
|
||||
list(APPEND _object_depends "${_output_cxx}")
|
||||
else()
|
||||
list(APPEND _object_depends "${_output_c}")
|
||||
endif()
|
||||
|
||||
combine_arguments(_pch_compile_flags)
|
||||
set_source_files_properties(${_source} PROPERTIES
|
||||
COMPILE_FLAGS "${_pch_compile_flags}"
|
||||
OBJECT_DEPENDS "${_object_depends}")
|
||||
endif()
|
||||
endforeach()
|
||||
endif(CMAKE_COMPILER_IS_GNUCXX)
|
||||
endfunction()
|
@ -57,6 +57,7 @@
|
||||
'telegram_mac.gypi',
|
||||
'telegram_linux.gypi',
|
||||
'qt.gypi',
|
||||
'qt_rcc.gypi',
|
||||
'codegen_rules.gypi',
|
||||
],
|
||||
|
||||
|
@ -18,10 +18,11 @@
|
||||
# Copyright (c) 2014 John Preston, https://desktop.telegram.org
|
||||
|
||||
{
|
||||
'includes': [
|
||||
'includes': [
|
||||
'settings_win.gypi',
|
||||
'settings_mac.gypi',
|
||||
],
|
||||
'settings_linux.gypi',
|
||||
],
|
||||
'variables': {
|
||||
'variables': {
|
||||
'variables': {
|
||||
@ -58,7 +59,7 @@
|
||||
'build_mac%': '<(build_mac)',
|
||||
'build_linux%': '<(build_linux)',
|
||||
|
||||
'official_build_target%': '<!(python <(DEPTH)/official.py --read-target)',
|
||||
'official_build_target%': '<!(python <(DEPTH)/official.py --read-target)',
|
||||
},
|
||||
'build_os%': '<(build_os)',
|
||||
'build_win%': '<(build_win)',
|
||||
|
@ -23,14 +23,13 @@
|
||||
'variables': {
|
||||
'variables': {
|
||||
'qt_libs': [
|
||||
'Qt5Core',
|
||||
'Qt5Gui',
|
||||
'Qt5Widgets',
|
||||
'qtharfbuzzng',
|
||||
'Qt5Network',
|
||||
'Qt5PlatformSupport',
|
||||
'Qt5PrintSupport',
|
||||
'qwebp',
|
||||
'Qt5PrintSupport',
|
||||
'Qt5PlatformSupport',
|
||||
'Qt5Network',
|
||||
'Qt5Widgets',
|
||||
'Qt5Gui',
|
||||
'qtharfbuzzng',
|
||||
],
|
||||
'conditions': [
|
||||
[ 'build_macold', {
|
||||
@ -48,8 +47,11 @@
|
||||
'qt_lib_release_postfix': '<(ld_lib_postfix)',
|
||||
'qt_libs': [
|
||||
'<@(qt_libs)',
|
||||
'Qt5Core',
|
||||
'qtmain',
|
||||
'qwindows',
|
||||
'qtfreetype',
|
||||
'qtpcre',
|
||||
],
|
||||
}],
|
||||
[ 'build_mac', {
|
||||
@ -58,20 +60,54 @@
|
||||
'qt_lib_release_postfix': '<(ld_lib_postfix)',
|
||||
'qt_libs': [
|
||||
'<@(qt_libs)',
|
||||
'Qt5Core',
|
||||
'qgenericbearer',
|
||||
'qcocoa',
|
||||
],
|
||||
}],
|
||||
[ 'build_macold', {
|
||||
'qt_loc_unix': '/usr/local/Qt-<(qt_version)'
|
||||
}, {
|
||||
}],
|
||||
[ 'build_mac and not build_macold', {
|
||||
'qt_loc_unix': '/usr/local/tdesktop/Qt-<(qt_version)',
|
||||
'qt_libs': [
|
||||
'<@(qt_libs)',
|
||||
'qtfreetype',
|
||||
'qtpcre',
|
||||
'<@(qt_libs)',
|
||||
'Qt5Core',
|
||||
'qtfreetype',
|
||||
'qtpcre',
|
||||
],
|
||||
}]
|
||||
}],
|
||||
[ 'build_linux', {
|
||||
'qt_loc_unix': '/usr/local/tdesktop/Qt-<(qt_version)',
|
||||
'qt_lib_prefix': 'lib',
|
||||
'qt_lib_debug_postfix': '.a',
|
||||
'qt_lib_release_postfix': '.a',
|
||||
'qt_libs': [
|
||||
'qxcb',
|
||||
'Qt5XcbQpa',
|
||||
'qconnmanbearer',
|
||||
'qgenericbearer',
|
||||
'qnmbearer',
|
||||
'<@(qt_libs)',
|
||||
'Qt5DBus',
|
||||
'Qt5Core',
|
||||
'qtpcre',
|
||||
'ssl',
|
||||
'crypto',
|
||||
'Xi',
|
||||
'Xext',
|
||||
'SM',
|
||||
'ICE',
|
||||
'fontconfig',
|
||||
'expat',
|
||||
'freetype',
|
||||
'xcb',
|
||||
'xcb-shm',
|
||||
'xcb-xfixes',
|
||||
'xcb-render',
|
||||
'xcb-static',
|
||||
],
|
||||
}],
|
||||
],
|
||||
},
|
||||
'qt_version%': '<(qt_version)',
|
||||
@ -143,6 +179,10 @@
|
||||
|
||||
'include_dirs': [
|
||||
'<(qt_loc)/include',
|
||||
'<(qt_loc)/include/QtCore',
|
||||
'<(qt_loc)/include/QtGui',
|
||||
'<(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',
|
||||
],
|
||||
@ -152,6 +192,7 @@
|
||||
'<(qt_loc)/plugins/bearer',
|
||||
'<(qt_loc)/plugins/platforms',
|
||||
'<(qt_loc)/plugins/imageformats',
|
||||
'<(qt_loc)/plugins/platforminputcontexts',
|
||||
],
|
||||
'defines': [
|
||||
'QT_WIDGETS_LIB',
|
||||
@ -159,6 +200,33 @@
|
||||
'QT_GUI_LIB',
|
||||
'QT_CORE_LIB',
|
||||
],
|
||||
'conditions': [
|
||||
[ 'build_linux', {
|
||||
'library_dirs': [
|
||||
'<(qt_loc)/plugins/platforms/xcb/xcb-static',
|
||||
],
|
||||
'libraries': [
|
||||
'/usr/local/lib/libxkbcommon.a',
|
||||
'<@(qt_libs_release)',
|
||||
'X11',
|
||||
'X11-xcb',
|
||||
'dbus-1',
|
||||
'dl',
|
||||
'gthread-2.0',
|
||||
'glib-2.0',
|
||||
'pthread',
|
||||
],
|
||||
'include_dirs': [
|
||||
'<(qt_loc)/mkspecs/linux-g++',
|
||||
],
|
||||
'ldflags': [
|
||||
'-static-libstdc++',
|
||||
'-pthread',
|
||||
'-g',
|
||||
'-rdynamic',
|
||||
],
|
||||
}],
|
||||
],
|
||||
|
||||
'rules': [{
|
||||
'rule_name': 'qt_moc',
|
||||
@ -179,23 +247,5 @@
|
||||
],
|
||||
'message': 'Moc-ing <(RULE_INPUT_ROOT).h..',
|
||||
'process_outputs_as_sources': 1,
|
||||
}, {
|
||||
'rule_name': 'qt_rcc',
|
||||
'extension': 'qrc',
|
||||
'inputs': [
|
||||
'<(SHARED_INTERMEDIATE_DIR)/update_dependent_qrc.timestamp',
|
||||
],
|
||||
'outputs': [
|
||||
'<(SHARED_INTERMEDIATE_DIR)/<(_target_name)/qrc/qrc_<(RULE_INPUT_ROOT).cpp',
|
||||
],
|
||||
'action': [
|
||||
'<(qt_loc)/bin/rcc<(exe_ext)',
|
||||
'-name', '<(RULE_INPUT_ROOT)',
|
||||
'-no-compress',
|
||||
'<(RULE_INPUT_PATH)',
|
||||
'-o', '<(SHARED_INTERMEDIATE_DIR)/<(_target_name)/qrc/qrc_<(RULE_INPUT_ROOT).cpp',
|
||||
],
|
||||
'message': 'Rcc-ing <(RULE_INPUT_ROOT).qrc..',
|
||||
'process_outputs_as_sources': 1,
|
||||
}],
|
||||
}
|
||||
|
40
Telegram/gyp/qt_rcc.gypi
Normal file
40
Telegram/gyp/qt_rcc.gypi
Normal file
@ -0,0 +1,40 @@
|
||||
# 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
|
||||
|
||||
{
|
||||
'rules': [{
|
||||
'rule_name': 'qt_rcc',
|
||||
'extension': 'qrc',
|
||||
'inputs': [
|
||||
'<(SHARED_INTERMEDIATE_DIR)/update_dependent_qrc.timestamp',
|
||||
],
|
||||
'outputs': [
|
||||
'<(SHARED_INTERMEDIATE_DIR)/<(_target_name)/qrc/qrc_<(RULE_INPUT_ROOT).cpp',
|
||||
],
|
||||
'action': [
|
||||
'<(qt_loc)/bin/rcc<(exe_ext)',
|
||||
'-name', '<(RULE_INPUT_ROOT)',
|
||||
'-no-compress',
|
||||
'<(RULE_INPUT_PATH)',
|
||||
'-o', '<(SHARED_INTERMEDIATE_DIR)/<(_target_name)/qrc/qrc_<(RULE_INPUT_ROOT).cpp',
|
||||
],
|
||||
'message': 'Rcc-ing <(RULE_INPUT_ROOT).qrc..',
|
||||
'process_outputs_as_sources': 1,
|
||||
}],
|
||||
}
|
@ -4,12 +4,24 @@ pushd `dirname $0` > /dev/null
|
||||
FullScriptPath=`pwd`
|
||||
popd > /dev/null
|
||||
|
||||
MySystem=`uname -s`
|
||||
cd $FullScriptPath
|
||||
#gyp --depth=. --generator-output=../.. -Goutput_dir=out Telegram.gyp --format=ninja
|
||||
#gyp --depth=. --generator-output=../.. -Goutput_dir=out Telegram.gyp --format=xcode-ninja
|
||||
#gyp --depth=. --generator-output=../.. -Goutput_dir=out Telegram.gyp --format=xcode
|
||||
# use patched gyp with Xcode project generator
|
||||
../../../Libraries/gyp/gyp --depth=. --generator-output=../.. -Goutput_dir=out Telegram.gyp --format=xcode
|
||||
|
||||
if [ "$MySystem" == "Linux" ]; then
|
||||
../../../Libraries/gyp/gyp --depth=. --generator-output=../.. -Goutput_dir=out Telegram.gyp --format=cmake
|
||||
cd ../../out/Debug
|
||||
../../../Libraries/cmake-3.6.2/bin/cmake .
|
||||
cd ../Release
|
||||
../../../Libraries/cmake-3.6.2/bin/cmake .
|
||||
cd ../../Telegram/gyp
|
||||
else
|
||||
#gyp --depth=. --generator-output=../.. -Goutput_dir=out Telegram.gyp --format=ninja
|
||||
#gyp --depth=. --generator-output=../.. -Goutput_dir=out Telegram.gyp --format=xcode-ninja
|
||||
#gyp --depth=. --generator-output=../.. -Goutput_dir=out Telegram.gyp --format=xcode
|
||||
# use patched gyp with Xcode project generator
|
||||
../../../Libraries/gyp/gyp --depth=. --generator-output=../.. -Goutput_dir=out Telegram.gyp --format=xcode
|
||||
fi
|
||||
|
||||
cd ../..
|
||||
|
||||
cd $FullExecPath
|
||||
|
79
Telegram/gyp/settings_linux.gypi
Normal file
79
Telegram/gyp/settings_linux.gypi
Normal file
@ -0,0 +1,79 @@
|
||||
# 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
|
||||
|
||||
{
|
||||
'conditions': [
|
||||
[ 'build_linux', {
|
||||
'variables': {
|
||||
'linux_common_flags': [
|
||||
'-pipe',
|
||||
'-g',
|
||||
'-Wall',
|
||||
'-W',
|
||||
'-fPIC',
|
||||
'-Wno-unused-result',
|
||||
'-Wno-unused-variable',
|
||||
'-Wno-unused-parameter',
|
||||
'-Wno-unused-function',
|
||||
'-Wno-switch',
|
||||
'-Wno-comment',
|
||||
'-Wno-unused-but-set-variable',
|
||||
'-Wno-missing-field-initializers',
|
||||
],
|
||||
},
|
||||
'conditions': [
|
||||
[ '"<!(uname -p)" == "x86_64"', {
|
||||
'defines': [
|
||||
'Q_OS_LINUX64',
|
||||
],
|
||||
'conditions': [
|
||||
[ '"<(official_build_target)" != "" and "<(official_build_target)" != "linux"', {
|
||||
'sources': [ '__Wrong_Official_Build_Target__' ],
|
||||
}],
|
||||
],
|
||||
}, {
|
||||
'defines': [
|
||||
'Q_OS_LINUX32',
|
||||
],
|
||||
'conditions': [
|
||||
[ '"<(official_build_target)" != "" and "<(official_build_target)" != "linux32"', {
|
||||
'sources': [ '__Wrong_Official_Build_Target_<(official_build_target)_' ],
|
||||
}],
|
||||
],
|
||||
}],
|
||||
],
|
||||
'defines': [
|
||||
'_REENTRANT',
|
||||
'QT_STATICPLUGIN',
|
||||
'QT_PLUGIN',
|
||||
],
|
||||
'cflags': [
|
||||
'<@(linux_common_flags)',
|
||||
],
|
||||
'cflags_cc': [
|
||||
'<@(linux_common_flags)',
|
||||
'-std=gnu++1y',
|
||||
],
|
||||
'configurations': {
|
||||
'Debug': {
|
||||
},
|
||||
},
|
||||
}],
|
||||
],
|
||||
}
|
@ -73,13 +73,18 @@
|
||||
'CLANG_CXX_LANGUAGE_STANDARD': 'c++14',
|
||||
},
|
||||
'configurations': {
|
||||
'Debug': {
|
||||
'xcode_settings': {
|
||||
'ENABLE_TESTABILITY': 'YES',
|
||||
'ONLY_ACTIVE_ARCH': 'YES',
|
||||
},
|
||||
},
|
||||
'Debug': {
|
||||
'xcode_settings': {
|
||||
'ENABLE_TESTABILITY': 'YES',
|
||||
'ONLY_ACTIVE_ARCH': 'YES',
|
||||
},
|
||||
},
|
||||
},
|
||||
'conditions': [
|
||||
[ '"<(official_build_target)" != "" and "<(official_build_target)" != "mac" and "<(official_build_target)" != "mac32" and "<(official_build_target)" != "macstore"', {
|
||||
'sources': [ '__Wrong_Official_Build_Target__' ],
|
||||
}],
|
||||
],
|
||||
}],
|
||||
[ 'build_macold', {
|
||||
'xcode_settings': {
|
||||
|
@ -101,6 +101,11 @@
|
||||
},
|
||||
},
|
||||
},
|
||||
'conditions': [
|
||||
[ '"<(official_build_target)" != "" and "<(official_build_target)" != "win"', {
|
||||
'sources': [ '__Wrong_Official_Build_Target__' ],
|
||||
}],
|
||||
],
|
||||
}],
|
||||
],
|
||||
}
|
||||
|
@ -19,6 +19,15 @@
|
||||
|
||||
{
|
||||
'conditions': [[ 'build_linux', {
|
||||
'variables': {
|
||||
'pkgconfig_libs': [
|
||||
# In order to work libxkbcommon must be linked statically,
|
||||
# PKGCONFIG links it like "-L/usr/local/lib -lxkbcommon"
|
||||
# which makes a dynamic link which leads to segfault in
|
||||
# QApplication() -> createPlatformIntegration -> QXcbIntegrationPlugin::create
|
||||
#'xkbcommon',
|
||||
],
|
||||
},
|
||||
'include_dirs': [
|
||||
'/usr/local/include',
|
||||
'<(libs_loc)/openssl-xcode/include'
|
||||
@ -26,11 +35,52 @@
|
||||
'library_dirs': [
|
||||
'/usr/local/lib',
|
||||
'<(libs_loc)/libexif-0.6.20/libexif/.libs',
|
||||
'<(libs_loc)/breakpad/src/client/linux',
|
||||
],
|
||||
'libraries': [
|
||||
'-lssl',
|
||||
'-lcrypto',
|
||||
'-llzma',
|
||||
'breakpad_client',
|
||||
'composeplatforminputcontextplugin',
|
||||
'ibusplatforminputcontextplugin',
|
||||
'fcitxplatforminputcontextplugin',
|
||||
'liblzma.a',
|
||||
'libopenal.a',
|
||||
'libavformat.a',
|
||||
'libavcodec.a',
|
||||
'libswresample.a',
|
||||
'libswscale.a',
|
||||
'libavutil.a',
|
||||
'libopus.a',
|
||||
'libva-x11.a',
|
||||
'libva-drm.a',
|
||||
'libva.a',
|
||||
'libz.a',
|
||||
# '<!(pkg-config 2> /dev/null --libs <@(pkgconfig_libs))',
|
||||
],
|
||||
'cflags_cc': [
|
||||
'<!(pkg-config 2> /dev/null --cflags appindicator-0.1)',
|
||||
'<!(pkg-config 2> /dev/null --cflags gtk+-2.0)',
|
||||
'<!(pkg-config 2> /dev/null --cflags glib-2.0)',
|
||||
'<!(pkg-config 2> /dev/null --cflags dee-1.0)',
|
||||
],
|
||||
'configurations': {
|
||||
'Release': {
|
||||
'cflags': [
|
||||
'-Ofast',
|
||||
'-flto',
|
||||
'-fno-strict-aliasing',
|
||||
],
|
||||
'cflags_cc': [
|
||||
'-Ofast',
|
||||
'-flto',
|
||||
'-fno-strict-aliasing',
|
||||
],
|
||||
'ldflags': [
|
||||
'-Ofast',
|
||||
'-flto',
|
||||
],
|
||||
},
|
||||
},
|
||||
'cmake_precompiled_header': '<(src_loc)/stdafx.h',
|
||||
'cmake_precompiled_header_script': 'PrecompiledHeader.cmake',
|
||||
}]],
|
||||
}
|
||||
|
@ -84,6 +84,13 @@
|
||||
'LzmaLib',
|
||||
],
|
||||
}],
|
||||
[ 'build_linux', {
|
||||
'libraries': [
|
||||
'ssl',
|
||||
'crypto',
|
||||
'lzma',
|
||||
],
|
||||
}],
|
||||
],
|
||||
'xcode_settings': {
|
||||
'OTHER_LDFLAGS': [
|
||||
|
Loading…
Reference in New Issue
Block a user