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

Use self.cpp_info.libdirs as folders for tools.collect_libs() #3503

Merged
merged 2 commits into from Sep 25, 2018

Conversation

danimtb
Copy link
Member

@danimtb danimtb commented Sep 7, 2018

Changelog: Feature: The tool tools.collect_libs() now search into each folder declared in self.cpp_info.libdirs.

@ghost ghost assigned danimtb Sep 7, 2018
@ghost ghost added the stage: review label Sep 7, 2018
@danimtb danimtb removed their assignment Sep 7, 2018
@memsharded
Copy link
Member

This slightly changes behavior. To a better one, something that makes more sense, for sure. To discuss if the previous behavior was buggy.

if not os.path.exists(lib_folder):
conanfile.output.warn("Lib folder doesn't exist, can't collect libraries: "
"{0}".format(lib_folder))
return []
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I do not agree with the return here. If we output a warning we should continue with the next folder; otherwise, I would raise a ConanException and force the user to fix it.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Agree, sounds like a continue instead should make it. Specially because the behavior of conan when no folder exist or is empty for includedirs, libdirs, etc, is ignore them.

Add a test covering this case, please.

if not os.path.exists(lib_folder):
conanfile.output.warn("Lib folder doesn't exist, can't collect libraries: "
"{0}".format(lib_folder))
return []
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Agree, sounds like a continue instead should make it. Specially because the behavior of conan when no folder exist or is empty for includedirs, libdirs, etc, is ignore them.

Add a test covering this case, please.

@ghost ghost assigned danimtb Sep 24, 2018
@danimtb danimtb removed their assignment Sep 24, 2018
@lasote lasote merged commit e0ac828 into conan-io:develop Sep 25, 2018
@ghost ghost removed the stage: review label Sep 25, 2018
grisumbras pushed a commit to grisumbras/conan that referenced this pull request Dec 27, 2018
…io#3503)

* Use self.cpp_info.libdirs as folders for tools.collect_libs()

* warn and continue with test
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

tools.collect_libs() doesn't respect self.cpp_info.libdirs
4 participants