You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
As the name suggests pybind11_all_do_not_use is not meant to be linked to directly. Instead pybind11::pybind11 and/or other components defined by pybind11 should be linked.
I tried to fix the recipe by adding this to package_info():
This problem is reproducible in the test_package included with pybind11 recipe.
Please note that test_package builds and works, but pybind11_all_do_not_use includes all components contained in pybind11, and is undesirable. It includes components both for module development and python embedding, and drags in assortment of components for very specific use cases, that are not meant to be the default. Hence the do_not_use name.
If I add self.cpp_info.requires = ["pybind11::pybind11_", "nlohmann_json::nlohmann_json"] to package_info() of pybind11_json recipe, I see $<$<CONFIG:Release>:pybind11::pybind11;nlohmann_json::nlohmann_json> in pybind11_json-Target-release.cmake.
So it's the way to go (but I don't know if pybind11::pybind11_ is the correct dependency component of pybind11 for pybind_json, maybe it's another one).
Yes, that works.
This will technically be a breaking change, since test_package requires now linking to pybind11::embed. But this is how it should be.
So the remaining issues are:
pybdin11_LIBRARIES is still set to pybind11_all_do_not_use.
We're not sure if pybind11::pybind11_ is the correct dependency component of pybind11 for pybind_json, maybe it's another one.
I think both issues are non critical.
pybdin11_LIBRARIES can just be avoided. There is pybind11::pybind11 target that can be used instead. Also that is an issue with pybind11 package, not this one.
Alternative for pybind11::pybind11_ would be pybind11::headers. pybind11::pybind11_ pulls in Python headers. Both should work fine.
ZbigniewRA
changed the title
[package] pybind11/0.2.13: CMakeDeps incorrectly links to pybind11_all_do_not_use
[package] pybind11_json/0.2.13: CMakeDeps incorrectly links to pybind11_all_do_not_use
Oct 23, 2024
Description
When CMakeDeps is used for
pybind11
it generates the following inpybind11_json-Target-release.cmake
(tested on Windows):As the name suggests
pybind11_all_do_not_use
is not meant to be linked to directly. Insteadpybind11::pybind11
and/or other components defined bypybind11
should be linked.I tried to fix the recipe by adding this to
package_info()
:But it has no effect.
Martin Valgur kindly suggested using
pybind11::pybind11_
could work, but the result is even more surprising:This problem is reproducible in the
test_package
included withpybind11
recipe.Please note that
test_package
builds and works, butpybind11_all_do_not_use
includes all components contained inpybind11
, and is undesirable. It includes components both for module development and python embedding, and drags in assortment of components for very specific use cases, that are not meant to be the default. Hence thedo_not_use
name.Package and Environment Details
Conan profile
[settings]
arch=x86_64
build_type=Release
compiler=msvc
compiler.cppstd=20
compiler.runtime=dynamic
compiler.runtime_type=Release
compiler.version=194
os=Windows
Build profile:
[settings]
arch=x86_64
build_type=Release
compiler=msvc
compiler.cppstd=20
compiler.runtime=dynamic
compiler.runtime_type=Release
compiler.version=194
os=Windows
Steps to reproduce
Build
test_package
frompybind11
recipe on Conan Center:Logs
Click to expand log
The text was updated successfully, but these errors were encountered: