John Thompson | 02bad9f | 2013-09-23 17:57:00 +0000 | [diff] [blame] | 1 | ================ |
John Thompson | 26ecaf9 | 2013-10-16 13:44:21 +0000 | [diff] [blame] | 2 | Modularize Usage |
John Thompson | 02bad9f | 2013-09-23 17:57:00 +0000 | [diff] [blame] | 3 | ================ |
John Thompson | 2d2d45e | 2013-09-20 14:40:52 +0000 | [diff] [blame] | 4 | |
John Thompson | 9cb7964 | 2015-02-18 16:14:32 +0000 | [diff] [blame] | 5 | ``modularize [<modularize-options>] [<module-map>|<include-files-list>]* |
John Thompson | 469bbc0 | 2015-02-12 16:22:09 +0000 | [diff] [blame] | 6 | [<front-end-options>...]`` |
John Thompson | 2d2d45e | 2013-09-20 14:40:52 +0000 | [diff] [blame] | 7 | |
| 8 | ``<modularize-options>`` is a place-holder for options |
| 9 | specific to modularize, which are described below in |
| 10 | `Modularize Command Line Options`. |
| 11 | |
John Thompson | 9cb7964 | 2015-02-18 16:14:32 +0000 | [diff] [blame] | 12 | ``<module-map>`` specifies the path of a file name for an |
Malcolm Parsons | 5831a00 | 2016-11-17 14:26:45 +0000 | [diff] [blame] | 13 | existing module map. The module map must be well-formed in |
| 14 | terms of syntax. Modularize will extract the header file names |
| 15 | from the map. Only normal headers are checked, assuming headers |
John Thompson | 9cb7964 | 2015-02-18 16:14:32 +0000 | [diff] [blame] | 16 | marked "private", "textual", or "exclude" are not to be checked |
| 17 | as a top-level include, assuming they either are included by |
| 18 | other headers which are checked, or they are not suitable for |
| 19 | modules. |
| 20 | |
John Thompson | 2d2d45e | 2013-09-20 14:40:52 +0000 | [diff] [blame] | 21 | ``<include-files-list>`` specifies the path of a file name for a |
| 22 | file containing the newline-separated list of headers to check |
| 23 | with respect to each other. Lines beginning with '#' and empty |
| 24 | lines are ignored. Header file names followed by a colon and |
| 25 | other space-separated file names will include those extra files |
| 26 | as dependencies. The file names can be relative or full paths, |
John Thompson | 02bad9f | 2013-09-23 17:57:00 +0000 | [diff] [blame] | 27 | but must be on the same line. For example:: |
John Thompson | 2d2d45e | 2013-09-20 14:40:52 +0000 | [diff] [blame] | 28 | |
John Thompson | 02bad9f | 2013-09-23 17:57:00 +0000 | [diff] [blame] | 29 | header1.h |
| 30 | header2.h |
| 31 | header3.h: header1.h header2.h |
John Thompson | 2d2d45e | 2013-09-20 14:40:52 +0000 | [diff] [blame] | 32 | |
John Thompson | 26ecaf9 | 2013-10-16 13:44:21 +0000 | [diff] [blame] | 33 | Note that unless a ``-prefix (header path)`` option is specified, |
John Thompson | 2d2d45e | 2013-09-20 14:40:52 +0000 | [diff] [blame] | 34 | non-absolute file paths in the header list file will be relative |
Malcolm Parsons | 5831a00 | 2016-11-17 14:26:45 +0000 | [diff] [blame] | 35 | to the header list file directory. Use -prefix to specify a different |
John Thompson | 2d2d45e | 2013-09-20 14:40:52 +0000 | [diff] [blame] | 36 | directory. |
| 37 | |
| 38 | ``<front-end-options>`` is a place-holder for regular Clang |
| 39 | front-end arguments, which must follow the <include-files-list>. |
John Thompson | f9f62b1 | 2015-05-06 18:43:01 +0000 | [diff] [blame] | 40 | Note that by default, modularize assumes .h files |
| 41 | contain C++ source, so if you are using a different language, |
| 42 | you might need to use a ``-x`` option to tell Clang that the |
| 43 | header contains another language, i.e.: ``-x c`` |
John Thompson | 2d2d45e | 2013-09-20 14:40:52 +0000 | [diff] [blame] | 44 | |
John Thompson | 8eb8d93 | 2015-02-19 16:47:27 +0000 | [diff] [blame] | 45 | Note also that because modularize does not use the clang driver, |
| 46 | you will likely need to pass in additional compiler front-end |
| 47 | arguments to match those passed in by default by the driver. |
| 48 | |
John Thompson | 2d2d45e | 2013-09-20 14:40:52 +0000 | [diff] [blame] | 49 | Modularize Command Line Options |
John Thompson | 02bad9f | 2013-09-23 17:57:00 +0000 | [diff] [blame] | 50 | =============================== |
John Thompson | 2d2d45e | 2013-09-20 14:40:52 +0000 | [diff] [blame] | 51 | |
John Thompson | 81cf1e8 | 2015-06-04 01:12:56 +0000 | [diff] [blame] | 52 | .. option:: -prefix=<header-path> |
John Thompson | 2d2d45e | 2013-09-20 14:40:52 +0000 | [diff] [blame] | 53 | |
| 54 | Prepend the given path to non-absolute file paths in the header list file. |
| 55 | By default, headers are assumed to be relative to the header list file |
Malcolm Parsons | 5831a00 | 2016-11-17 14:26:45 +0000 | [diff] [blame] | 56 | directory. Use ``-prefix`` to specify a different directory. |
John Thompson | 26ecaf9 | 2013-10-16 13:44:21 +0000 | [diff] [blame] | 57 | |
| 58 | .. option:: -module-map-path=<module-map-path> |
| 59 | |
Malcolm Parsons | 5831a00 | 2016-11-17 14:26:45 +0000 | [diff] [blame] | 60 | Generate a module map and output it to the given file. See the description |
John Thompson | 26ecaf9 | 2013-10-16 13:44:21 +0000 | [diff] [blame] | 61 | in :ref:`module-map-generation`. |
Alexander Kornienko | 1647f38 | 2016-12-13 16:38:45 +0000 | [diff] [blame] | 62 | |
John Thompson | 4018c62 | 2015-07-10 00:37:25 +0000 | [diff] [blame] | 63 | .. option:: -problem-files-list=<problem-files-list-file-name> |
| 64 | |
Malcolm Parsons | 5831a00 | 2016-11-17 14:26:45 +0000 | [diff] [blame] | 65 | For use only with module map assistant. Input list of files that |
| 66 | have problems with respect to modules. These will still be |
John Thompson | 4018c62 | 2015-07-10 00:37:25 +0000 | [diff] [blame] | 67 | included in the generated module map, but will be marked as |
| 68 | "excluded" headers. |
John Thompson | 26ecaf9 | 2013-10-16 13:44:21 +0000 | [diff] [blame] | 69 | |
| 70 | .. option:: -root-module=<root-name> |
| 71 | |
| 72 | Put modules generated by the -module-map-path option in an enclosing |
Malcolm Parsons | 5831a00 | 2016-11-17 14:26:45 +0000 | [diff] [blame] | 73 | module with the given name. See the description in :ref:`module-map-generation`. |
John Thompson | ecd3b04 | 2015-02-11 16:58:36 +0000 | [diff] [blame] | 74 | |
| 75 | .. option:: -block-check-header-list-only |
| 76 | |
| 77 | Limit the #include-inside-extern-or-namespace-block |
| 78 | check to only those headers explicitly listed in the header list. |
| 79 | This is a work-around for avoiding error messages for private includes that |
| 80 | purposefully get included inside blocks. |
John Thompson | 8eb8d93 | 2015-02-19 16:47:27 +0000 | [diff] [blame] | 81 | |
| 82 | .. option:: -no-coverage-check |
| 83 | |
| 84 | Don't do the coverage check for a module map. |
| 85 | |
| 86 | .. option:: -coverage-check-only |
| 87 | |
| 88 | Only do the coverage check for a module map. |
John Thompson | 4018c62 | 2015-07-10 00:37:25 +0000 | [diff] [blame] | 89 | |
| 90 | .. option:: -display-file-lists |
| 91 | |
| 92 | Display lists of good files (no compile errors), problem files, |
| 93 | and a combined list with problem files preceded by a '#'. |
| 94 | This can be used to quickly determine which files have problems. |
| 95 | The latter combined list might be useful in starting to modularize |
Malcolm Parsons | 5831a00 | 2016-11-17 14:26:45 +0000 | [diff] [blame] | 96 | a set of headers. You can start with a full list of headers, |
John Thompson | 4018c62 | 2015-07-10 00:37:25 +0000 | [diff] [blame] | 97 | use -display-file-lists option, and then use the combined list as |
| 98 | your intermediate list, uncommenting-out headers as you fix them. |