Skip to content

Commit 7dd6fa6

Browse files
authored
Initialize nanobind at top-level (#19422)
Initalizes nanobind at the top-level as MLIR is switching over to nanobind with llvm/llvm-project#118583.
1 parent f024875 commit 7dd6fa6

File tree

2 files changed

+12
-9
lines changed

2 files changed

+12
-9
lines changed

CMakeLists.txt

+12
Original file line numberDiff line numberDiff line change
@@ -773,6 +773,18 @@ endif()
773773
# MLIR/LLVM Dependency
774774
#-------------------------------------------------------------------------------
775775

776+
# Both the IREE and MLIR Python bindings require nanobind. We initialize it here
777+
# at the top level so that everything uses ours consistently.
778+
if(IREE_BUILD_PYTHON_BINDINGS OR IREE_BUILD_COMPILER)
779+
include(FetchContent)
780+
FetchContent_Declare(
781+
nanobind
782+
GIT_REPOSITORY https://github.com/wjakob/nanobind.git
783+
GIT_TAG 0f9ce749b257fdfe701edb3cf6f7027ba029434a # v2.4.0
784+
)
785+
FetchContent_MakeAvailable(nanobind)
786+
endif()
787+
776788
# Both the IREE and MLIR Python bindings require pybind11. We initialize it here
777789
# at the top level so that everything uses ours consistently.
778790
if(IREE_BUILD_PYTHON_BINDINGS AND IREE_BUILD_COMPILER)

runtime/bindings/python/CMakeLists.txt

-9
Original file line numberDiff line numberDiff line change
@@ -4,15 +4,6 @@
44
# See https://llvm.org/LICENSE.txt for license information.
55
# SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
66

7-
# nanobind
8-
include(FetchContent)
9-
FetchContent_Declare(
10-
nanobind
11-
GIT_REPOSITORY https://github.com/wjakob/nanobind.git
12-
GIT_TAG 0f9ce749b257fdfe701edb3cf6f7027ba029434a # v2.4.0
13-
)
14-
FetchContent_MakeAvailable(nanobind)
15-
167
set(_EXTRA_INSTALL_TOOL_TARGETS)
178
set(_TRACY_ENABLED OFF)
189

0 commit comments

Comments
 (0)