Add more options.

This commit is contained in:
John Preston 2019-11-21 14:56:17 +03:00
parent 7b6fcb467a
commit 9e5262008f
15 changed files with 167 additions and 33 deletions

View File

@ -1,9 +1,17 @@
# This file is part of Telegram Desktop,
# the official desktop application for the Telegram messaging service.
#
# For license and copyright information please follow this link:
# https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
cmake_minimum_required(VERSION 3.16)
cmake_policy(SET CMP0076 NEW)
cmake_policy(SET CMP0091 NEW)
set_property(GLOBAL PROPERTY USE_FOLDERS ON)
include(cmake/variables.cmake)
project(Telegram
LANGUAGES C CXX
VERSION 1.9.0
@ -11,7 +19,6 @@ project(Telegram
HOMEPAGE_URL "https://desktop.telegram.org"
)
include(cmake/paths.cmake)
include(cmake/options.cmake)
include(cmake/init_target.cmake)
include(cmake/generate_target.cmake)

View File

@ -1,3 +1,9 @@
# This file is part of Telegram Desktop,
# the official desktop application for the Telegram messaging service.
#
# For license and copyright information please follow this link:
# https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
add_executable(Telegram WIN32 MACOSX_BUNDLE)
init_target(Telegram)
@ -24,10 +30,10 @@ 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)
include(cmake/telegram_options.cmake)
set(style_files
boxes/boxes.style
@ -60,7 +66,6 @@ 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
@ -68,7 +73,6 @@ PRIVATE
lib_crl
lib_ui
lib_tl
lib_spellcheck
lib_storage
lib_lottie
lib_rlottie
@ -77,7 +81,7 @@ PRIVATE
lib_export
lib_ffmpeg
lib_tgvoip
lib_lz4
external_lz4
external_qt
external_openssl
external_crash_reports
@ -978,8 +982,8 @@ PRIVATE
target_compile_definitions(Telegram
PRIVATE
TDESKTOP_API_ID=17349
TDESKTOP_API_HASH=344583e45741c457fe1862106095a5eb
TDESKTOP_API_ID=${TDESKTOP_API_ID}
TDESKTOP_API_HASH=${TDESKTOP_API_HASH}
AL_LIBTYPE_STATIC
AL_ALEXT_PROTOTYPES
)
@ -994,3 +998,6 @@ PRIVATE
_other/updater_osx.m
)
nice_target_sources(Updater ${src_loc} "${updater_sources}")
set_target_properties(Telegram PROPERTIES RUNTIME_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}")
set_target_properties(Updater PROPERTIES RUNTIME_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}")

View File

