aboutsummaryrefslogtreecommitdiff
path: root/build2/buildfile
diff options
context:
space:
mode:
authorBoris Kolpackov <boris@codesynthesis.com>2018-09-03 10:18:23 +0200
committerBoris Kolpackov <boris@codesynthesis.com>2018-09-03 10:18:23 +0200
commitcafa730ce5e1b13135ccbdc0befa58d693302999 (patch)
treed6d63760881b6813a3dee9434cdc1b1c42ae4d92 /build2/buildfile
parent1bf439f7918f2c6f8fa07db3abb53722156945c7 (diff)
Use (native) C and C++ compilers we were built with as defaults
Diffstat (limited to 'build2/buildfile')
-rw-r--r--build2/buildfile12
1 files changed, 12 insertions, 0 deletions
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