Include projects/openmp into the build using add_llvm_external_project
instead of add_subdirectory. This creates an option
LLVM_TOOL_OPENMP_BUILD that selects whether this project gets included
in an in-tree build.
Details
Diff Detail
- Repository
- rL LLVM
Event Timeline
For Android, we are building LLVM, Clang and OpenMP from a single checkout for both Linux and Windows (using MinGW). But we only build OpenMP for the Linux host and Android-supported targets. The LLVM_TOOL_OPENMP_BUILD option allows skipping OpenMP when building for Windows.
This patch is fine, just be warned that eventually I really want to kill the projects subdirectory entirely.
In general there are two types of "projects" that need to be added to the LLVM build tree: (1) projects that produce tools or libraries that depend on LLVM in some way, or (2) runtime libraries that are part of LLVM's compiler distribution.
The "projects" subdirectory has been used for things that fall into both of those categories, and it is confusing and complicated. In the future the plan is to make a clear distinction between the two types. Projects that depend on LLVM and should be integrated with LLVM's build system will be included under LLVM's "tools" directory which has an auto-discovery mechanism and does not require changes to the build system to do what this patch does. Additionally projects that produce runtime libraries will be included under LLVM's "runtimes" subdirectory, which supports configuring and building runtime library projects using just-built compiler toolchains.
There is no timeline for the removal of the projects directory, but please consider where openmp should fit in the future.
Thanks for the comments Chris. I believe OpenMP would be considered a runtime, but I'll let one of the OpenMP owners chime in.
+1
I actually committed https://reviews.llvm.org/rL290978 some time ago and I'm already using this :-)