Commits

Brian Gesiak committed 04e1cd5bda4
[Glibc] Configure modulemap for target, not host The current Glibc CMakeLists.txt uses the host machine to determine which modulemap to use. The same modulemap can't be used for all platforms because headers are available in different locations on different platforms. Using the host machine to determine which modulemap to configure and place at a specific path in the resource dir is fine, so long as: 1. Only one Glibc is being compiled in a single CMake invocation. 2. The target machine needs the same modulemap as the host. https://github.com/apple/swift/pull/1442 violates both of these assumptions: the Glibc module for both Linux and Android is compiled at the same time, and the Android target can't use the Linux modulemap. This commit instead uses the target(s) to determine which modulemap to use. The modulemap is configured and placed in an OS- and architecture-specific directory in the resource dir. The path to that modulemap is referenced by the ClangImporter (since it is no longer at a path that is automatically discovered as an implicit modulemap).