Created by: nguyentruongtho
Split out from https://github.com/facebook/buck/pull/983 in effort of supporting clang module.
We create buck.modulemap
instead of module.modulemap
for all public header symlink trees with header map. Those module maps will enable us to import a target as module later on.
The reason for this special module map naming is that, if module is enabled for a project (-fmodules
), all module.modulemap
files in that project's search paths will be pre-compiled and imported implicitly (see https://clang.llvm.org/docs/Modules.html, search for -fimplicit-module-maps
), which leads to nondeterministic compilation results if we don't handle module cache carefully.
Instead of looking into how to handle module cache, we will name module map that created by buck buck.modulemap
, so that it will not be used implicitly, and will explicitly specified them via -fmodule-map-file
in compile commands when needed.