aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBoris Kolpackov <boris@codesynthesis.com>2018-07-09 09:52:38 +0200
committerBoris Kolpackov <boris@codesynthesis.com>2018-07-09 09:52:38 +0200
commite66fbe664f6430c1090c71cf52588070080ff39a (patch)
tree5cbf95e054cf7d20f01f5e27137ca61a98c64f75
parent77ae36775de62a858327a65e7d2b63e143551d17 (diff)
Adjust ODB compilation script for bdep-based setup
-rwxr-xr-xbpkg/odb.sh39
1 files changed, 33 insertions, 6 deletions
diff --git a/bpkg/odb.sh b/bpkg/odb.sh
index 0149930..913ca6e 100755
--- a/bpkg/odb.sh
+++ b/bpkg/odb.sh
@@ -3,13 +3,40 @@
trap 'exit 1' ERR
odb=odb
-lib="\
--I$HOME/work/odb/builds/default/libodb-sqlite-default \
--I$HOME/work/odb/libodb-sqlite \
--I$HOME/work/odb/builds/default/libodb-default \
--I$HOME/work/odb/libodb"
+inc=()
-$odb $lib -I.. -I../../libbpkg -I../../libbutl \
+if test -d ../.bdep; then
+
+ # Use default configuration for headers.
+ #
+ cfg="$(bdep config list -d .. | \
+sed -r -ne 's#^(@[^ ]+ )?([^ ]+)/ .*default.*$#\2#p')"
+
+ inc+=("-I$(echo "$cfg"/libodb-[1-9]*/)")
+ inc+=("-I$(echo "$cfg"/libodb-sqlite-[1-9]*/)")
+
+ inc+=("-I$cfg/libbutl")
+ inc+=("-I../../libbutl")
+
+ inc+=("-I$cfg/libbpkg")
+ inc+=("-I../../libbpkg")
+
+ inc+=("-I$cfg/bpkg")
+ inc+=("-I..")
+
+else
+
+ inc+=("-I$HOME/work/odb/builds/default/libodb-sqlite-default")
+ inc+=("-I$HOME/work/odb/libodb-sqlite")
+
+ inc+=("-I$HOME/work/odb/builds/default/libodb-default")
+ inc+=("-I$HOME/work/odb/libodb")
+
+ inc+=(-I.. -I../../libbpkg -I../../libbutl)
+
+fi
+
+$odb "${inc[@]}" \
-DLIBODB_BUILD2 -DLIBODB_SQLITE_BUILD2 --generate-schema \
-d sqlite --std c++14 --generate-query \
--odb-epilogue '#include <bpkg/wrapper-traits.hxx>' \