td_scheme.cmake 1.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  1. # This file is part of Telegram Desktop,
  2. # the official desktop application for the Telegram messaging service.
  3. #
  4. # For license and copyright information please follow this link:
  5. # https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
  6. add_library(td_scheme OBJECT)
  7. init_non_host_target(td_scheme)
  8. add_library(tdesktop::td_scheme ALIAS td_scheme)
  9. include(cmake/generate_scheme.cmake)
  10. set(scheme_files
  11. ${src_loc}/mtproto/scheme/api.tl
  12. ${src_loc}/mtproto/scheme/mtproto.tl
  13. )
  14. generate_scheme(td_scheme ${src_loc}/codegen/scheme/codegen_scheme.py "${scheme_files}")
  15. nice_target_sources(td_scheme ${src_loc}/mtproto/scheme
  16. PRIVATE
  17. api.tl
  18. mtproto.tl
  19. )
  20. target_include_directories(td_scheme
  21. PUBLIC
  22. ${src_loc}
  23. )
  24. target_link_libraries(td_scheme
  25. PUBLIC
  26. desktop-app::lib_base
  27. desktop-app::lib_tl
  28. )
  29. if (CMAKE_SYSTEM_PROCESSOR STREQUAL "mips64")
  30. # Sometimes final linking may fail with error "relocation truncated to fit"
  31. # due to large scheme size.
  32. target_compile_options(td_scheme
  33. PRIVATE
  34. -mxgot
  35. )
  36. endif()