[libcxx-commits] [PATCH] D144994: [Draft][libc++][modules] Adds std module.
Aaron Siddhartha Mondal via Phabricator via libcxx-commits
libcxx-commits at lists.llvm.org
Tue Feb 28 15:34:42 PST 2023
aaronmondal added inline comments.
================
Comment at: libcxx/stdmodules/CMakeLists.txt:43
+ -stdlib=libc++
+ -fprebuilt-module-path=${PREBUILT_MODULE_PATH}
+ -pthread
----------------
aaronmondal wrote:
> I remember running into issues with `-fprebuilt-module-path` as it assumes a very specific output layout during the build. For build systems that sandbox compilations the (absolute) path to the output file (and to the headers it included?) will be embedded in the PCM and aggregating all BMIs in one directory after precompilation might lead to "dependency not found"-type errors.
>
> Explicitly passing the files via `-fmodule-file=<path/to/BMI>` or `-fmodule-file=<module_name>=<path/to/BMI>` seems more robust to me as this takes the situation into account where BMI outputs are potentially temporarily scattered across directories.
>
> I think for CMake the current `-fprebuilt-module-path` should work fine. I'm not sure about gn, and I know for sure that something like this won't work in Bazel.
Amend: `-fmodule-file=<path/to/BMI>` will probably be deprecated (https://github.com/llvm/llvm-project/issues/60824), so something like `-fmodule-file=std:header=<path/to/header>` seems like the way to go.
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D144994/new/
https://reviews.llvm.org/D144994
More information about the libcxx-commits
mailing list