forked from halide/Halide
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Support using vcpkg to build dependencies on all platforms (halide#8387)
This PR adds support for using vcpkg to acquire and build Halide's dependencies on all platforms. It adds a top-level `vcpkg.json` file that explains the relationship between Halide's features and its dependencies. These features include the various LLVM `target-`s (which merely imply a dependency on the corresponding LLVM backend), `serialization` (flatbuffers), the `python-bindings` (pybind11), the `wasm-executor` (wabt), and a few meta-features: * `jit`: enables LLVM targets corresponding to the host system * `target-all`: enables all LLVM targets * `tests`: depends on everything needed for the tests and apps * `developer`: includes all other features All of these are optional (since x86 and WebAssembly are forced), but `jit` and `serialization` are on by default. vcpkg is intended to be an eventual replacement for FetchContent, at least on the buildbots. It will accelerate builds beyond ccache by directly restoring binary caches for our dependencies. Unlike FetchContent, it does not pollute our build with third-party CMake code. Indeed, our build has no idea at all when vcpkg is in use. The primary drawback is that vcpkg installation happens during (or ahead of) configuration time, so there is some initial wait. ## Try it! I have provided many CMake presets to ease adoption. As long as you have `VCPKG_ROOT` set to a fresh clone of `vcpkg`, they should work. They come in two flavors: * `vcpkg`: this acquires dependencies from the main vcpkg registry, but applies our own overlay, which disables building Python 3 (really!) and LLVM. The system is searched for these as usual. * `vcpkg-full`: this disables the Halide overlay and attempts to build ALL dependencies. All these presets enable the `developer` feature in `VCPKG_MANIFEST_FEATURES`, which can be overridden in the usual way. Here are the commands you should use to try it locally: * On Linux or Windows: `cmake --preset release-vcpkg` * On macOS: `cmake --preset macOS-vcpkg` * To use Visual Studio: `cmake --preset win32`. Here, `vcpkg` is implied and `-vcpkg-full` can be added to build LLVM.
- Loading branch information
1 parent
873e48b
commit 1cb03de
Showing
8 changed files
with
866 additions
and
38 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
# This instructs vcpkg to do nothing, which causes find_package | ||
# to search the system for LLVM, rather than the vcpkg trees. | ||
set(VCPKG_POLICY_EMPTY_PACKAGE enabled) |
Oops, something went wrong.