From 4f9bbfea623deae9c8b57cfdb0ca79cc81d54703 Mon Sep 17 00:00:00 2001 From: Jan Engelhardt Date: Thu, 20 Apr 2017 17:03:14 +0200 Subject: [PATCH] build: select default toolchain (Patch used from openSUSE.) Starting with this commit, you will need to use: export CC=gcc CXX=g++ (or clang equivalents) (Otherwise, `gn bootstrap` and `ninja` will fail with spurious errors such as:) -MD: no such file or directory If anyone knows whether gn can do = getenv("CC") || "gcc" that would be magnificient. --- toolchain/BUILD.gn | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) create mode 100644 toolchain/BUILD.gn diff --git a/toolchain/BUILD.gn b/toolchain/BUILD.gn new file mode 100644 index 0000000000000..052c0b3f305a9 --- /dev/null +++ b/toolchain/BUILD.gn @@ -0,0 +1,19 @@ +import("//build/toolchain/gcc_toolchain.gni") + +gcc_toolchain("default") { + cc = getenv("CC") + cxx = getenv("CXX") + ar = "ar" + nm = "nm" + ld = cxx + + extra_cflags = getenv("CFLAGS") + extra_cppflags = getenv("CPPFLAGS") + extra_cxxflags = getenv("CXXFLAGS") + extra_ldflags = getenv("LDFLAGS") + + toolchain_args = { + current_cpu = current_cpu + current_os = current_os + } +}