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

[question] Linking all libs in path #17526

Open
1 task done
nkindt opened this issue Dec 26, 2024 · 3 comments
Open
1 task done

[question] Linking all libs in path #17526

nkindt opened this issue Dec 26, 2024 · 3 comments
Assignees

Comments

@nkindt
Copy link

nkindt commented Dec 26, 2024

What is your question?

I have a big project with another huge project (llvm) embedded as a sub folder which after compilation amounts to over 500 static library files. I already export everything as needed to conan cache and would like to just tell conan to link all libs in my ${prefix}/lib path by specifying the path with a wildcard. In other words i would like it to provide all libs, i.e.:

/path/to/lib/folder/*.a

How could i achieve this?

Have you read the CONTRIBUTING guide?

  • I've read the CONTRIBUTING guide
@nkindt nkindt changed the title Linking all libs in path [question] Linking all libs in path Dec 26, 2024
@franramirez688
Copy link
Contributor

Hi @nkindt,

I assume you're exporting that big project and its libraries through a conanfile. It's quite recommended to declare one library per component, but I think that, as a workaround, you could declare in your big-project-conanfile something like this:

from glob import glob
import os

# ....

def package_info(self):
    self.cpp_info.libs = glob(os.path.join(self.package_folder, "lib", "*.a"))

Then, whenever you consume that one, all the libraries will be there without mentioning each one.

I assume you're exporting that big project and its libraries through a conanfile.

If that's not the case, please, tell me more about how you're exporting that one and how you're trying to consume its libraries (your conanfile.py).

@nkindt
Copy link
Author

nkindt commented Dec 27, 2024

I assume you're exporting that big project and its libraries through a conanfile

It's a project with a conanfile.py and various third_party folder dependencies that are not. All the dependencies are already copied correctly to the cache and another project including it compiles just fine, it's the linker that is giving troubles.

I will spend some time testing this out. Thank you!

@valgur
Copy link
Contributor

valgur commented Dec 28, 2024

There's also collect_libs() that you might find useful.

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

No branches or pull requests

3 participants