meson.build 4.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139
  1. project('quickmedia', ['c', 'cpp'], version : '1.0.0', default_options : ['warning_level=2', 'cpp_std=c++17'], subproject_dir : 'depends')
  2. if get_option('buildtype') == 'debug'
  3. add_project_arguments('-g3', language : ['c', 'cpp'])
  4. elif get_option('buildtype') == 'release'
  5. add_project_arguments('-DNDEBUG', language : ['c', 'cpp'])
  6. endif
  7. src = [
  8. 'external/hash-library/sha256.cpp',
  9. 'generated/Tlds.cpp',
  10. 'generated/Emoji.cpp',
  11. 'src/plugins/utils/aes.c',
  12. 'src/plugins/Fourchan.cpp',
  13. 'src/plugins/Mangadex.cpp',
  14. 'src/plugins/ImageBoard.cpp',
  15. 'src/plugins/MangaCombined.cpp',
  16. 'src/plugins/Manga.cpp',
  17. 'src/plugins/Lbry.cpp',
  18. 'src/plugins/NyaaSi.cpp',
  19. 'src/plugins/HotExamples.cpp',
  20. 'src/plugins/FileManager.cpp',
  21. 'src/plugins/MediaGeneric.cpp',
  22. 'src/plugins/Matrix.cpp',
  23. 'src/plugins/Plugin.cpp',
  24. 'src/plugins/MangaGeneric.cpp',
  25. 'src/plugins/Pipe.cpp',
  26. 'src/plugins/Manganelo.cpp',
  27. 'src/plugins/LocalManga.cpp',
  28. 'src/plugins/Page.cpp',
  29. 'src/plugins/Peertube.cpp',
  30. 'src/plugins/LocalAnime.cpp',
  31. 'src/plugins/AniList.cpp',
  32. 'src/plugins/DramaCool.cpp',
  33. 'src/plugins/utils/UniqueProcess.cpp',
  34. 'src/plugins/utils/WatchProgress.cpp',
  35. 'src/plugins/utils/EpisodeNameParser.cpp',
  36. 'src/plugins/Info.cpp',
  37. 'src/plugins/Youtube.cpp',
  38. 'src/plugins/Saucenao.cpp',
  39. 'src/plugins/Soundcloud.cpp',
  40. 'src/Theme.cpp',
  41. 'src/Storage.cpp',
  42. 'src/Text.cpp',
  43. 'src/Config.cpp',
  44. 'src/DownloadUtils.cpp',
  45. 'src/Json.cpp',
  46. 'src/gui/Button.cpp',
  47. 'src/SearchBar.cpp',
  48. 'src/RoundedRectangle.cpp',
  49. 'src/Entry.cpp',
  50. 'src/Notification.cpp',
  51. 'src/AsyncImageLoader.cpp',
  52. 'src/ImageViewer.cpp',
  53. 'src/Body.cpp',
  54. 'src/Program.cpp',
  55. 'src/main.cpp',
  56. 'src/ImageUtils.cpp',
  57. 'src/NetUtils.cpp',
  58. 'src/BodyItem.cpp',
  59. 'src/Downloader.cpp',
  60. 'src/ResourceLoader.cpp',
  61. 'src/VideoPlayer.cpp',
  62. 'src/Tabs.cpp',
  63. 'src/FileAnalyzer.cpp',
  64. 'src/QuickMedia.cpp',
  65. 'src/M3U8.cpp',
  66. 'src/Utils.cpp',
  67. 'src/StringUtils.cpp',
  68. ]
  69. mglpp_proj = subproject('mglpp')
  70. mglpp_dep = mglpp_proj.get_variable('mglpp_dep')
  71. jsoncpp_proj = subproject('jsoncpp')
  72. jsoncpp_dep = jsoncpp_proj.get_variable('jsoncpp_dep')
  73. rapidjson_proj = subproject('rapidjson')
  74. rapidjson_dep = rapidjson_proj.get_variable('rapidjson_dep')
  75. html_parser_proj = subproject('html-parser')
  76. html_parser_dep = html_parser_proj.get_variable('html_parser_dep')
  77. html_search_proj = subproject('html-search')
  78. html_search_dep = html_search_proj.get_variable('html_search_dep')
  79. prefix = get_option('prefix')
  80. datadir = get_option('datadir')
  81. qm_resources_path = join_paths(prefix, datadir, 'quickmedia')
  82. if get_option('native_arch') == true
  83. add_project_arguments('-march=native', language: ['c', 'cpp'])
  84. endif
  85. executable(
  86. meson.project_name(),
  87. src,
  88. install : true,
  89. dependencies : [
  90. mglpp_dep,
  91. jsoncpp_dep,
  92. rapidjson_dep,
  93. html_parser_dep,
  94. html_search_dep,
  95. dependency('threads'),
  96. ],
  97. )
  98. executable(
  99. 'quickmedia-video-player',
  100. [
  101. 'video_player/src/main.cpp'
  102. ],
  103. install : true,
  104. dependencies : [
  105. jsoncpp_dep,
  106. dependency('mpv'),
  107. ],
  108. )
  109. install_subdir('mpv', install_dir : qm_resources_path)
  110. install_subdir('images', install_dir : qm_resources_path)
  111. install_subdir('icons', install_dir : qm_resources_path)
  112. install_subdir('shaders', install_dir : qm_resources_path)
  113. install_subdir('themes', install_dir : qm_resources_path)
  114. install_data('launcher/QuickMedia.desktop', install_dir : join_paths(prefix, datadir, 'applications'))
  115. install_data(files('boards.json'), install_dir : qm_resources_path)
  116. install_data(files('example-config.json'), install_dir : qm_resources_path)
  117. install_data(files('README.md'), install_dir : qm_resources_path)
  118. if get_option('install_symlink') == true
  119. install_symlink('qm', install_dir : join_paths(prefix, 'bin'), pointing_to: join_paths(prefix, 'bin', meson.project_name()))
  120. endif
  121. if get_option('install_emoji') == true
  122. meson.add_install_script('meson_post_install.sh')
  123. endif