123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285 |
- # Generated by devtools/yamaker/ym2
- LIBRARY()
- LICENSE(
- Apache-2.0 AND
- Apache-2.0 WITH LLVM-exception AND
- BSL-1.0 AND
- MIT AND
- NCSA AND
- Public-Domain AND
- Unicode
- )
- LICENSE_TEXTS(.yandex_meta/licenses.list.txt)
- VERSION(2023-10-05)
- ORIGINAL_SOURCE(https://github.com/llvm/llvm-project/archive/dc129d6f715cf83a2072fc8de8b4e4c70bca6935.tar.gz)
- ADDINCL(
- GLOBAL contrib/libs/cxxsupp/libcxx/include
- contrib/libs/cxxsupp/libcxx/src
- )
- CXXFLAGS(-D_LIBCPP_BUILDING_LIBRARY)
- IF (OS_ANDROID)
- DEFAULT(CXX_RT "default")
- IF (ARCH_I686 OR ARCH_ARM7)
- # 32-bit architectures require additional libandroid_support.so to be linked
- # We add --start-group / --end-group statements due to the issue in NDK < r22.
- # See: https://github.com/android/ndk/issues/1130
- #
- # Though these statements are not respected by LLD, they might have sense for other linkers.
- LDFLAGS(
- -Wl,--start-group
- -lc++abi
- -landroid_support
- -Wl,--end-group
- )
- ELSE()
- LDFLAGS(-lc++abi)
- ENDIF()
- CFLAGS(
- -DLIBCXX_BUILDING_LIBCXXABI
- )
- # Take cxxabi implementation from system.
- ELSEIF (OS_IOS)
- LDFLAGS(-lc++abi)
- CFLAGS(
- -DLIBCXX_BUILDING_LIBCXXABI
- )
- # Yet take builtins library from Arcadia
- PEERDIR(
- contrib/libs/cxxsupp/builtins
- )
- ELSEIF (OS_LINUX OR OS_DARWIN)
- IF (ARCH_ARM7)
- # XXX: libcxxrt support for ARM is currently broken
- DEFAULT(CXX_RT "glibcxx_static")
- # ARM7 OS_SDK has old libstdc++ without aligned allocation support
- CFLAGS(
- GLOBAL -fno-aligned-new
- )
- ELSE()
- DEFAULT(CXX_RT "libcxxrt")
- ENDIF()
- IF (MUSL)
- PEERDIR(
- contrib/libs/musl/include
- )
- ENDIF()
- ELSEIF (OS_WINDOWS)
- SRCS(
- src/support/win32/locale_win32.cpp
- src/support/win32/support.cpp
- src/support/win32/atomic_win32.cpp
- src/support/win32/new_win32.cpp
- src/support/win32/thread_win32.cpp
- )
- CFLAGS(
- GLOBAL -D_LIBCPP_VASPRINTF_DEFINED
- GLOBAL -D_WCHAR_H_CPLUSPLUS_98_CONFORMANCE_
- )
- IF (CLANG_CL)
- PEERDIR(
- contrib/libs/cxxsupp/builtins
- )
- ENDIF()
- ELSEIF (OS_EMSCRIPTEN)
- DEFAULT(CXX_RT "libcxxabi")
- LDFLAGS(-Wl,-Bdynamic)
- CXXFLAGS(
- -Wno-unknown-pragmas
- -nostdinc++
- )
- PEERDIR(
- contrib/restricted/emscripten/include
- )
- ELSE()
- DEFAULT(CXX_RT "glibcxx_static")
- CXXFLAGS(
- -Wno-unknown-pragmas
- -nostdinc++
- )
- ENDIF()
- IF (OS_LINUX)
- EXTRALIBS(-lpthread)
- ENDIF()
- IF (CLANG)
- CXXFLAGS(GLOBAL -nostdinc++)
- ENDIF()
- # The CXX_RT variable controls which C++ runtime is used.
- # * libcxxrt - https://github.com/libcxxrt/libcxxrt library stored in Arcadia
- # * glibcxx_static - GNU C++ Library runtime with static linkage
- # * glibcxx_dynamic - GNU C++ Library runtime with dynamic linkage
- # * default - default C++ runtime provided by the compiler driver
- #
- # All glibcxx* runtimes are taken from system/compiler SDK
- DEFAULT(CXX_RT "default")
- DISABLE(NEED_GLIBCXX_CXX17_SHIMS)
- DISABLE(NEED_CXX_RT_ADDINCL)
- IF (CXX_RT == "libcxxrt")
- PEERDIR(
- contrib/libs/cxxsupp/libcxxabi-parts
- contrib/libs/cxxsupp/libcxxrt
- contrib/libs/cxxsupp/builtins
- )
- ADDINCL(
- GLOBAL contrib/libs/cxxsupp/libcxxrt/include
- )
- CFLAGS(
- GLOBAL -DLIBCXX_BUILDING_LIBCXXRT
- )
- # These builtins are equivalent to clang -rtlib=compiler_rt and
- # are needed by potentially any code generated by clang.
- # With glibcxx runtime, builtins are provided by libgcc
- ELSEIF (CXX_RT == "glibcxx_static")
- LDFLAGS(
- -Wl,-Bstatic
- -lsupc++
- -lgcc
- -lgcc_eh
- -Wl,-Bdynamic
- )
- CXXFLAGS(-D__GLIBCXX__=1)
- ENABLE(NEED_GLIBCXX_CXX17_SHIMS)
- ENABLE(NEED_CXX_RT_ADDINCL)
- CFLAGS(
- GLOBAL -DLIBCXX_BUILDING_LIBGCC
- )
- ELSEIF (CXX_RT == "glibcxx_dynamic")
- LDFLAGS(
- -lgcc_s
- -lstdc++
- )
- CXXFLAGS(-D__GLIBCXX__=1)
- CFLAGS(
- GLOBAL -DLIBCXX_BUILDING_LIBGCC
- )
- ENABLE(NEED_GLIBCXX_CXX17_SHIMS)
- ENABLE(NEED_CXX_RT_ADDINCL)
- ELSEIF (CXX_RT == "libcxxabi")
- PEERDIR(
- contrib/libs/cxxsupp/libcxxabi
- )
- ADDINCL(
- GLOBAL contrib/libs/cxxsupp/libcxxabi/include
- )
- CFLAGS(
- GLOBAL -DLIBCXX_BUILDING_LIBCXXABI
- )
- ELSEIF (CXX_RT == "default")
- # Do nothing
- ELSE()
- MESSAGE(FATAL_ERROR "Unexpected CXX_RT value: ${CXX_RT}")
- ENDIF()
- IF (NEED_GLIBCXX_CXX17_SHIMS)
- IF (GCC)
- # Assume GCC is bundled with a modern enough version of C++ runtime
- ELSEIF (OS_SDK == "ubuntu-12" OR OS_SDK == "ubuntu-14" OR OS_SDK == "ubuntu-16")
- # Prior to ubuntu-18, system C++ runtime for C++17 is incomplete
- # and requires std::uncaught_exceptions() to be implemented.
- SRCS(
- glibcxx_eh_cxx17.cpp
- )
- ENDIF()
- ENDIF()
- IF (NEED_CXX_RT_ADDINCL)
- # FIXME:
- # This looks extremely weird and we have to use cxxabi.h from libsupc++ instead.
- # This ADDINCL is placed here just to fix the status quo
- ADDINCL(
- GLOBAL contrib/libs/cxxsupp/libcxxrt/include
- )
- ENDIF()
- NO_UTIL()
- NO_RUNTIME()
- NO_COMPILER_WARNINGS()
- IF (FUZZING)
- NO_SANITIZE()
- NO_SANITIZE_COVERAGE()
- ENDIF()
- SRCS(
- src/algorithm.cpp
- src/any.cpp
- src/atomic.cpp
- src/barrier.cpp
- src/bind.cpp
- src/charconv.cpp
- src/chrono.cpp
- src/condition_variable.cpp
- src/condition_variable_destructor.cpp
- src/error_category.cpp
- src/exception.cpp
- src/filesystem/directory_entry.cpp
- src/filesystem/directory_iterator.cpp
- src/filesystem/filesystem_clock.cpp
- src/filesystem/filesystem_error.cpp
- src/filesystem/operations.cpp
- src/filesystem/path.cpp
- src/functional.cpp
- src/future.cpp
- src/hash.cpp
- src/ios.cpp
- src/ios.instantiations.cpp
- src/iostream.cpp
- src/legacy_pointer_safety.cpp
- src/locale.cpp
- src/memory.cpp
- src/memory_resource.cpp
- src/mutex.cpp
- src/mutex_destructor.cpp
- src/optional.cpp
- src/print.cpp
- src/random.cpp
- src/random_shuffle.cpp
- src/regex.cpp
- src/ryu/d2fixed.cpp
- src/ryu/d2s.cpp
- src/ryu/f2s.cpp
- src/shared_mutex.cpp
- src/stdexcept.cpp
- src/string.cpp
- src/strstream.cpp
- src/system_error.cpp
- src/thread.cpp
- src/typeinfo.cpp
- src/valarray.cpp
- src/variant.cpp
- src/vector.cpp
- src/verbose_abort.cpp
- )
- IF (NOT OS_WINDOWS)
- SRCS(
- src/new.cpp
- src/new_handler.cpp
- src/new_helpers.cpp
- )
- ENDIF()
- IF (OS_LINUX)
- SRCS(
- src/tz.cpp
- src/tzdb_list.cpp
- )
- ENDIF()
- END()
|