import("//libcxx/config.gni") import("//llvm/utils/gn/build/write_cmake_config.gni") write_cmake_config("write_config") { input = "__config_site.in" output = "$target_gen_dir/__config_site" values = [ "_LIBCPP_ABI_FORCE_ITANIUM=", "_LIBCPP_ABI_FORCE_MICROSOFT=", "_LIBCPP_HIDE_FROM_ABI_PER_TU_BY_DEFAULT=", "_LIBCPP_HAS_NO_FILESYSTEM_LIBRARY=", "_LIBCPP_HAS_NO_GLOBAL_FILESYSTEM_NAMESPACE=", "_LIBCPP_HAS_NO_STDIN=", "_LIBCPP_HAS_NO_STDOUT=", "_LIBCPP_HAS_NO_THREADS=", "_LIBCPP_HAS_NO_MONOTONIC_CLOCK=", "_LIBCPP_HAS_NO_THREAD_UNSAFE_C_FUNCTIONS=", "_LIBCPP_HAS_MUSL_LIBC=", "_LIBCPP_HAS_THREAD_API_PTHREAD=", "_LIBCPP_HAS_THREAD_API_EXTERNAL=", "_LIBCPP_HAS_THREAD_API_WIN32=", "_LIBCPP_HAS_THREAD_LIBRARY_EXTERNAL=", "_LIBCPP_DISABLE_VISIBILITY_ANNOTATIONS=", "_LIBCPP_HAS_NO_VENDOR_AVAILABILITY_ANNOTATIONS=1", "_LIBCPP_NO_VCRUNTIME=", "_LIBCPP_TYPEINFO_COMPARISON_IMPLEMENTATION=", "_LIBCPP_HAS_PARALLEL_ALGORITHMS=", "_LIBCPP_HAS_NO_RANDOM_DEVICE=", "_LIBCPP_HAS_NO_LOCALIZATION=", "_LIBCPP_ABI_DEFINES=", ] if (libcxx_abi_version != 1) { values += [ "_LIBCPP_ABI_VERSION=$libcxx_abi_version" ] } else { values += [ "_LIBCPP_ABI_VERSION=" ] } if (libcxx_abi_namespace != "") { values += [ "_LIBCPP_ABI_NAMESPACE=$libcxx_abi_namespace" ] } else { values += [ "_LIBCPP_ABI_NAMESPACE=" ] } if (libcxx_abi_unstable) { values += [ "_LIBCPP_ABI_UNSTABLE=1" ] } else { values += [ "_LIBCPP_ABI_UNSTABLE=" ] } } # Generate a custom __config header. The new header is created # by prepending __config_site to the current __config header. action("concat_config") { script = "//libcxx/utils/cat_files.py" inputs = [ "$target_gen_dir/__config_site", "__config", ] outputs = [ "$root_build_dir/include/c++/v1/__config" ] args = [ rebase_path("$target_gen_dir/__config_site", root_build_dir), rebase_path("__config", root_build_dir), "-o", rebase_path(outputs[0], root_build_dir) ] deps = [ ":write_config" ] } copy("include") { sources = [ "__availability", "__bit_reference", "__bsd_locale_defaults.h", "__bsd_locale_fallbacks.h", "__debug", "__errc", "__functional_03", "__functional_base", "__functional_base_03", "__hash_table", "__libcpp_version", "__locale", "__memory/allocator_traits.h", "__memory/base.h", "__memory/pointer_traits.h", "__memory/utilities.h", "__mutex_base", "__node_handle", "__nullptr", "__split_buffer", "__sso_allocator", "__std_stream", "__string", "__threading_support", "__tree", "__tuple", "__undef_macros", "algorithm", "any", "array", "atomic", "barrier", "bit", "bitset", "cassert", "ccomplex", "cctype", "cerrno", "cfenv", "cfloat", "charconv", "chrono", "cinttypes", "ciso646", "climits", "clocale", "cmath", "codecvt", "compare", "complex", "complex.h", "concepts", "condition_variable", "csetjmp", "csignal", "cstdarg", "cstdbool", "cstddef", "cstdint", "cstdio", "cstdlib", "cstring", "ctgmath", "ctime", "ctype.h", "cwchar", "cwctype", "deque", "errno.h", "exception", "execution", "experimental/__config", "experimental/__memory", "experimental/algorithm", "experimental/coroutine", "experimental/deque", "experimental/filesystem", "experimental/forward_list", "experimental/functional", "experimental/iterator", "experimental/list", "experimental/map", "experimental/memory_resource", "experimental/propagate_const", "experimental/regex", "experimental/set", "experimental/simd", "experimental/string", "experimental/type_traits", "experimental/unordered_map", "experimental/unordered_set", "experimental/utility", "experimental/vector", "ext/__hash", "ext/hash_map", "ext/hash_set", "fenv.h", "filesystem", "float.h", "forward_list", "fstream", "functional", "future", "initializer_list", "inttypes.h", "iomanip", "ios", "iosfwd", "iostream", "istream", "iterator", "latch", "limits", "limits.h", "list", "locale", "locale.h", "map", "math.h", "memory", "module.modulemap", "mutex", "new", "numbers", "numeric", "optional", "ostream", "queue", "random", "ratio", "regex", "scoped_allocator", "semaphore", "set", "setjmp.h", "shared_mutex", "span", "sstream", "stack", "stdbool.h", "stddef.h", "stdexcept", "stdint.h", "stdio.h", "stdlib.h", "streambuf", "string", "string.h", "string_view", "strstream", "__support/android/locale_bionic.h", "__support/fuchsia/xlocale.h", "__support/ibm/limits.h", "__support/ibm/locale_mgmt_aix.h", "__support/ibm/nanosleep.h", "__support/ibm/support.h", "__support/ibm/xlocale.h", "__support/musl/xlocale.h", "__support/newlib/xlocale.h", "__support/nuttx/xlocale.h", "__support/openbsd/xlocale.h", "__support/solaris/floatingpoint.h", "__support/solaris/wchar.h", "__support/solaris/xlocale.h", "__support/win32/limits_msvc_win32.h", "__support/win32/locale_win32.h", "__support/xlocale/__nop_locale_mgmt.h", "__support/xlocale/__posix_l_fallback.h", "__support/xlocale/__strtonum_fallback.h", "system_error", "tgmath.h", "thread", "tuple", "type_traits", "typeindex", "typeinfo", "unordered_map", "unordered_set", "utility", "valarray", "variant", "vector", "version", "wchar.h", "wctype.h", ] deps = [ ":concat_config" ] if (target_os != "mac" && target_os != "win") { # libcxx/cmake/Modules/HandleLibCXXABI.cmake sets # LIBCXX_CXX_ABI_HEADER_TARGET if the libcxx abi library either of # "libstdc++", "libsupc++", "libcxxabi", "libcxxrt", but not if it's "none", # "default", or "vcruntime". So on Windows, these don't get copied due to # LIBCXX_CXX_ABI_HEADER_TARGET not being set. # On macOS, libcxx/CMakeLists.txt sets LIBCXX_CXX_ABI_SYSTEM to 1, which # causes an empty header list to be passed to setup_abi_lib, so these # don't get copied on macOS due to that. deps += [ "//libcxxabi/include" ] } outputs = [ "$root_build_dir/include/c++/v1/{{source_target_relative}}" ] }