-
Notifications
You must be signed in to change notification settings - Fork 641
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Build functioning dev packages for IREECompiler and IREERuntime. (#16008
) With this patch, external projects can do: ``` find_package(IREECompiler) find_package(IREERuntime) ``` and access our targets by adding either the build or install tree `lib/cmake/IREE` to the CMake package search path. There are still some ergonomic issues that need to be addressed going forward: * cpuinfo breaks the one downstream I am testing this against. We really should just finish killing that, so I am setting -DIREE_ENABLE_CPUINFO=OFF in the dist package. * We are not yet re-establishing the pretty `iree::runtime:...` aliases. The underscore versions are available (`iree_runtime_...`). * I want to further isolate the remaining bundled deps (yaml and flatcc). * New convenience install targets do not have full dependency information. Need to do an `all` build first. As part of this, I did some longstanding cleanups: * Normalized the install component namespace. Defined `IREECMakeExports`, `IREEDevLibraries-Compiler`, `IREEDevLibraries-Runtime`, `IREERuntimeLibraries-Compiler`, `IREEBundledLibraries`, `IREETools-Runtime`. * Added convenience `iree-install-*` targets. Each includes a `-stripped` variant as well. * Moved MLIRInterop.h to the bindings/c directory where it should have been all along and straightened the deps. * Install the mlir-c headers to support libIREECompiler.so dev. * Added the "busybox" tool binaries to the install distribution (iree-lld, etc). * Stopped bundling upstream `lld` and `clang` by default because they bloat the size. `lld` is now bundled as `iree-lld` just like in the Python packages. Clang and llvm-link can be gotten by installing the new `IREETools-CompilerExtra` component if folks need those. Note that this only installs public headers and libraries needed to build against the compiler and runtime. Installing private things needed to develop parts of the system are out of scope.
- Loading branch information
1 parent
b0e8f3c
commit 15c306f
Showing
37 changed files
with
593 additions
and
74 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
# Copyright 2023 The IREE Authors | ||
# | ||
# Licensed under the Apache License v2.0 with LLVM Exceptions. | ||
# See https://llvm.org/LICENSE.txt for license information. | ||
# SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception | ||
|
||
set(_cmake_installdir "${CMAKE_INSTALL_LIBDIR}/cmake/IREE") | ||
|
||
if(IREE_BUILD_COMPILER) | ||
configure_file( | ||
${CMAKE_CURRENT_SOURCE_DIR}/IREECompilerConfig.cmake.in | ||
${CMAKE_CURRENT_BINARY_DIR}/IREECompilerConfig.cmake | ||
@ONLY | ||
) | ||
install(FILES | ||
${CMAKE_CURRENT_BINARY_DIR}/IREECompilerConfig.cmake | ||
DESTINATION ${_cmake_installdir} | ||
COMPONENT IREECMakeExports | ||
) | ||
endif() | ||
|
||
configure_file( | ||
${CMAKE_CURRENT_SOURCE_DIR}/IREERuntimeConfig.cmake.in | ||
${CMAKE_CURRENT_BINARY_DIR}/IREERuntimeConfig.cmake | ||
@ONLY | ||
) | ||
install(FILES | ||
${CMAKE_CURRENT_BINARY_DIR}/IREERuntimeConfig.cmake | ||
DESTINATION ${_cmake_installdir} | ||
COMPONENT IREECMakeExports | ||
) |
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,6 @@ | ||
# This allows users to call find_package(IREECompiler) and access our targets. | ||
|
||
include("${CMAKE_CURRENT_LIST_DIR}/IREETargets-Compiler.cmake") | ||
|
||
# TODO: Define some properties to reference all libraries and config options. | ||
# TODO: Iterate over all exported libraries and re-alias them. |
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,6 @@ | ||
# This allows users to call find_package(IREERuntime) and access our targets. | ||
|
||
include("${CMAKE_CURRENT_LIST_DIR}/IREETargets-Runtime.cmake") | ||
|
||
# TODO: Define some properties to reference all libraries and config options. | ||
# TODO: Iterate over all exported libraries and re-alias them. |
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
Oops, something went wrong.