blob: 90b2d6a8d0fc71d01b1a05390a42c91b83f32277 [file] [log] [blame]
John Thompson02bad9f2013-09-23 17:57:00 +00001================
John Thompson26ecaf92013-10-16 13:44:21 +00002Modularize Usage
John Thompson02bad9f2013-09-23 17:57:00 +00003================
John Thompson2d2d45e2013-09-20 14:40:52 +00004
John Thompson469bbc02015-02-12 16:22:09 +00005``modularize [<modularize-options>] <include-files-list>[,<include-files-list>]*
6[<front-end-options>...]``
John Thompson2d2d45e2013-09-20 14:40:52 +00007
8``<modularize-options>`` is a place-holder for options
9specific to modularize, which are described below in
10`Modularize Command Line Options`.
11
12``<include-files-list>`` specifies the path of a file name for a
13file containing the newline-separated list of headers to check
14with respect to each other. Lines beginning with '#' and empty
15lines are ignored. Header file names followed by a colon and
16other space-separated file names will include those extra files
17as dependencies. The file names can be relative or full paths,
John Thompson02bad9f2013-09-23 17:57:00 +000018but must be on the same line. For example::
John Thompson2d2d45e2013-09-20 14:40:52 +000019
John Thompson02bad9f2013-09-23 17:57:00 +000020 header1.h
21 header2.h
22 header3.h: header1.h header2.h
John Thompson2d2d45e2013-09-20 14:40:52 +000023
John Thompson26ecaf92013-10-16 13:44:21 +000024Note that unless a ``-prefix (header path)`` option is specified,
John Thompson2d2d45e2013-09-20 14:40:52 +000025non-absolute file paths in the header list file will be relative
26to the header list file directory. Use -prefix to specify a different
27directory.
28
29``<front-end-options>`` is a place-holder for regular Clang
30front-end arguments, which must follow the <include-files-list>.
31Note that by default, the underlying Clang front end assumes .h files
32contain C source, so you might need to specify the ``-x c++`` Clang option
33to tell Clang that the header contains C++ definitions.
34
35Modularize Command Line Options
John Thompson02bad9f2013-09-23 17:57:00 +000036===============================
John Thompson2d2d45e2013-09-20 14:40:52 +000037
38.. option:: -prefix <header-path>
39
40 Prepend the given path to non-absolute file paths in the header list file.
41 By default, headers are assumed to be relative to the header list file
John Thompson26ecaf92013-10-16 13:44:21 +000042 directory. Use ``-prefix`` to specify a different directory.
43
44.. option:: -module-map-path=<module-map-path>
45
46 Generate a module map and output it to the given file. See the description
47 in :ref:`module-map-generation`.
48
49.. option:: -root-module=<root-name>
50
51 Put modules generated by the -module-map-path option in an enclosing
52 module with the given name. See the description in :ref:`module-map-generation`.
John Thompsonecd3b042015-02-11 16:58:36 +000053
54.. option:: -block-check-header-list-only
55
56 Limit the #include-inside-extern-or-namespace-block
57 check to only those headers explicitly listed in the header list.
58 This is a work-around for avoiding error messages for private includes that
59 purposefully get included inside blocks.