[ESI] Always find_package Python3 Development (#8778)

AFAICT, pybind11 v. 3.0.0 (release 2 weeks ago) changed a bit how modules are being defined. A result of that is that it's not sufficient to just look for `Python3_FOUND`. That can be evident when e.g. building the ESI runtime alongside the rest of CIRCT, if python bindings are _not_ enabled. In that case [here](https://github.com/llvm/circt/blob/main/CMakeLists.txt) the top-level CMakeLists won't look for the Python3 `Development` component... I'm a bit surprised that this isn't done inside the pybind11 cmake files, but oh well... the problem is fixed by always `find_package`'ing for both `Interpreter` and `Development` in the ESI runtime CMakeLists.txt.

Also sneaks in a .gitignore for the `ESI/runtime` library, to better support in-tree builds of just the runtime.

Co-authored-by: Morten Borup Petersen <mpetersen@microsoft.com>
This commit is contained in:
Morten Borup Petersen 2025-07-25 10:59:57 +02:00 committed by GitHub
parent 0a79297ac2
commit 2696da0895
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 2 additions and 3 deletions

1
lib/Dialect/ESI/runtime/.gitignore vendored Normal file
View File

@ -0,0 +1 @@
/build*

View File

@ -283,9 +283,7 @@ add_dependencies(ESIRuntime esitester)
##===----------------------------------------------------------------------===//
# Pybind11 is used to wrap the ESICppRuntime APIs.
if(NOT DEFINED Python3_FOUND)
find_package(Python3 COMPONENTS Interpreter Development)
endif()
find_package(Python3 COMPONENTS Interpreter Development)
if(Python3_FOUND)
IF(MSVC)
# Work around an issue with pybind11 and cmake incompatibility on Windows in debug mode.