libs.lua 3.4 KB

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