[WIP] Try to support header only mode for core library.#2832
Open
LanderlYoung wants to merge 3 commits intogoogle:masterfrom
Open
[WIP] Try to support header only mode for core library.#2832LanderlYoung wants to merge 3 commits intogoogle:masterfrom
LanderlYoung wants to merge 3 commits intogoogle:masterfrom
Conversation
|
Thanks for your pull request! It looks like this may be your first contribution to a Google open source project. Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA). View this failed invocation of the CLA check for more information. For the most up to date status, view the checks section at the bottom of the pull request. |
369cf59 to
a907356
Compare
1. Added the `inline` keyword to all functions in the `.cc` files. 2. Changed all anonymous namespaces to a named namespace (`detail`) in the `.cc` files. 3. Changed static class field to inline global variable. 4. Included the `.cc` file from its corresponding header file. An `INTERFACE` library has been added.
a907356 to
6e8b293
Compare
jan-wassenberg
requested changes
Jan 6, 2026
Member
jan-wassenberg
left a comment
There was a problem hiding this comment.
Very nice! I could imagine landing a change like this. Some comments:
| } // namespace detail | ||
|
|
||
| HWY_HEADER_ONLY_FUN | ||
| HWY_DLLEXPORT int Unpredictable1() { return timer::Start() != ~0ULL; } |
Member
There was a problem hiding this comment.
Might be worthwhile to merge these into a HWY_HEADER_ONLY_EXPORT?
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This is a super WIP (Work in Progress) attempt, shared for discussion purposes. Hope it's not too disruptive.
Code Changes
To enable header-only mode, the following changes have been made:
inlinekeyword to all functions in the.ccfiles.detail) in the.ccfiles..ccfile from its corresponding header file.CMake Changes
An
INTERFACElibrary has been added.TODO
pre_target.ccfile is not yet completed, as it relies onfor_each.hwith some magical macros 😸.HWY_HEADER_ONLY_FUNmacro seems a bit clumsy; perhaps just using theinlinekeyword would be better.References