Open derived-coder opened 4 years ago
Quick question: who is providing the -ldlt
library? Is it a system_libs
? Is it defined in package_info()
?
If it is a system_libs, the responsible of providing the path to it should probably be the build_system, not Conan (this is the main reason, it is called a system_lib
, because it is not managed by Conan, and Conan doesn't know where it is located in the filesystem)
quick answer: dlt
is actually the lib of the dlt-daemon
package which I am creating.
So it is not a system lib. the test_packge
is actually failing. With gcc profile it works. With qnx not.
Here the package_info
def package_info(self):
self.cpp_info.name = "automotive-dlt"
self.cpp_info.libs = tools.collect_libs(self)
if not self.options.shared:
self.cpp_info.libdirs = ["lib/static"]
self.cpp_info.libs = tools.collect_libs(self)
if self.settings.os == "Windows":
self.cpp_info.libs.extend(['psapi', 'ws2_32'])
elif self.settings.os == "Linux":
self.cpp_info.libs.extend(['pthread'])
if self.settings.os == "Neutrino":
self.cpp_info.system_libs.extend(["socket"])
Such a side node. I saw a lot of test_package using the plain ${CONAN_LIBS}
approach
https://github.com/conan-io/conan-center-index/blob/master/recipes/zstd/all/test_package/CMakeLists.txt#L13
using this approach would fix it, however, that is not the best approach. I want a transparent integration so that existing code does not need to be changed. Can we do there something so that this kind of errors can be found earlier?
A couple of quick tips:
self.cpp_info.libs = tools.collect_libs(self)
You are running this twiceself.cpp_info.name = "automotive-dlt"
You probably don't need this, this is mostly for integration of open source libraries. If the package is dlt-daemon
it is recommended to keep that name, not change it, otherwise it is confusing.I don't know what pkg_check_modules(DltDaemon REQUIRED IMPORTED_TARGET automotive-dlt)
does. It is not clear how you are using the Conan generators, which generator, and how you are passing that information to the build system. Please try to provide something that we can reproduce here to investigate.
okay, thanks for the input. I fixed this double collect. I can uupload the whole recipe. However, you will be not be able to build it, because dlt-daemon depends on dbus, and this depends on more libs. Or do you want it anyway?
However, I want to bring your attention on the generated PkgConfig files from conan which I mentioned above, there is a difference visible like you can see. What is the reason for this -Wl,-rpath="${libdir}"
in the working case with gcc?
@memsharded Any Idea? This issue is unfortunately a blocking issue for working with QNX
My Problem is that for the generated PkgConfig files from conan do not work for QNX profile.
The
-ldlt
cannot be found, because the path is not correctly provided.Environment Details (include every applicable attribute)
Steps to reproduce (Include if Applicable)
This is my example cmake script:
This is a conan generated PkgConfig file with a profile for gcc 7.0, which will work!
This is a PkgConfig file with a profile for qcc 5.4 (QNX)
The big difference between these two is Libs falgs:
-Wl,-rpath="${libdir}"
this is atteched for normal gcc buildLogs (Executed commands with output) (Include/Attach if Applicable)
the resulting link script used by CMake for gcc 7.0
The link script used by CMake for qcc 5.4