Skip to content
New issue

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

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

Already on GitHub? # to your account

[question] What does "auto_shared_fpic" manage? #3782

Open
1 task done
andrey-zherikov opened this issue Jun 28, 2024 · 4 comments
Open
1 task done

[question] What does "auto_shared_fpic" manage? #3782

andrey-zherikov opened this issue Jun 28, 2024 · 4 comments
Assignees
Milestone

Comments

@andrey-zherikov
Copy link
Contributor

What is your question?

This doc says:

"auto_shared_fpic": automatically manages fPIC and shared options

This says:

Options automatically managed:
- fPIC (True, False).
- shared (True, False).
- header_only (True, False).

And this one says:

Options automatically managed:
- fPIC (True, False).

What does auto_shared_fpic actually do?

Have you read the CONTRIBUTING guide?

  • I've read the CONTRIBUTING guide
@andrey-zherikov
Copy link
Contributor Author

Note that if I don't have shared in options, conan 2.4.1 errors out:

ERROR: mylib/1.0: Package type is 'library', but no 'shared' option declared

@memsharded
Copy link
Member

Hi @andrey-zherikov

Thanks for your question.

This is the injected code:

# injected in ``config_options()`` method
def auto_shared_fpic_config_options(conanfile):
    if conanfile.settings.get_safe("os") == "Windows":
        conanfile.options.rm_safe("fPIC")


# injected in ``configure()`` method
def auto_shared_fpic_configure(conanfile):
    if conanfile.options.get_safe("header_only"):
        conanfile.options.rm_safe("fPIC")
        conanfile.options.rm_safe("shared")
    elif conanfile.options.get_safe("shared"):
        conanfile.options.rm_safe("fPIC")

Note that if I don't have shared in options, conan 2.4.1 errors out:

Yes, this is expected. Defining package_type = "library" means that a shared option must be defined.

Please let me know if this clarifies the issue. Thanks!

@andrey-zherikov
Copy link
Contributor Author

@memsharded Thanks for the clarification! Could you please make documentation clearer and consistent?

@memsharded memsharded transferred this issue from conan-io/conan Jun 28, 2024
@memsharded
Copy link
Member

Sure, moving this to the docs repo. As you can see, the docs is also an open source Git repo, improvements and contributions are also welcomed.

@memsharded memsharded added this to the 2 milestone Jun 28, 2024
# for free to join this conversation on GitHub. Already have an account? # to comment
Projects
None yet
Development

No branches or pull requests

2 participants