aboutsummaryrefslogtreecommitdiff
path: root/bdep/buildfile
blob: 2b8bcf11794524a941be6b7bc4723893bd75689c (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
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
# file      : bdep/buildfile
# copyright : Copyright (c) 2014-2019 Code Synthesis Ltd
# license   : MIT; see accompanying LICENSE file

# @@ ODB: these are ODB changelogs that are both generated and stored in the
#         repository (what if src != out?). Will need to think how to handle
#         them properly (always generate in src_base?).
#
define xml: file
xml{*}: extension = xml

import libs  = libbpkg%lib{bpkg}
import libs += libbutl%lib{butl}
import libs += libodb%lib{odb}
import libs += libodb-sqlite%lib{odb-sqlite}

# @@ Why don't we generate these with wildcard patterns (and rules below with
# a for-loop)?
#
options_topics =  \
bdep-options      \
common-options    \
project-options   \
help-options      \
new-options       \
init-options      \
sync-options      \
fetch-options     \
status-options    \
ci-options        \
release-options   \
publish-options   \
deinit-options    \
config-options    \
test-options      \
update-options    \
clean-options

help_topics = projects-configs

exe{bdep}:                                                                  \
  {hxx ixx txx cxx}{** -{$options_topics} -{$help_topics} -*-odb -version}  \
  {hxx ixx cxx}{$options_topics} {hxx cxx}{$help_topics}                    \
  {hxx ixx cxx}{project-odb database-views-odb}                             \
  {hxx}{version} $libs

hxx{version}: in{version} $src_root/manifest

obj{utility}: cxx.poptions += -DBDEP_EXE_SUFFIX='"'$bin.exe.suffix'"'

# For now assume this is a staged toolchain if we are building with the staged
# build system (see build.version.stage for details on the final plan).
#
if $build.version.stage
  cxx.poptions += -DBDEP_STAGE

# Disable "unknown pragma" warnings.
#
if ($cxx.class == 'msvc')
  cxx.coptions += /wd4068
elif ($cxx.class == 'gcc')
  cxx.coptions += -Wno-unknown-pragmas

if $cli.configured
{
  # General topics and common options.
  #
  cli.cxx{common-options}:         cli{common}
  cli.cxx{project-options}:        cli{project}
  cli.cxx{configuration-options}:  cli{configuration}
  cli.cxx{bdep-options}:           cli{bdep}

  # Command.
  #
  cli.cxx{help-options}: cli{help}

  cli.cxx{new-options}:     cli{new}
  cli.cxx{init-options}:    cli{init}
  cli.cxx{sync-options}:    cli{sync}
  cli.cxx{fetch-options}:   cli{fetch}
  cli.cxx{status-options}:  cli{status}
  cli.cxx{ci-options}:      cli{ci}
  cli.cxx{release-options}: cli{release}
  cli.cxx{publish-options}: cli{publish}
  cli.cxx{deinit-options}:  cli{deinit}
  cli.cxx{config-options}:  cli{config}
  cli.cxx{test-options}:    cli{test}
  cli.cxx{update-options}:  cli{update}
  cli.cxx{clean-options}:   cli{clean}

  # Help topics.
  #
  cli.cxx{projects-configs}: cli{projects-configs}

  # Option length must be the same to get commands/topics/options aligned.
  #
  cli.options += -I $src_root --include-with-brackets --include-prefix bdep \
--guard-prefix BDEP --cxx-prologue "#include <bdep/types-parsers.hxx>" \
--cli-namespace bdep::cli --generate-vector-scanner --generate-file-scanner \
--generate-group-scanner --keep-separator --generate-specifier --generate-modifier \
--generate-parse --page-usage 'bdep::print_$name$_' --ansi-color \
--include-base-last --suppress-undocumented --option-length 23

  cli.cxx{common-options}: cli.options += --short-usage --long-usage # Both.
  cli.cxx{bdep-options}: cli.options += --short-usage
  cli.options += --long-usage # All other pages -- long usage.

  cli.cxx{new-options}: cli.options += \
--cxx-prologue "#include <bdep/new-parsers.hxx>"

  # Avoid generating CLI runtime and empty inline file for help topics.
  #
  cli.cxx{projects-configs}: cli.options += --suppress-cli --suppress-inline

  # Include the generated cli files into the distribution and don't remove
  # them when cleaning in src (so that clean results in a state identical to
  # distributed).
  #
  cli.cxx{*}: dist  = true
  cli.cxx{*}: clean = ($src_root != $out_root)
}