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

Conditional Inclusion from External Libraries #1285

Open
cgubbin opened this issue Nov 10, 2023 · 0 comments
Open

Conditional Inclusion from External Libraries #1285

cgubbin opened this issue Nov 10, 2023 · 0 comments

Comments

@cgubbin
Copy link

cgubbin commented Nov 10, 2023

I am trying to compile a C++ module into an existing Rust codebase. My C++ code depends on a large external library, but only uses a small subset of that libraries exposed features.

When I try to compile my code using cxx I get warnings about missing headers. These come from files in the external library, but all the missing headers are conditionally included. For example:

#ifdef WITH_TBB
#  include <tbb/blocked_range.h>
#endif

My library does not set these flags, and does not use the missing modules.

I appreciate that by default cxx has no way of knowing whether these flags are set, so probably can't tell whether I do or do not require these components and is conservatively assuming everything is necessary.

Is there a way to tell cxx certain conditional imports are not required? Or do I need to try and install all the missing modules?

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

No branches or pull requests

1 participant