diff --git a/llvm/utils/gn/build/BUILD.gn b/llvm/utils/gn/build/BUILD.gn --- a/llvm/utils/gn/build/BUILD.gn +++ b/llvm/utils/gn/build/BUILD.gn @@ -237,6 +237,12 @@ } } +config("libcxx_source") { + cflags = [ "-nostdinc++" ] + include_dirs = [ "$root_build_dir/include/c++/v1/" ] +#deps += [ "//libcxx:libcxx2" ] +} + config("no_exceptions") { if (host_os != "win") { cflags_cc = [ "-fno-exceptions" ] diff --git a/llvm/utils/gn/build/BUILDCONFIG.gn b/llvm/utils/gn/build/BUILDCONFIG.gn --- a/llvm/utils/gn/build/BUILDCONFIG.gn +++ b/llvm/utils/gn/build/BUILDCONFIG.gn @@ -4,6 +4,7 @@ # add the flags to compiler_defaults, not to a new config. shared_binary_target_configs = [ "//llvm/utils/gn/build:compiler_defaults", + "//llvm/utils/gn/build:libcxx_source", "//llvm/utils/gn/build:llvm_code", "//llvm/utils/gn/build:no_exceptions", "//llvm/utils/gn/build:no_rtti", diff --git a/llvm/utils/gn/secondary/libcxx/BUILD.gn b/llvm/utils/gn/secondary/libcxx/BUILD.gn --- a/llvm/utils/gn/secondary/libcxx/BUILD.gn +++ b/llvm/utils/gn/secondary/libcxx/BUILD.gn @@ -4,3 +4,10 @@ "src(//llvm/utils/gn/build/toolchain:stage2_unix)", ] } + +group("libcxx2") { + deps = [ + "include", + "src", + ] +} diff --git a/llvm/utils/gn/secondary/libcxx/src/BUILD.gn b/llvm/utils/gn/secondary/libcxx/src/BUILD.gn --- a/llvm/utils/gn/secondary/libcxx/src/BUILD.gn +++ b/llvm/utils/gn/secondary/libcxx/src/BUILD.gn @@ -203,6 +203,7 @@ ] configs += [ ":cxx_config" ] configs -= [ + "//llvm/utils/gn/build:libcxx_source", "//llvm/utils/gn/build:no_exceptions", "//llvm/utils/gn/build:no_rtti", ] @@ -252,6 +253,7 @@ ] configs += [ ":cxx_config" ] configs -= [ + "//llvm/utils/gn/build:libcxx_source", "//llvm/utils/gn/build:no_exceptions", "//llvm/utils/gn/build:no_rtti", ] @@ -265,6 +267,7 @@ sources = [ "experimental/memory_resource.cpp" ] configs += [ ":cxx_config" ] configs -= [ + "//llvm/utils/gn/build:libcxx_source", "//llvm/utils/gn/build:no_exceptions", "//llvm/utils/gn/build:no_rtti", ] diff --git a/llvm/utils/gn/secondary/libcxxabi/src/BUILD.gn b/llvm/utils/gn/secondary/libcxxabi/src/BUILD.gn --- a/llvm/utils/gn/secondary/libcxxabi/src/BUILD.gn +++ b/llvm/utils/gn/secondary/libcxxabi/src/BUILD.gn @@ -90,6 +90,7 @@ ] configs += [ ":cxxabi_config" ] configs -= [ + "//llvm/utils/gn/build:libcxx_source", "//llvm/utils/gn/build:no_exceptions", "//llvm/utils/gn/build:no_rtti", ] @@ -120,6 +121,7 @@ ] configs += [ ":cxxabi_config" ] configs -= [ + "//llvm/utils/gn/build:libcxx_source", "//llvm/utils/gn/build:no_exceptions", "//llvm/utils/gn/build:no_rtti", ] diff --git a/llvm/utils/gn/secondary/llvm/lib/Support/BUILD.gn b/llvm/utils/gn/secondary/llvm/lib/Support/BUILD.gn --- a/llvm/utils/gn/secondary/llvm/lib/Support/BUILD.gn +++ b/llvm/utils/gn/secondary/llvm/lib/Support/BUILD.gn @@ -6,6 +6,7 @@ "//llvm/utils/gn/build/libs/pthread", "//llvm/utils/gn/build/libs/terminfo", "//llvm/utils/gn/build/libs/zlib", + "//libcxx:libcxx2", ] # public_deps are used for depending on targets that generate headers