@ -1,3 +1,9 @@
# This file is part of Telegram Desktop,
# the official desktop application for the Telegram messaging service.
#
# For license and copyright information please follow this link:
# https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
function(generate_lang target_name lang_file)
set(gen_dst ${CMAKE_CURRENT_BINARY_DIR}/gen)
set(generated_files

View File

@ -1,3 +1,9 @@
# This file is part of Telegram Desktop,
# the official desktop application for the Telegram messaging service.
#
# For license and copyright information please follow this link:
# https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
function(generate_numbers target_name numbers_file)
set(gen_dst ${CMAKE_CURRENT_BINARY_DIR}/gen)
set(generated_files

View File

@ -1,3 +1,9 @@
# This file is part of Telegram Desktop,
# the official desktop application for the Telegram messaging service.
#
# For license and copyright information please follow this link:
# https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
function(generate_scheme target_name script scheme_files)
set(gen_dst ${CMAKE_CURRENT_BINARY_DIR}/gen)
set(generated_files

View File

@ -1,3 +1,9 @@
# This file is part of Telegram Desktop,
# the official desktop application for the Telegram messaging service.
#
# For license and copyright information please follow this link:
# https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
add_library(lib_export OBJECT)
init_target(lib_export)

View File

@ -1,3 +1,9 @@
# This file is part of Telegram Desktop,
# the official desktop application for the Telegram messaging service.
#
# For license and copyright information please follow this link:
# https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
add_library(lib_ffmpeg OBJECT)
init_target(lib_ffmpeg)

View File

@ -1,22 +0,0 @@
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}
)

View File

@ -1,3 +1,9 @@
# This file is part of Telegram Desktop,
# the official desktop application for the Telegram messaging service.
#
# For license and copyright information please follow this link:
# https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
add_library(lib_mtproto OBJECT)
init_target(lib_mtproto)

View File

@ -1,3 +1,9 @@
# This file is part of Telegram Desktop,
# the official desktop application for the Telegram messaging service.
#
# For license and copyright information please follow this link:
# https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
add_library(lib_scheme OBJECT)
init_target(lib_scheme)

View File

@ -1,3 +1,9 @@
# This file is part of Telegram Desktop,
# the official desktop application for the Telegram messaging service.
#
# For license and copyright information please follow this link:
# https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
add_library(lib_tgvoip OBJECT)
init_target(lib_tgvoip)
@ -708,7 +714,6 @@ PRIVATE
WEBRTC_APM_DEBUG_DUMP=0
TGVOIP_USE_DESKTOP_DSP
WEBRTC_NS_FLOAT
WEBRTC_WIN
)
if (WIN32)
@ -716,6 +721,29 @@ if (WIN32)
PRIVATE
/wd4005
)
target_compile_definitions(lib_tgvoip
PRIVATE
WEBRTC_WIN
)
elseif (APPLE)
target_compile_definitions(lib_tgvoip
PRIVATE
WEBRTC_POSIX
WEBRTC_MAC
TARGET_OS_OSX
)
if (build_macstore)
target_compile_definitions(lib_tgvoip
PRIVATE
TGVOIP_NO_OSX_PRIVATE_API
)
endif()
else()
target_compile_definitions(lib_tgvoip
PRIVATE
WEBRTC_POSIX
WEBRTC_LINUX
)
endif()
target_include_directories(lib_tgvoip

View File

@ -0,0 +1,72 @@
# This file is part of Telegram Desktop,
# the official desktop application for the Telegram messaging service.
#
# For license and copyright information please follow this link:
# https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
option(TDESKTOP_FORCE_GTK_FILE_DIALOG "Force using GTK file dialog (Linux only)." OFF)
option(TDESKTOP_DISABLE_REGISTER_CUSTOM_SCHEME "Disable automatic 'tg://' URL scheme handler registration." OFF)
option(TDESKTOP_DISABLE_NETWORK_PROXY "Disable all code for working through Socks5 or MTProxy." OFF)
option(TDESKTOP_DISABLE_DESKTOP_FILE_GENERATION "Disable automatic '.desktop' file generation (Linux only)." OFF)
option(TDESKTOP_DISABLE_GTK_INTEGRATION "Disable all code for GTK integration (Linux only)." OFF)
option(TDESKTOP_API_TEST "Use test API credentials." OFF)
set(TDESKTOP_API_ID "0" CACHE STRING "Provide 'api_id' for the Telegram API access.")
set(TDESKTOP_API_HASH "" CACHE STRING "Provide 'api_hash' for the Telegram API access.")
if (TDESKTOP_API_TEST)
set(TDESKTOP_API_ID 17349)
set(TDESKTOP_API_HASH 344583e45741c457fe1862106095a5eb)
endif()
if (TDESKTOP_API_ID STREQUAL "0" OR TDESKTOP_API_HASH STREQUAL "")
message(FATAL_ERROR
" \n"
" PROVIDE: -D TDESKTOP_API_ID=[API_ID] -D TDESKTOP_API_HASH=[API_HASH]\n"
" \n"
" > To build your version of Telegram Desktop you're required to provide\n"
" > your own 'api_id' and 'api_hash' for the Telegram API access.\n"
" >\n"
" > How to obtain your 'api_id' and 'api_hash' is described here:\n"
" > https://core.telegram.org/api/obtaining_api_id\n"
" >\n"
" > If you're building the application not for deployment,\n"
" > but only for test purposes you can use TEST ONLY credentials,\n"
" > which are very limited by the Telegram API server:\n"
" >\n"
" > api_id: 17349\n"
" > api_hash: 344583e45741c457fe1862106095a5eb\n"
" >\n"
" > Your users will start getting internal server errors on login\n"
" > if you deploy an app using those 'api_id' and 'api_hash'.\n"
" ")
endif()
if (TDESKTOP_FORCE_GTK_FILE_DIALOG AND TDESKTOP_DISABLE_GTK_INTEGRATION)
message(FATAL_ERROR "Option TDESKTOP_FORCE_GTK_FILE_DIALOG conflicts with option TDESKTOP_DISABLE_GTK_INTEGRATION.")
endif()
if (DESKTOP_APP_DISABLE_SPELLCHECK)
target_compile_definitions(Telegram PRIVATE TDESKTOP_DISABLE_SPELLCHECK)
else()
target_link_libraries(Telegram PRIVATE lib_spellcheck)
endif()
if (TDESKTOP_FORCE_GTK_FILE_DIALOG)
target_compile_definitions(Telegram PRIVATE TDESKTOP_FORCE_GTK_FILE_DIALOG)
endif()
if (TDESKTOP_DISABLE_REGISTER_CUSTOM_SCHEME)
target_compile_definitions(Telegram PRIVATE TDESKTOP_DISABLE_REGISTER_CUSTOM_SCHEME)
endif()
if (TDESKTOP_DISABLE_NETWORK_PROXY)
target_compile_definitions(Telegram PRIVATE TDESKTOP_DISABLE_NETWORK_PROXY)
endif()
if (TDESKTOP_DISABLE_DESKTOP_FILE_GENERATION)
target_compile_definitions(Telegram PRIVATE TDESKTOP_DISABLE_DESKTOP_FILE_GENERATION)
endif()
if (TDESKTOP_DISABLE_GTK_INTEGRATION)
target_compile_definitions(Telegram PRIVATE TDESKTOP_DISABLE_GTK_INTEGRATION)
endif()

@ -1 +1 @@
Subproject commit 3ef08c5aec24e544b8fbc6372c9baf56993aa0b0
Subproject commit 03693ebccbc41af6279e3fcdb1e91ea23f9942b4

@ -1 +1 @@
Subproject commit ffdc9cc7b64e3d9502ae416cc362f3f2d327b8a8
Subproject commit 1ed6307b816d368c20848e653e47498292c607c4

2
cmake

@ -1 +1 @@
Subproject commit 2a87436d39b8c0248a2e717b2ef1834329489ccc
Subproject commit 118ce81dd412306900f862be412b419cf243cfa2