mirror of
https://github.com/telegramdesktop/tdesktop
synced 2025-01-29 19:03:03 +00:00
Initial build with Xcode.
This commit is contained in:
parent
fe1aacd37b
commit
5bfb98b70d
@ -19,10 +19,13 @@ project(Telegram
|
||||
HOMEPAGE_URL "https://desktop.telegram.org"
|
||||
)
|
||||
|
||||
include(cmake/options.cmake)
|
||||
include(cmake/nice_target_sources.cmake)
|
||||
include(cmake/target_link_frameworks.cmake)
|
||||
include(cmake/init_target.cmake)
|
||||
include(cmake/generate_target.cmake)
|
||||
include(cmake/nice_target_sources.cmake)
|
||||
|
||||
include(cmake/options.cmake)
|
||||
|
||||
include(cmake/external/qt/package.cmake)
|
||||
|
||||
add_subdirectory(cmake)
|
||||
|
@ -7,9 +7,6 @@
|
||||
add_executable(Telegram WIN32 MACOSX_BUNDLE)
|
||||
init_target(Telegram)
|
||||
|
||||
add_executable(Updater WIN32)
|
||||
init_target(Updater)
|
||||
|
||||
add_subdirectory(lib_rpl)
|
||||
add_subdirectory(lib_crl)
|
||||
add_subdirectory(lib_base)
|
||||
@ -63,8 +60,7 @@ 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 AUTOMOC ON AUTORCC ON)
|
||||
|
||||
target_link_libraries(Telegram
|
||||
PRIVATE
|
||||
@ -82,14 +78,17 @@ PRIVATE
|
||||
desktop-app::external_lz4
|
||||
desktop-app::external_rlottie
|
||||
desktop-app::external_qt
|
||||
desktop-app::external_openssl
|
||||
desktop-app::external_crash_reports
|
||||
desktop-app::external_auto_updates
|
||||
desktop-app::external_openssl
|
||||
desktop-app::external_zlib
|
||||
desktop-app::external_opus
|
||||
desktop-app::external_openal
|
||||
)
|
||||
|
||||
if (NOT DESKTOP_APP_DISABLE_CRASH_REPORTS)
|
||||
target_link_libraries(Telegram PRIVATE desktop-app::external_crash_reports)
|
||||
endif()
|
||||
|
||||
set(telegram_sources
|
||||
PRIVATE
|
||||
api/api_common.h
|
||||
@ -960,19 +959,70 @@ if (WIN32)
|
||||
# COMMENT
|
||||
# $<IF:${release},"Appending compatibility manifest.","Finalizing build.">
|
||||
# )
|
||||
else()
|
||||
elseif (APPLE)
|
||||
target_link_libraries(Telegram
|
||||
PRIVATE
|
||||
desktop-app::external_minizip
|
||||
desktop-app::external_sp_media_key_tap
|
||||
desktop-app::external_iconv
|
||||
)
|
||||
if (APPLE)
|
||||
target_link_libraries(Telegram
|
||||
PRIVATE
|
||||
desktop-app::external_sp_media_key_tap
|
||||
|
||||
set(icons_path ${CMAKE_CURRENT_SOURCE_DIR}/Telegram/Images.xcassets)
|
||||
set_target_properties(Telegram PROPERTIES RESOURCE ${icons_path})
|
||||
target_sources(Telegram PRIVATE ${icons_path})
|
||||
|
||||
set(lang_packs
|
||||
en
|
||||
de
|
||||
es
|
||||
it
|
||||
nl
|
||||
ko
|
||||
pt-BR
|
||||
)
|
||||
foreach (lang ${lang_packs})
|
||||
set(strings_path ${res_loc}/langs/${lang}.lproj/Localizable.strings)
|
||||
set_source_files_properties(${strings_path} PROPERTIES
|
||||
MACOSX_PACKAGE_LOCATION
|
||||
Resources/${lang}.lproj/Localizable.strings
|
||||
)
|
||||
target_sources(Telegram PRIVATE ${strings_path})
|
||||
endforeach()
|
||||
|
||||
add_custom_command(TARGET Telegram
|
||||
PRE_LINK
|
||||
COMMAND mkdir -p $<TARGET_FILE_DIR:Telegram>/../Frameworks
|
||||
COMMAND cp $<TARGET_FILE:Updater> $<TARGET_FILE_DIR:Telegram>/../Frameworks/
|
||||
)
|
||||
|
||||
if (NOT DESKTOP_APP_DISABLE_CRASH_REPORTS)
|
||||
add_custom_command(TARGET Telegram
|
||||
PRE_LINK
|
||||
COMMAND mkdir -p $<TARGET_FILE_DIR:Telegram>/../Helpers
|
||||
COMMAND cp ${libs_loc}/crashpad/out/$<IF:$<CONFIG:Debug>,Debug,Release>/crashpad_handler $<TARGET_FILE_DIR:Telegram>/../Helpers/
|
||||
)
|
||||
endif()
|
||||
endif()
|
||||
|
||||
if (build_macstore)
|
||||
set(bundle_identifier "org.telegram.desktop")
|
||||
elseif (build_osx)
|
||||
set(bundle_identifier "com.tdesktop.Telegram$<$<CONFIG:Debug>:DebugOsx>")
|
||||
else()
|
||||
set(bundle_identifier "com.tdesktop.Telegram$<$<CONFIG:Debug>:Debug>")
|
||||
endif()
|
||||
set_target_properties(Telegram PROPERTIES
|
||||
MACOSX_BUNDLE_GUI_IDENTIFIER ${bundle_identifier}
|
||||
MACOSX_BUNDLE_INFO_PLIST ${CMAKE_CURRENT_SOURCE_DIR}/Telegram.plist
|
||||
XCODE_ATTRIBUTE_DEBUG_INFORMATION_FORMAT $<$<NOT:$<CONFIG:Debug>>:dwarf-with-dsym>
|
||||
XCODE_ATTRIBUTE_ASSETCATALOG_COMPILER_APPICON_NAME AppIcon
|
||||
XCODE_ATTRIBUTE_ENABLE_HARDENED_RUNTIME YES
|
||||
XCODE_ATTRIBUTE_COMBINE_HIDPI_IMAGES YES
|
||||
XCODE_ATTRIBUTE_COPY_PHASE_STRIP NO
|
||||
XCODE_ATTRIBUTE_ALWAYS_SEARCH_USER_PATHS NO
|
||||
XCODE_ATTRIBUTE_CLANG_CXX_LIBRARY libc++
|
||||
XCODE_ATTRIBUTE_OTHER_CODE_SIGN_FLAGS --deep
|
||||
)
|
||||
|
||||
target_include_directories(Telegram
|
||||
PRIVATE
|
||||
${src_loc}
|
||||
@ -987,6 +1037,11 @@ PRIVATE
|
||||
AL_ALEXT_PROTOTYPES
|
||||
)
|
||||
|
||||
set_target_properties(Telegram PROPERTIES RUNTIME_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}")
|
||||
|
||||
add_executable(Updater WIN32)
|
||||
init_target(Updater)
|
||||
|
||||
add_dependencies(Telegram Updater)
|
||||
|
||||
set(updater_sources
|
||||
@ -998,5 +1053,4 @@ PRIVATE
|
||||
)
|
||||
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}")
|
||||
|
@ -29,7 +29,7 @@
|
||||
#include "mainwindow.h"
|
||||
#include "observer_peer.h"
|
||||
#include "base/platform/mac/base_utilities_mac.h"
|
||||
#include "stickers.h"
|
||||
#include "chat_helpers/stickers.h"
|
||||
#include "styles/style_dialogs.h"
|
||||
#include "styles/style_media_player.h"
|
||||
#include "styles/style_settings.h"
|
||||
|
@ -6,6 +6,8 @@
|
||||
|
||||
function(generate_lang target_name lang_file)
|
||||
set(gen_dst ${CMAKE_CURRENT_BINARY_DIR}/gen)
|
||||
file(MAKE_DIRECTORY ${gen_dst})
|
||||
|
||||
set(generated_files
|
||||
${gen_dst}/lang_auto.cpp
|
||||
${gen_dst}/lang_auto.h
|
||||
|
@ -6,6 +6,8 @@
|
||||
|
||||
function(generate_numbers target_name numbers_file)
|
||||
set(gen_dst ${CMAKE_CURRENT_BINARY_DIR}/gen)
|
||||
file(MAKE_DIRECTORY ${gen_dst})
|
||||
|
||||
set(generated_files
|
||||
${gen_dst}/numbers.cpp
|
||||
${gen_dst}/numbers.h
|
||||
|
@ -6,6 +6,8 @@
|
||||
|
||||
function(generate_scheme target_name script scheme_files)
|
||||
set(gen_dst ${CMAKE_CURRENT_BINARY_DIR}/gen)
|
||||
file(MAKE_DIRECTORY ${gen_dst})
|
||||
|
||||
set(generated_files
|
||||
${gen_dst}/scheme.cpp
|
||||
${gen_dst}/scheme.h
|
||||
|
@ -4,8 +4,8 @@
|
||||
# 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)
|
||||
add_library(lib_tgvoip STATIC)
|
||||
init_target(lib_tgvoip cxx_std_11)
|
||||
add_library(tdesktop::lib_tgvoip ALIAS lib_tgvoip)
|
||||
|
||||
set(tgvoip_loc ${third_party_loc}/libtgvoip)
|
||||
@ -168,6 +168,8 @@ PRIVATE
|
||||
webrtc_dsp/rtc_base/sanitizer.h
|
||||
webrtc_dsp/rtc_base/scoped_ref_ptr.h
|
||||
webrtc_dsp/rtc_base/logging.h
|
||||
webrtc_dsp/rtc_base/logging_mac.h
|
||||
webrtc_dsp/rtc_base/logging_mac.mm
|
||||
webrtc_dsp/rtc_base/timeutils.h
|
||||
webrtc_dsp/rtc_base/atomicops.h
|
||||
webrtc_dsp/rtc_base/stringencode.cc
|
||||
@ -721,6 +723,7 @@ if (WIN32)
|
||||
target_compile_options(lib_tgvoip
|
||||
PRIVATE
|
||||
/wd4005
|
||||
/wd4244 # conversion from 'int' to 'float', possible loss of data (several in webrtc)
|
||||
)
|
||||
target_compile_definitions(lib_tgvoip
|
||||
PRIVATE
|
||||
@ -732,6 +735,7 @@ elseif (APPLE)
|
||||
WEBRTC_POSIX
|
||||
WEBRTC_MAC
|
||||
TARGET_OS_OSX
|
||||
TARGET_OSX
|
||||
)
|
||||
if (build_macstore)
|
||||
target_compile_definitions(lib_tgvoip
|
||||
@ -755,11 +759,6 @@ 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
|
||||
desktop-app::external_openssl
|
||||
|
@ -1 +1 @@
|
||||
Subproject commit 348f27fcc64a82e0a3ae3ec4dbb302e5bd9f5bab
|
||||
Subproject commit 0671bf70547381effcf442ec9618e04502a8adbc
|
@ -1 +1 @@
|
||||
Subproject commit 8e3034213761ba98a916b16ad230560e5695c856
|
||||
Subproject commit 6fda2709ea0f594fc869422dee77eef2fd9dc86c
|
2
cmake
2
cmake
@ -1 +1 @@
|
||||
Subproject commit b303af63d7ff7c6f76f223761004c6dee6c15a78
|
||||
Subproject commit 9e68adb86662862175f00b8a00c36aa9e1569cc8
|
Loading…
Reference in New Issue
Block a user