Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[bug] QMake generator does not honour system_libs #7558

Closed
ttencate opened this issue Aug 18, 2020 · 2 comments · Fixed by #7563
Closed

[bug] QMake generator does not honour system_libs #7558

ttencate opened this issue Aug 18, 2020 · 2 comments · Fixed by #7563

Comments

@ttencate
Copy link
Contributor

ttencate commented Aug 18, 2020

It seems the QMake generator, like the SCons generator, was overlooked in #5582 which added cpp_info.system_libs.

Environment Details (include every applicable attribute)

  • Operating System+version: Arch Linux
  • Compiler+version: gcc (GCC) 10.1.0
  • Conan version: 1.28.0
  • Python version: 3.8.5

Steps to reproduce (Include if Applicable)

conanfile.txt:

[requires]
icu/67.1

[generators]
qmake

On Linux, the icu recipe adds pthread to cpp_info.system_libs:

https://github.com/conan-io/conan-center-index/blob/d6c56bef267cab013b13fbb35b9426735b78bd5e/recipes/icu/all/conanfile.py#L235

However, this is not reflected in the generated conanbuildinfo.pri:

$ grep pthread conanbuildinfo.pri
$
$ grep -i _libs conanbuildinfo.pri
CONAN_LIBS += -licui18n -licuio -licutest -licutu -licuuc -licudata
CONAN_LIBS_ICU += -licui18n -licuio -licutest -licutu -licuuc -licudata
    LIBS += $$CONAN_LIBS
        LIBS += $$CONAN_LIBS_RELEASE
        LIBS += $$CONAN_LIBS_DEBUG

Indeed generators/qmake.py, unlike most of the other generators, does not contain the text system_libs anywhere.

My actual problem is not with icu but with a proprietary package that I'm maintaining myself, so as a workaround I tried adding cpp_info.exeflags.append('-lpthread'). That gets added to the link command properly, but in the wrong order (it should be after the dependent lib), so it still doesn't work.

A workaround that does work (for me) is to put self.cpp_info.libs += self.cpp_info.system_libs at the end of the package_info function.

I think the solution for QMake would be to just add system libs to the end of the *_LIBS variables.

@memsharded
Copy link
Member

Hi @ttencate

Yes, you are right, this seems to be missing. As the changes should be relatively straightforward, would you like to contribute yourself to the fix in QmakeGenerator class? If not, possible, not a problem, we will manage it (but it might need to wait until next Conan 1.30 release). Thanks for reporting!

@memsharded
Copy link
Member

I have also submitted issue #7564, please note that qmake does not handle OSX frameworks either, in case you hit this bug too if using OSX.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants