summaryrefslogtreecommitdiff
path: root/odb/buildfile
diff options
context:
space:
mode:
authorBoris Kolpackov <boris@codesynthesis.com>2023-09-06 12:47:59 +0200
committerBoris Kolpackov <boris@codesynthesis.com>2023-09-06 12:47:59 +0200
commit60e054bbac499cf9258df04ca0f8cc25e6981839 (patch)
treee61bdb695bd96796803f108590d632f05b1934bc /odb/buildfile
parent29dc3d1ce69a88719b258288d6b14ecd22dc01aa (diff)
Make GCC plugin directory, g++ executable name customizable
Specifically, there are now two new optional configuration variables: config [dir_path] config.odb.plugin_dir ?= [null] config [string] config.odb.gxx_name ?= [null]
Diffstat (limited to 'odb/buildfile')
-rw-r--r--odb/buildfile21
1 files changed, 4 insertions, 17 deletions
diff --git a/odb/buildfile b/odb/buildfile
index 20f8718..34a6329 100644
--- a/odb/buildfile
+++ b/odb/buildfile
@@ -32,22 +32,6 @@ if ($cxx.target.class != 'windows')
#
plugin{*}: install = bin/
-# Unless cross-compiling, pass the C++ compiler's recall path as the g++
-# name. At some point we should also make it configurable.
-#
-# Note that we used to compare complete target triplets but that prooved too
-# strict. For example, we may be running on x86_64-apple-darwin17.7.0 while
-# the compiler is targeting x86_64-apple-darwin17.3.0.
-#
-if ($cxx.target.cpu == $build.host.cpu && \
- $cxx.target.system == $build.host.system)
-{
- gxx_name = $recall($cxx.path)
- gxx_name = $regex.replace($gxx_name, '\\', '\\\\') # Escape back slashes.
-}
-else
- gxx_name = g++
-
import libs = libcutl%lib{cutl}
import libs += libstudxml%lib{studxml}
@@ -98,7 +82,10 @@ libus{odb}: {hxx ixx txx cxx}{** -odb -options -pregenerated/**} $libs
# Build options.
#
-cxx.poptions += "-I$plugin_dir/include" "-DODB_GXX_NAME=\"$gxx_name\""
+# Note: escape backslashes in gxx_name.
+#
+cxx.poptions += "-I$plugin_dir/include"
+cxx.poptions += "-DODB_GXX_NAME=\"$regex.replace($gxx_name, '\\', '\\\\')\""
cxx.poptions += -DODB_BUILD2 # @@ TMP while supporting other build systems.
## Consumption build ($develop == false).