@@ -110,6 +110,19 @@ bool BoxedType(const ::capnp::Type& type)
110
110
type.isFloat64 () || type.isEnum ());
111
111
}
112
112
113
+ // src_file is path to .capnp file to generate stub code from.
114
+ //
115
+ // src_prefix can be used to generate outputs in a different directory than the
116
+ // source directory. For example if src_file is "/a/b/c/d/file.canp", and
117
+ // src_prefix is "/a/b", then output files will be "c/d/file.capnp.h"
118
+ // "c/d/file.capnp.cxx" "c/d/file.capnp.proxy.h", etc. This is equivalent to
119
+ // the capnp "--src-prefix" option (see "capnp help compile").
120
+ //
121
+ // include_prefix can be used to control relative include paths used in
122
+ // generated files. For example if src_file is "/a/b/c/d/file.canp" and
123
+ // include_prefix is "/a/b/c" include lines like
124
+ // "#include <d/file.capnp.proxy.h>" "#include <d/file.capnp.proxy-types.h>"i
125
+ // will be generated.
113
126
void Generate (kj::StringPtr src_prefix,
114
127
kj::StringPtr include_prefix,
115
128
kj::StringPtr src_file,
@@ -594,7 +607,7 @@ void Generate(kj::StringPtr src_prefix,
594
607
int main (int argc, char ** argv)
595
608
{
596
609
if (argc < 3 ) {
597
- fprintf (stderr, " Usage: " PROXY_BIN " SRC_PREFIX SRC_FILE [IMPORT_PATH...]\n " );
610
+ fprintf (stderr, " Usage: " PROXY_BIN " SRC_PREFIX INCLUDE_PREFIX SRC_FILE [IMPORT_PATH...]\n " );
598
611
exit (1 );
599
612
}
600
613
std::vector<kj::StringPtr> import_paths;
0 commit comments