2019-11-21 11:56:17 +00:00
|
|
|
# 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
|
|
|
|
|
2020-09-30 07:51:17 +00:00
|
|
|
add_library(td_scheme OBJECT)
|
2023-02-08 09:19:52 +00:00
|
|
|
init_non_host_target(td_scheme)
|
2020-09-30 07:51:17 +00:00
|
|
|
add_library(tdesktop::td_scheme ALIAS td_scheme)
|
2019-11-08 12:02:15 +00:00
|
|
|
|
|
|
|
include(cmake/generate_scheme.cmake)
|
|
|
|
|
|
|
|
set(scheme_files
|
2023-06-02 07:46:19 +00:00
|
|
|
${src_loc}/mtproto/scheme/api.tl
|
|
|
|
${src_loc}/mtproto/scheme/mtproto.tl
|
2019-11-08 12:02:15 +00:00
|
|
|
)
|
|
|
|
|
2020-09-30 07:51:17 +00:00
|
|
|
generate_scheme(td_scheme ${src_loc}/codegen/scheme/codegen_scheme.py "${scheme_files}")
|
2019-11-08 12:02:15 +00:00
|
|
|
|
2023-06-02 07:46:19 +00:00
|
|
|
nice_target_sources(td_scheme ${src_loc}/mtproto/scheme
|
2019-12-09 12:59:08 +00:00
|
|
|
PRIVATE
|
2023-06-02 07:46:19 +00:00
|
|
|
api.tl
|
|
|
|
mtproto.tl
|
2019-12-09 12:59:08 +00:00
|
|
|
)
|
|
|
|
|
2020-09-30 07:51:17 +00:00
|
|
|
target_include_directories(td_scheme
|
2019-11-08 12:02:15 +00:00
|
|
|
PUBLIC
|
|
|
|
${src_loc}
|
|
|
|
)
|
|
|
|
|
2020-09-30 07:51:17 +00:00
|
|
|
target_link_libraries(td_scheme
|
2019-11-08 12:02:15 +00:00
|
|
|
PUBLIC
|
2019-11-21 14:41:11 +00:00
|
|
|
desktop-app::lib_base
|
|
|
|
desktop-app::lib_tl
|
2019-11-08 12:02:15 +00:00
|
|
|
)
|
2021-02-09 05:55:41 +00:00
|
|
|
|
|
|
|
if (CMAKE_SYSTEM_PROCESSOR STREQUAL "mips64")
|
|
|
|
# Sometimes final linking may fail with error "relocation truncated to fit"
|
|
|
|
# due to large scheme size.
|
|
|
|
target_compile_options(td_scheme
|
|
|
|
PRIVATE
|
|
|
|
-mxgot
|
|
|
|
)
|
|
|
|
endif()
|