From cafa730ce5e1b13135ccbdc0befa58d693302999 Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Mon, 3 Sep 2018 10:18:23 +0200 Subject: Use (native) C and C++ compilers we were built with as defaults --- build2/buildfile | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'build2/buildfile') diff --git a/build2/buildfile b/build2/buildfile index 396fcf4..1e3b447 100644 --- a/build2/buildfile +++ b/build2/buildfile @@ -17,6 +17,18 @@ hxx{version}: in{version} $src_root/manifest # obj{b context}: cxx.poptions += -DBUILD2_HOST_TRIPLET=\"$cxx.target\" +# Pass native C and C++ compiler paths (not forgetting to escape backslashes +# on Windows). These are used as defaults for BUILD2_DEFAULT_*. +# +if ($cxx.target == $build.host) +{ + c/obj{init}: cxx.poptions += \ + -DBUILD2_NATIVE_C=\"$regex.replace($recall($c.path), '\\', '\\\\')\" + + cxx/obj{init}: cxx.poptions += \ + -DBUILD2_NATIVE_CXX=\"$regex.replace($recall($cxx.path), '\\', '\\\\')\" +} + if ($cxx.target.class != "windows") cxx.libs += -lpthread else -- cgit v1.1