telegram_options.cmake 2.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253
  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. option(TDESKTOP_API_TEST "Use test API credentials." OFF)
  7. set(TDESKTOP_API_ID "0" CACHE STRING "Provide 'api_id' for the Telegram API access.")
  8. set(TDESKTOP_API_HASH "" CACHE STRING "Provide 'api_hash' for the Telegram API access.")
  9. if (TDESKTOP_API_TEST)
  10. set(TDESKTOP_API_ID 17349)
  11. set(TDESKTOP_API_HASH 344583e45741c457fe1862106095a5eb)
  12. endif()
  13. if (TDESKTOP_API_ID STREQUAL "0" OR TDESKTOP_API_HASH STREQUAL "")
  14. message(FATAL_ERROR
  15. " \n"
  16. " PROVIDE: -D TDESKTOP_API_ID=[API_ID] -D TDESKTOP_API_HASH=[API_HASH]\n"
  17. " \n"
  18. " > To build your version of Telegram Desktop you're required to provide\n"
  19. " > your own 'api_id' and 'api_hash' for the Telegram API access.\n"
  20. " >\n"
  21. " > How to obtain your 'api_id' and 'api_hash' is described here:\n"
  22. " > https://core.telegram.org/api/obtaining_api_id\n"
  23. " >\n"
  24. " > If you're building the application not for deployment,\n"
  25. " > but only for test purposes you can use TEST ONLY credentials,\n"
  26. " > which are very limited by the Telegram API server:\n"
  27. " >\n"
  28. " > api_id: 17349\n"
  29. " > api_hash: 344583e45741c457fe1862106095a5eb\n"
  30. " >\n"
  31. " > Your users will start getting internal server errors on login\n"
  32. " > if you deploy an app using those 'api_id' and 'api_hash'.\n"
  33. " ")
  34. endif()
  35. if (DESKTOP_APP_DISABLE_AUTOUPDATE)
  36. target_compile_definitions(Telegram PRIVATE TDESKTOP_DISABLE_AUTOUPDATE)
  37. endif()
  38. if (DESKTOP_APP_DISABLE_CRASH_REPORTS)
  39. target_compile_definitions(Telegram PRIVATE TDESKTOP_DISABLE_CRASH_REPORTS)
  40. endif()
  41. if (DESKTOP_APP_USE_PACKAGED)
  42. target_compile_definitions(Telegram PRIVATE TDESKTOP_USE_PACKAGED)
  43. endif()
  44. if (DESKTOP_APP_SPECIAL_TARGET)
  45. target_compile_definitions(Telegram PRIVATE TDESKTOP_ALLOW_CLOSED_ALPHA)
  46. endif()