aboutsummaryrefslogtreecommitdiff
path: root/libbrep/odb.sh
blob: 17a6ac49cc0a343605fd5287aa134de0c0666bb4 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
#! /usr/bin/env bash

trap 'exit 1' ERR

odb=odb
lib="\
-I$HOME/work/odb/builds/default/libodb-pgsql-default \
-I$HOME/work/odb/libodb-pgsql \
-I$HOME/work/odb/builds/default/libodb-default \
-I$HOME/work/odb/libodb"

$odb $lib -d pgsql --std c++14 --generate-query              \
    --odb-epilogue '#include <libbrep/wrapper-traits.hxx>'   \
    --hxx-prologue '#include <libbrep/wrapper-traits.hxx>'   \
    -DLIBODB_BUILD2 -DLIBODB_PGSQL_BUILD2                    \
    -I .. -I ../../libbbot -I ../../libbpkg -I ../../libbutl \
    --include-with-brackets --include-prefix libbrep         \
    --guard-prefix LIBBREP \
    common.hxx

$odb $lib -d pgsql --std c++14 --generate-query --generate-schema      \
    --schema-format sql --schema-format embedded --schema-name package \
    --odb-epilogue '#include <libbrep/wrapper-traits.hxx>'             \
    --hxx-prologue '#include <libbrep/package-traits.hxx>'             \
    --generate-prepared -DLIBODB_BUILD2 -DLIBODB_PGSQL_BUILD2          \
    -I .. -I ../../libbbot -I ../../libbpkg -I ../../libbutl           \
    --include-with-brackets --include-prefix libbrep                   \
    --guard-prefix LIBBREP                                             \
    package.hxx

xxd -i <package-extra.sql >package-extra.hxx

$odb $lib -d pgsql --std c++14 --generate-query --generate-schema    \
    --schema-format sql --schema-format embedded --schema-name build \
    --odb-epilogue '#include <libbrep/wrapper-traits.hxx>'           \
    --generate-prepared -DLIBODB_BUILD2 -DLIBODB_PGSQL_BUILD2        \
    -I .. -I ../../libbbot -I ../../libbpkg -I ../../libbutl         \
    --include-with-brackets --include-prefix libbrep                 \
    --guard-prefix LIBBREP \
    build.hxx

$odb $lib -d pgsql --std c++14 --generate-query               \
    --odb-epilogue '#include <libbrep/wrapper-traits.hxx>'    \
    --generate-prepared -DLIBODB_BUILD2 -DLIBODB_PGSQL_BUILD2 \
    -I .. -I ../../libbbot -I ../../libbpkg -I ../../libbutl  \
    --include-with-brackets --include-prefix libbrep          \
    --guard-prefix LIBBREP                                    \
    build-package.hxx

xxd -i <build-extra.sql >build-extra.hxx