chromium/tools/gn/bootstrap/libc++.ninja

include toolchain.ninja

root = ../../../..
libcxx = third_party/libc++/src/src
libcxxabi = third_party/libc++abi/src/src

defines = -D__STDC_CONSTANT_MACROS -D__STDC_FORMAT_MACROS -D_FILE_OFFSET_BITS=64
includes = -isystem$root/buildtools/third_party/libc++ -isystem$root/$libcxx/../include -isystem$root/$libcxx -isystem$root/$libcxxabi/../include
cflags = $cxxflags $defines $includes -O2 -g0 -pthread -pipe -fno-exceptions -std=c++20 -Wno-c++11-narrowing -nostdinc++ -fPIC

rule cxx_libcxx
  command = $cxx $cflags -D_LIBCPP_NO_EXCEPTIONS -D_LIBCPP_BUILDING_LIBRARY -DLIBCXX_BUILDING_LIBCXXABI -c $in -o $out
  description = CXX $out

rule cxx_libcxxabi
  command = $cxx $cflags -D_LIBCXXABI_NO_EXCEPTIONS -D_LIBCPP_BUILDING_LIBRARY -DLIBCXXABI_SILENT_TERMINATE -c $in -o $out
  description = CXX $out

rule link
  command = $cxx -shared -fPIC -o $out -Wl,--start-group $in -Wl,--end-group
  description = LINK $out

build $libcxx/algorithm.o: cxx_libcxx $root/$libcxx/algorithm.cpp
build $libcxx/any.o: cxx_libcxx $root/$libcxx/any.cpp
build $libcxx/atomic.o: cxx_libcxx $root/$libcxx/atomic.cpp
build $libcxx/barrier.o: cxx_libcxx $root/$libcxx/barrier.cpp
build $libcxx/bind.o: cxx_libcxx $root/$libcxx/bind.cpp
build $libcxx/charconv.o: cxx_libcxx $root/$libcxx/charconv.cpp
build $libcxx/chrono.o: cxx_libcxx $root/$libcxx/chrono.cpp
build $libcxx/condition_variable.o: cxx_libcxx $root/$libcxx/condition_variable.cpp
build $libcxx/condition_variable_destructor.o: cxx_libcxx $root/$libcxx/condition_variable_destructor.cpp
build $libcxx/exception.o: cxx_libcxx $root/$libcxx/exception.cpp
build $libcxx/functional.o: cxx_libcxx $root/$libcxx/functional.cpp
build $libcxx/future.o: cxx_libcxx $root/$libcxx/future.cpp
build $libcxx/hash.o: cxx_libcxx $root/$libcxx/hash.cpp
build $libcxx/ios.o: cxx_libcxx $root/$libcxx/ios.cpp
build $libcxx/ios.instantiations.o: cxx_libcxx $root/$libcxx/ios.instantiations.cpp
build $libcxx/iostream.o: cxx_libcxx $root/$libcxx/iostream.cpp
build $libcxx/locale.o: cxx_libcxx $root/$libcxx/locale.cpp
build $libcxx/memory.o: cxx_libcxx $root/$libcxx/memory.cpp
build $libcxx/mutex.o: cxx_libcxx $root/$libcxx/mutex.cpp
build $libcxx/mutex_destructor.o: cxx_libcxx $root/$libcxx/mutex_destructor.cpp
build $libcxx/new.o: cxx_libcxx $root/$libcxx/new.cpp
build $libcxx/new_handler.o: cxx_libcxx $root/$libcxx/new_handler.cpp
build $libcxx/new_helpers.o: cxx_libcxx $root/$libcxx/new_helpers.cpp
build $libcxx/optional.o: cxx_libcxx $root/$libcxx/optional.cpp
build $libcxx/random.o: cxx_libcxx $root/$libcxx/random.cpp
build $libcxx/random_shuffle.o: cxx_libcxx $root/$libcxx/random_shuffle.cpp
build $libcxx/regex.o: cxx_libcxx $root/$libcxx/regex.cpp
build $libcxx/ryu/d2fixed.o: cxx_libcxx $root/$libcxx/ryu/d2fixed.cpp
build $libcxx/ryu/d2s.o: cxx_libcxx $root/$libcxx/ryu/d2s.cpp
build $libcxx/ryu/f2s.o: cxx_libcxx $root/$libcxx/ryu/f2s.cpp
build $libcxx/shared_mutex.o: cxx_libcxx $root/$libcxx/shared_mutex.cpp
build $libcxx/stdexcept.o: cxx_libcxx $root/$libcxx/stdexcept.cpp
build $libcxx/string.o: cxx_libcxx $root/$libcxx/string.cpp
build $libcxx/strstream.o: cxx_libcxx $root/$libcxx/strstream.cpp
build $libcxx/system_error.o: cxx_libcxx $root/$libcxx/system_error.cpp
build $libcxx/thread.o: cxx_libcxx $root/$libcxx/thread.cpp
build $libcxx/typeinfo.o: cxx_libcxx $root/$libcxx/typeinfo.cpp
build $libcxx/valarray.o: cxx_libcxx $root/$libcxx/valarray.cpp
build $libcxx/variant.o: cxx_libcxx $root/$libcxx/variant.cpp
build $libcxx/vector.o: cxx_libcxx $root/$libcxx/vector.cpp
build $libcxx/verbose_abort.o: cxx_libcxx $root/$libcxx/verbose_abort.cpp

