2
0

libs.lua 3.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229
  1. local sorted_libs = {
  2. "asio",
  3. "wave",
  4. "url",
  5. "type_erasure",
  6. "timer",
  7. "test",
  8. "stacktrace",
  9. "program_options",
  10. "process",
  11. "nowide",
  12. "log",
  13. "locale",
  14. "json",
  15. "iostreams",
  16. "graph_parallel",
  17. "mpi",
  18. "python",
  19. "graph",
  20. "serialization",
  21. "regex",
  22. "math",
  23. "random",
  24. "fiber",
  25. "filesystem",
  26. "coroutine",
  27. "contract",
  28. "thread",
  29. "date_time",
  30. "exception",
  31. "cobalt",
  32. "context",
  33. "container",
  34. "chrono",
  35. "system",
  36. "charconv",
  37. "atomic"
  38. }
  39. local libs_dep = {
  40. asio = {
  41. "date_time",
  42. },
  43. json = {
  44. "container",
  45. "system"
  46. },
  47. python = {
  48. "graph"
  49. },
  50. test = {
  51. "exception"
  52. },
  53. type_erasure = {
  54. "thread"
  55. },
  56. thread = {
  57. "atomic",
  58. "chrono",
  59. "container",
  60. "date_time",
  61. "exception",
  62. "system"
  63. },
  64. fiber = {
  65. "context",
  66. "filesystem"
  67. },
  68. chrono = {
  69. "system"
  70. },
  71. charconv = { },
  72. contract = {
  73. "exception",
  74. "thread"
  75. },
  76. timer = { },
  77. wave = {
  78. "filesystem",
  79. "serialization"
  80. },
  81. stacktrace = { },
  82. coroutine = {
  83. "context",
  84. "exception",
  85. "system"
  86. },
  87. math = {
  88. "random"
  89. },
  90. exception = { },
  91. filesystem = {
  92. "atomic",
  93. "system"
  94. },
  95. date_time = {
  96. "container",
  97. "exception",
  98. "regex"
  99. },
  100. atomic = { },
  101. url = {
  102. "system"
  103. },
  104. serialization = { },
  105. process = {
  106. "filesystem",
  107. "system"
  108. },
  109. regex = { },
  110. container = { },
  111. random = {
  112. "system"
  113. },
  114. nowide = {
  115. "filesystem"
  116. },
  117. program_options = { },
  118. system = { },
  119. cobalt = {
  120. "container",
  121. "context",
  122. "system"
  123. },
  124. graph = {
  125. "math",
  126. "random",
  127. "regex",
  128. "serialization"
  129. },
  130. context = { },
  131. mpi = {
  132. "graph",
  133. "python",
  134. "serialization"
  135. },
  136. log = {
  137. "atomic",
  138. "date_time",
  139. "exception",
  140. "filesystem",
  141. "random",
  142. "regex",
  143. "system",
  144. "thread"
  145. },
  146. iostreams = {
  147. "random",
  148. "regex"
  149. },
  150. locale = {
  151. "thread",
  152. "charconv"
  153. },
  154. graph_parallel = {
  155. "filesystem",
  156. "graph",
  157. "mpi",
  158. "random",
  159. "serialization"
  160. }
  161. }
  162. local header_only_buildable = {
  163. "graph_parallel",
  164. "system",
  165. "exception",
  166. "regex",
  167. "math",
  168. }
  169. function get_libs()
  170. return sorted_libs
  171. end
  172. function get_lib_deps()
  173. return libs_dep
  174. end
  175. function get_header_only_buildable()
  176. return header_only_buildable
  177. end
  178. function for_each(lambda)
  179. for _, libname in ipairs(get_libs()) do
  180. lambda(libname)
  181. end
  182. end
  183. function for_each_header_only_buildable_lib(lambda)
  184. for _, libname in ipairs(get_header_only_buildable()) do
  185. lambda(libname)
  186. end
  187. end
  188. function for_each_lib_deps(lambda)
  189. for libname, deps in pairs(get_lib_deps()) do
  190. lambda(libname, deps)
  191. end
  192. end
  193. function get_sub_libs(package)
  194. local sub_libs_map = {
  195. test = {"prg_exec_monitor", "unit_test_framework"},
  196. serialization = {"wserialization", "serialization"},
  197. fiber = {"fiber", "fiber_numa"},
  198. log = {"log", "log_setup"},
  199. stacktrace = {
  200. "stacktrace_noop",
  201. "stacktrace_backtrace",
  202. "stacktrace_addr2line",
  203. "stacktrace_basic",
  204. "stacktrace_windbg",
  205. "stacktrace_windbg_cached",
  206. },
  207. }
  208. if package:config("python") then
  209. local py_ver = assert(package:dep("python"):version(), "Can't get python version")
  210. py_ver = py_ver:major() .. py_ver:minor()
  211. -- TODO: detect numpy
  212. sub_libs_map["python"] = {
  213. "python" .. py_ver,
  214. "numpy" .. py_ver,
  215. }
  216. end
  217. return sub_libs_map
  218. end