[PATCH] D48422: [CMake] Add compiler-rt header files to the list of sources for targets when building with an IDE
Dan Liew via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Thu Jun 21 05:05:37 PDT 2018
delcypher created this revision.
delcypher added reviewers: beanz, kubamracek, etienneb, phosek.
Herald added subscribers: Sanitizers, mgorny, dberris.
[CMake] Add compiler-rt header files to the list of sources for targets
when building with an IDE so that header files show up in the UI.
This massively improves the development workflow in IDEs.
To implement this a new function `crt_process_sources(...)` has been
added that adds header files to the list of sources when the generator
is an IDE. For non-IDE generators (e.g. Ninja/Makefile) no changes
are made to the list of source files.
When a header directory is passed it is searched for header files by
globbing. Although this is generally considered a CMake anti-pattern.
CMake already knows about the header dependencies and a very similar
approach is taken in LLVM with the `llvm_process_sources()` function.
We don't use `llvm_process_sources()` here for several reasons
- It depends on the `LLVM_ENABLE_OPTION` cache variable which is not set in standalone compiler-rt builds.
- We would have to `include(LLVMProcessSources)` which I'd like to avoid because it would include a bunch of stuff we don't need.
Repository:
rCRT Compiler Runtime
https://reviews.llvm.org/D48422
Files:
cmake/Modules/AddCompilerRT.cmake
cmake/Modules/CompilerRTUtils.cmake
lib/tsan/CMakeLists.txt
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D48422.152255.patch
Type: text/x-patch
Size: 6766 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20180621/a11036a5/attachment.bin>
More information about the llvm-commits
mailing list