build $libcxxabi/abort_message.o: cxx_libcxxabi $root/$libcxxabi/abort_message.cpp
build $libcxxabi/cxa_aux_runtime.o: cxx_libcxxabi $root/$libcxxabi/cxa_aux_runtime.cpp
build $libcxxabi/cxa_default_handlers.o: cxx_libcxxabi $root/$libcxxabi/cxa_default_handlers.cpp
build $libcxxabi/cxa_demangle.o: cxx_libcxxabi $root/$libcxxabi/cxa_demangle.cpp
build $libcxxabi/cxa_exception_storage.o: cxx_libcxxabi $root/$libcxxabi/cxa_exception_storage.cpp
build $libcxxabi/cxa_guard.o: cxx_libcxxabi $root/$libcxxabi/cxa_guard.cpp
build $libcxxabi/cxa_handlers.o: cxx_libcxxabi $root/$libcxxabi/cxa_handlers.cpp
build $libcxxabi/cxa_noexception.o: cxx_libcxxabi $root/$libcxxabi/cxa_noexception.cpp
build $libcxxabi/cxa_thread_atexit.o: cxx_libcxxabi $root/$libcxxabi/cxa_thread_atexit.cpp
build $libcxxabi/cxa_vector.o: cxx_libcxxabi $root/$libcxxabi/cxa_vector.cpp
build $libcxxabi/cxa_virtual.o: cxx_libcxxabi $root/$libcxxabi/cxa_virtual.cpp
build $libcxxabi/fallback_malloc.o: cxx_libcxxabi $root/$libcxxabi/fallback_malloc.cpp
build $libcxxabi/private_typeinfo.o: cxx_libcxxabi $root/$libcxxabi/private_typeinfo.cpp
build $libcxxabi/stdlib_exception.o: cxx_libcxxabi $root/$libcxxabi/stdlib_exception.cpp
build $libcxxabi/stdlib_stdexcept.o: cxx_libcxxabi $root/$libcxxabi/stdlib_stdexcept.cpp
build $libcxxabi/stdlib_typeinfo.o: cxx_libcxxabi $root/$libcxxabi/stdlib_typeinfo.cpp

build ../libc++.gn.so: link $libcxx/algorithm.o $libcxx/any.o $libcxx/atomic.o $libcxx/barrier.o $libcxx/bind.o $libcxx/charconv.o $libcxx/chrono.o $libcxx/condition_variable.o $libcxx/condition_variable_destructor.o $libcxx/exception.o $libcxx/functional.o $libcxx/future.o $libcxx/hash.o $libcxx/ios.o $libcxx/ios.instantiations.o $libcxx/iostream.o $libcxx/locale.o $libcxx/memory.o $libcxx/mutex.o $libcxx/mutex_destructor.o $libcxx/new.o $libcxx/new_handler.o $libcxx/new_helpers.o $libcxx/optional.o $libcxx/random.o $libcxx/random_shuffle.o $libcxx/regex.o $libcxx/ryu/d2fixed.o $libcxx/ryu/d2s.o $libcxx/ryu/f2s.o $libcxx/shared_mutex.o $libcxx/stdexcept.o $libcxx/string.o $libcxx/strstream.o $libcxx/system_error.o $libcxx/thread.o $libcxx/typeinfo.o $libcxx/valarray.o $libcxx/variant.o $libcxx/vector.o $libcxx/verbose_abort.o $libcxxabi/abort_message.o $libcxxabi/cxa_aux_runtime.o $libcxxabi/cxa_default_handlers.o $libcxxabi/cxa_demangle.o $libcxxabi/cxa_exception_storage.o $libcxxabi/cxa_guard.o $libcxxabi/cxa_handlers.o $libcxxabi/cxa_noexception.o $libcxxabi/cxa_thread_atexit.o $libcxxabi/cxa_vector.o $libcxxabi/cxa_virtual.o $libcxxabi/fallback_malloc.o $libcxxabi/private_typeinfo.o $libcxxabi/stdlib_exception.o $libcxxabi/stdlib_stdexcept.o $libcxxabi/stdlib_typeinfo.o