summaryrefslogtreecommitdiff
path: root/docs/Modules.rst
diff options
context:
space:
mode:
authorBen Langmuir <blangmuir@apple.com>2014-03-19 20:23:34 +0000
committerBen Langmuir <blangmuir@apple.com>2014-03-19 20:23:34 +0000
commitae028ef7977ade3af88ab838a5fb1bed36152aeb (patch)
tree1358f9f77b74f37083b08ee9f833b9ca385b9159 /docs/Modules.rst
parent63a1a884644024e38677cac8535f32c23ca73d58 (diff)
downloadclang-ae028ef7977ade3af88ab838a5fb1bed36152aeb.tar.gz
clang-ae028ef7977ade3af88ab838a5fb1bed36152aeb.tar.bz2
clang-ae028ef7977ade3af88ab838a5fb1bed36152aeb.tar.xz
Add a new spelling for module map files 'module.modulemap'
This name, while more verbose, plays more nicely with tools that use file extensions to determine file types. The existing spelling 'module.map' will continue to work, but the new spelling will take precedence. In frameworks, this new filename will only go in a new 'Modules' sub-directory. Similarly, add a module.private.modulemap corresponding to module_private.map. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@204261 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'docs/Modules.rst')
-rw-r--r--docs/Modules.rst11
1 files changed, 7 insertions, 4 deletions
diff --git a/docs/Modules.rst b/docs/Modules.rst
index 7545bf0cc0..611a5edc23 100644
--- a/docs/Modules.rst
+++ b/docs/Modules.rst
@@ -144,7 +144,7 @@ Module maps
-----------
The crucial link between modules and headers is described by a *module map*, which describes how a collection of existing headers maps on to the (logical) structure of a module. For example, one could imagine a module ``std`` covering the C standard library. Each of the C standard library headers (``<stdio.h>``, ``<stdlib.h>``, ``<math.h>``, etc.) would contribute to the ``std`` module, by placing their respective APIs into the corresponding submodule (``std.io``, ``std.lib``, ``std.math``, etc.). Having a list of the headers that are part of the ``std`` module allows the compiler to build the ``std`` module as a standalone entity, and having the mapping from header names to (sub)modules allows the automatic translation of ``#include`` directives to module imports.
-Module maps are specified as separate files (each named ``module.map``) alongside the headers they describe, which allows them to be added to existing software libraries without having to change the library headers themselves (in most cases [#]_). The actual `Module map language`_ is described in a later section.
+Module maps are specified as separate files (each named ``module.modulemap``) alongside the headers they describe, which allows them to be added to existing software libraries without having to change the library headers themselves (in most cases [#]_). The actual `Module map language`_ is described in a later section.
.. note::
@@ -237,10 +237,13 @@ Module Map Language
The module map language describes the mapping from header files to the
logical structure of modules. To enable support for using a library as
-a module, one must write a ``module.map`` file for that library. The
-``module.map`` file is placed alongside the header files themselves,
+a module, one must write a ``module.modulemap`` file for that library. The
+``module.modulemap`` file is placed alongside the header files themselves,
and is written in the module map language described below.
+.. note::
+ For compatibility with previous releases, if a module map file named ``module.modulemap`` is not found, Clang will also search for a file named ``module.map``. This behavior is deprecated and we plan to eventually remove it.
+
As an example, the module map file for the C standard library might look a bit like this:
.. parsed-literal::
@@ -319,7 +322,7 @@ The ``framework`` qualifier specifies that this module corresponds to a Darwin-s
.. parsed-literal::
Name.framework/
- module.map Module map for the framework
+ Modules/module.modulemap Module map for the framework
Headers/ Subdirectory containing framework headers
Frameworks/ Subdirectory containing embedded frameworks
Resources/ Subdirectory containing additional resources