xo-facet: move output-hpp-dir + subdir to idl/*.json5
This commit is contained in:
parent
d3aa6285a8
commit
e85f377231
1 changed files with 15 additions and 7 deletions
|
|
@ -455,9 +455,6 @@ def main():
|
|||
parser.add_argument('--input', required=True, help='input IDL JSON5 file')
|
||||
# --facet-dir: only with mode=implementation
|
||||
parser.add_argument('--facet-dir', required=False, help='base dir for facet json')
|
||||
# --output-impl-hpp: putting this in .json5, will be able to drop this.
|
||||
parser.add_argument('--output-impl-hpp', required=True, help='.hpp detail subdir')
|
||||
parser.add_argument('--output-hpp', required=True, help='.hpp output directory')
|
||||
parser.add_argument('--output-cpp', required=False, help='.cpp output directory')
|
||||
|
||||
args = parser.parse_args()
|
||||
|
|
@ -465,12 +462,23 @@ def main():
|
|||
idl_fname = args.input
|
||||
idl = load_idl(idl_fname)
|
||||
|
||||
output_hpp_dir = Path(args.output_hpp)
|
||||
# output_hpp_dir: prefer IDL, fall back to CLI
|
||||
if 'output_hpp_dir' in idl:
|
||||
output_hpp_dir = Path(idl['output_hpp_dir'])
|
||||
elif args.output_hpp:
|
||||
output_hpp_dir = Path(args.output_hpp)
|
||||
else:
|
||||
parser.error("--output-hpp required when .json5 lacks output_hpp_dir")
|
||||
output_hpp_dir.mkdir(parents=False, exist_ok=True)
|
||||
|
||||
# TODO: output_impl_hpp_subdir: use idl['detail_subdir'] instead
|
||||
output_impl_hpp_subdir = Path(args.output_impl_hpp)
|
||||
output_impl_hpp_dir = Path(args.output_hpp) / output_impl_hpp_subdir
|
||||
# output_impl_hpp_subdir: prefer IDL, fall back to CLI
|
||||
if 'output_impl_subdir' in idl:
|
||||
output_impl_hpp_subdir = Path(idl['output_impl_subdir'])
|
||||
elif args.output_impl_hpp:
|
||||
output_impl_hpp_subdir = Path(args.output_impl_hpp)
|
||||
else:
|
||||
parser.error("--output-impl-hpp required when .json5 lacks output_impl_subdir")
|
||||
output_impl_hpp_dir = output_hpp_dir / output_impl_hpp_subdir
|
||||
output_impl_hpp_dir.mkdir(parents=False, exist_ok=True)
|
||||
|
||||
if 'output_cpp_dir' in idl:
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue