ya.make 6.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285
  1. # Generated by devtools/yamaker/ym2
  2. LIBRARY()
  3. LICENSE(
  4. Apache-2.0 AND
  5. Apache-2.0 WITH LLVM-exception AND
  6. BSL-1.0 AND
  7. MIT AND
  8. NCSA AND
  9. Public-Domain AND
  10. Unicode
  11. )
  12. LICENSE_TEXTS(.yandex_meta/licenses.list.txt)
  13. VERSION(2023-10-05)
  14. ORIGINAL_SOURCE(https://github.com/llvm/llvm-project/archive/dc129d6f715cf83a2072fc8de8b4e4c70bca6935.tar.gz)
  15. ADDINCL(
  16. GLOBAL contrib/libs/cxxsupp/libcxx/include
  17. contrib/libs/cxxsupp/libcxx/src
  18. )
  19. CXXFLAGS(-D_LIBCPP_BUILDING_LIBRARY)
  20. IF (OS_ANDROID)
  21. DEFAULT(CXX_RT "default")
  22. IF (ARCH_I686 OR ARCH_ARM7)
  23. # 32-bit architectures require additional libandroid_support.so to be linked
  24. # We add --start-group / --end-group statements due to the issue in NDK < r22.
  25. # See: https://github.com/android/ndk/issues/1130
  26. #
  27. # Though these statements are not respected by LLD, they might have sense for other linkers.
  28. LDFLAGS(
  29. -Wl,--start-group
  30. -lc++abi
  31. -landroid_support
  32. -Wl,--end-group
  33. )
  34. ELSE()
  35. LDFLAGS(-lc++abi)
  36. ENDIF()
  37. CFLAGS(
  38. -DLIBCXX_BUILDING_LIBCXXABI
  39. )
  40. # Take cxxabi implementation from system.
  41. ELSEIF (OS_IOS)
  42. LDFLAGS(-lc++abi)
  43. CFLAGS(
  44. -DLIBCXX_BUILDING_LIBCXXABI
  45. )
  46. # Yet take builtins library from Arcadia
  47. PEERDIR(
  48. contrib/libs/cxxsupp/builtins
  49. )
  50. ELSEIF (OS_LINUX OR OS_DARWIN)
  51. IF (ARCH_ARM7)
  52. # XXX: libcxxrt support for ARM is currently broken
  53. DEFAULT(CXX_RT "glibcxx_static")
  54. # ARM7 OS_SDK has old libstdc++ without aligned allocation support
  55. CFLAGS(
  56. GLOBAL -fno-aligned-new
  57. )
  58. ELSE()
  59. DEFAULT(CXX_RT "libcxxrt")
  60. ENDIF()
  61. IF (MUSL)
  62. PEERDIR(
  63. contrib/libs/musl/include
  64. )
  65. ENDIF()
  66. ELSEIF (OS_WINDOWS)
  67. SRCS(
  68. src/support/win32/locale_win32.cpp
  69. src/support/win32/support.cpp
  70. src/support/win32/atomic_win32.cpp
  71. src/support/win32/new_win32.cpp
  72. src/support/win32/thread_win32.cpp
  73. )
  74. CFLAGS(
  75. GLOBAL -D_LIBCPP_VASPRINTF_DEFINED
  76. GLOBAL -D_WCHAR_H_CPLUSPLUS_98_CONFORMANCE_
  77. )
  78. IF (CLANG_CL)
  79. PEERDIR(
  80. contrib/libs/cxxsupp/builtins
  81. )
  82. ENDIF()
  83. ELSEIF (OS_EMSCRIPTEN)
  84. DEFAULT(CXX_RT "libcxxabi")
  85. LDFLAGS(-Wl,-Bdynamic)
  86. CXXFLAGS(
  87. -Wno-unknown-pragmas
  88. -nostdinc++
  89. )
  90. PEERDIR(
  91. contrib/restricted/emscripten/include
  92. )
  93. ELSE()
  94. DEFAULT(CXX_RT "glibcxx_static")
  95. CXXFLAGS(
  96. -Wno-unknown-pragmas
  97. -nostdinc++
  98. )
  99. ENDIF()
  100. IF (OS_LINUX)
  101. EXTRALIBS(-lpthread)
  102. ENDIF()
  103. IF (CLANG)
  104. CXXFLAGS(GLOBAL -nostdinc++)
  105. ENDIF()
  106. # The CXX_RT variable controls which C++ runtime is used.
  107. # * libcxxrt - https://github.com/libcxxrt/libcxxrt library stored in Arcadia
  108. # * glibcxx_static - GNU C++ Library runtime with static linkage
  109. # * glibcxx_dynamic - GNU C++ Library runtime with dynamic linkage
  110. # * default - default C++ runtime provided by the compiler driver
  111. #
  112. # All glibcxx* runtimes are taken from system/compiler SDK
  113. DEFAULT(CXX_RT "default")
  114. DISABLE(NEED_GLIBCXX_CXX17_SHIMS)
  115. DISABLE(NEED_CXX_RT_ADDINCL)
  116. IF (CXX_RT == "libcxxrt")
  117. PEERDIR(
  118. contrib/libs/cxxsupp/libcxxabi-parts
  119. contrib/libs/cxxsupp/libcxxrt
  120. contrib/libs/cxxsupp/builtins
  121. )
  122. ADDINCL(
  123. GLOBAL contrib/libs/cxxsupp/libcxxrt/include
  124. )
  125. CFLAGS(
  126. GLOBAL -DLIBCXX_BUILDING_LIBCXXRT
  127. )
  128. # These builtins are equivalent to clang -rtlib=compiler_rt and
  129. # are needed by potentially any code generated by clang.
  130. # With glibcxx runtime, builtins are provided by libgcc
  131. ELSEIF (CXX_RT == "glibcxx_static")
  132. LDFLAGS(
  133. -Wl,-Bstatic
  134. -lsupc++
  135. -lgcc
  136. -lgcc_eh
  137. -Wl,-Bdynamic
  138. )
  139. CXXFLAGS(-D__GLIBCXX__=1)
  140. ENABLE(NEED_GLIBCXX_CXX17_SHIMS)
  141. ENABLE(NEED_CXX_RT_ADDINCL)
  142. CFLAGS(
  143. GLOBAL -DLIBCXX_BUILDING_LIBGCC
  144. )
  145. ELSEIF (CXX_RT == "glibcxx_dynamic")
  146. LDFLAGS(
  147. -lgcc_s
  148. -lstdc++
  149. )
  150. CXXFLAGS(-D__GLIBCXX__=1)
  151. CFLAGS(
  152. GLOBAL -DLIBCXX_BUILDING_LIBGCC
  153. )
  154. ENABLE(NEED_GLIBCXX_CXX17_SHIMS)
  155. ENABLE(NEED_CXX_RT_ADDINCL)
  156. ELSEIF (CXX_RT == "libcxxabi")
  157. PEERDIR(
  158. contrib/libs/cxxsupp/libcxxabi
  159. )
  160. ADDINCL(
  161. GLOBAL contrib/libs/cxxsupp/libcxxabi/include
  162. )
  163. CFLAGS(
  164. GLOBAL -DLIBCXX_BUILDING_LIBCXXABI
  165. )
  166. ELSEIF (CXX_RT == "default")
  167. # Do nothing
  168. ELSE()
  169. MESSAGE(FATAL_ERROR "Unexpected CXX_RT value: ${CXX_RT}")
  170. ENDIF()
  171. IF (NEED_GLIBCXX_CXX17_SHIMS)
  172. IF (GCC)
  173. # Assume GCC is bundled with a modern enough version of C++ runtime
  174. ELSEIF (OS_SDK == "ubuntu-12" OR OS_SDK == "ubuntu-14" OR OS_SDK == "ubuntu-16")
  175. # Prior to ubuntu-18, system C++ runtime for C++17 is incomplete
  176. # and requires std::uncaught_exceptions() to be implemented.
  177. SRCS(
  178. glibcxx_eh_cxx17.cpp
  179. )
  180. ENDIF()
  181. ENDIF()
  182. IF (NEED_CXX_RT_ADDINCL)
  183. # FIXME:
  184. # This looks extremely weird and we have to use cxxabi.h from libsupc++ instead.
  185. # This ADDINCL is placed here just to fix the status quo
  186. ADDINCL(
  187. GLOBAL contrib/libs/cxxsupp/libcxxrt/include
  188. )
  189. ENDIF()
  190. NO_UTIL()
  191. NO_RUNTIME()
  192. NO_COMPILER_WARNINGS()
  193. IF (FUZZING)
  194. NO_SANITIZE()
  195. NO_SANITIZE_COVERAGE()
  196. ENDIF()
  197. SRCS(
  198. src/algorithm.cpp
  199. src/any.cpp
  200. src/atomic.cpp
  201. src/barrier.cpp
  202. src/bind.cpp
  203. src/charconv.cpp
  204. src/chrono.cpp
  205. src/condition_variable.cpp
  206. src/condition_variable_destructor.cpp
  207. src/error_category.cpp
  208. src/exception.cpp
  209. src/filesystem/directory_entry.cpp
  210. src/filesystem/directory_iterator.cpp
  211. src/filesystem/filesystem_clock.cpp
  212. src/filesystem/filesystem_error.cpp
  213. src/filesystem/operations.cpp
  214. src/filesystem/path.cpp
  215. src/functional.cpp
  216. src/future.cpp
  217. src/hash.cpp
  218. src/ios.cpp
  219. src/ios.instantiations.cpp
  220. src/iostream.cpp
  221. src/legacy_pointer_safety.cpp
  222. src/locale.cpp
  223. src/memory.cpp
  224. src/memory_resource.cpp
  225. src/mutex.cpp
  226. src/mutex_destructor.cpp
  227. src/optional.cpp
  228. src/print.cpp
  229. src/random.cpp
  230. src/random_shuffle.cpp
  231. src/regex.cpp
  232. src/ryu/d2fixed.cpp
  233. src/ryu/d2s.cpp
  234. src/ryu/f2s.cpp
  235. src/shared_mutex.cpp
  236. src/stdexcept.cpp
  237. src/string.cpp
  238. src/strstream.cpp
  239. src/system_error.cpp
  240. src/thread.cpp
  241. src/typeinfo.cpp
  242. src/valarray.cpp
  243. src/variant.cpp
  244. src/vector.cpp
  245. src/verbose_abort.cpp
  246. )
  247. IF (NOT OS_WINDOWS)
  248. SRCS(
  249. src/new.cpp
  250. src/new_handler.cpp
  251. src/new_helpers.cpp
  252. )
  253. ENDIF()
  254. IF (OS_LINUX)
  255. SRCS(
  256. src/tz.cpp
  257. src/tzdb_list.cpp
  258. )
  259. ENDIF()
  260. END()