-
Notifications
You must be signed in to change notification settings - Fork 4.1k
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
[1/5] support C++20 Modules, add module_interfaces attr #22425
[1/5] support C++20 Modules, add module_interfaces attr #22425
Conversation
src/main/java/com/google/devtools/build/lib/rules/cpp/CppActionConfigs.java
Outdated
Show resolved
Hide resolved
src/main/java/com/google/devtools/build/lib/rules/cpp/CppRuleClasses.java
Outdated
Show resolved
Hide resolved
src/main/java/com/google/devtools/build/lib/starlarkbuildapi/cpp/CcModuleApi.java
Outdated
Show resolved
Hide resolved
src/main/java/com/google/devtools/build/lib/starlarkbuildapi/cpp/CcModuleApi.java
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you add tests in the same PR?
- verify the experimental flag works as expected
- verify cc_binary, cc_test and cc_library work with the new attribute (although do nothing yet)
- verify calling cc_common.compile works with the new parameter
hi @mathstuf, In current implementation, I'm using the With this feature, we can update our codebase bit by bit, turning on C++20 Modules for some code without having to scan every file. |
f512dae
to
4cc08d9
Compare
That's probably fine given what I know of Bazel (that per-source behaviors are discouraged). |
hi @comius , thanks for your comments. Changes Summary
|
src/test/java/com/google/devtools/build/lib/rules/cpp/Cpp20ModulesConfiguredTargetTest.java
Outdated
Show resolved
Hide resolved
src/test/java/com/google/devtools/build/lib/rules/cpp/Cpp20ModulesConfiguredTargetTest.java
Outdated
Show resolved
Hide resolved
src/test/java/com/google/devtools/build/lib/rules/cpp/Cpp20ModulesConfiguredTargetTest.java
Show resolved
Hide resolved
The code was approved by @trybka internally, suggesting to change the name from cpp20_modules to cpp_modules in the code, except in the documentation/some comments. I applied the changes, to move things along a bit faster. The PR will be merged now. |
Do I need to make this change in this patch? |
@PikachuHyA thank you so much for this work, I am looking forward to using C++20 modules in our bazel builds :-) |
I split the XXL PR #19940 into several small patches.
This is the first patch of Support C++20 Modules, I add
module_interfaces
attr onlyexample
build failed with the following message
To build with C++20 Modules, the flag
--experimental_cpp20_modules
must be added.To build with C++20 Modules, the feature
cpp20_modules
must be enabled.the flag
--experimental_cpp20_modules
works on global andthe feature
cpp20_modules
work on each targetbut in this patch, do nothing with C++20 Module Interfaces.