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

Add support for consumption by projects that use C++ modules #65

Merged
merged 3 commits into from
Feb 27, 2024
Merged

Add support for consumption by projects that use C++ modules #65

merged 3 commits into from
Feb 27, 2024

Conversation

netadr
Copy link
Contributor

@netadr netadr commented Feb 25, 2024

Adds a preprocessor define SAFETYHOOK_USE_CXXMODULES to public-facing headers that allows for the standard library to be included by-module instead of by-header to prevent issues in projects using C++ modules.

@cursey
Copy link
Owner

cursey commented Feb 26, 2024

Can you add an option for this to cmake.toml. Something like the following:

[options]
# ...
SAFETYHOOK_USE_CXXMODULES = false

[conditions]
# ...
use-modules = "SAFETYHOOK_USE_CXXMODULES"

[target.safetyhook]
# ...
compile-definitions.use-modules = ["SAFETYHOOK_USE_CXXMODULES"]

This would let people opt into it via cmake options.

@netadr
Copy link
Contributor Author

netadr commented Feb 26, 2024

@cursey See if this is fine. I used inline CMake because cmkr doesn't have support for INTERFACE-visibility compile definitions, AFAIK.

Copy link
Owner

@cursey cursey left a comment

Choose a reason for hiding this comment

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

LGTM

@cursey cursey merged commit 3f157c8 into cursey:main Feb 27, 2024
5 checks passed
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.

2 participants