-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Description
Environment details
- Operating System+version: macOS 13.x
- Compiler+version: clang (arm64-apple-darwin22.6.0)
- Conan version: 2.0.9
- Python version: 3.11
Steps to reproduce
We have a product with plugin architecture where CORE library can load PLUGIN_A, PLUGIN_B in runtime.
Our product can also be built for static libraries configuration. In this case, CORE library explicitly have entry points ENTRY_POINT_A, ENTRY_POINT_B which references to symbols in PLUGIN_A, PLUGIN_B respectively.
In this case, when users statically links with CORE, it statically depends on PLUGIN_A and PLUGIN_B and can create their instances via those symbols. Also note, that some common functionality is used by PLUGIN_A and PLUGIN_B from CORE library. So, we have a cyclic dependency here and cmake can perfectly export such targets (install(EXPORT ..)) and they are used by 3rd party projects.
But with Conan I cannot resolve such scheme with cyclic dependencies, because I have to fill self.cpp_info.components["CORE"].libs with ["CORE", "PLUGIN_A", "PLUGIN_B", "CORE"], but last "CORE" is removed by Conan for some reason. Why does Conan do it?
Last "CORE" is required, because "CORE" simply speaking contains of two parts: user API and developer API. First one represent set of symbols used by public users, developer API is for PLUGIN_<x>s. And during static linkage, developer API is removed by linker, because it's not used by final application and we have unresolved symbols in PLUGIN_A and PLUGIN_B. So, last "CORE" is required to resolve those symbols for PLUGINS_<x>s. And cmake generates similar sequence where CORE is faced multiple times in linker command.
Could you please remove filtering out of duplicated libraries, because it's really required for cyclic dependencies?
Logs
N/A