Add pregenerated files with all units #178
Merged
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.
The motivating example is to be able to use the library on godbolt. For
this use case, we typically care far more about being comprehensive than
we do about compile times.
To enable this, we first add an
--all-units
flag to the single filescript. This flag will cause the script to act as if the
--units
flaghad been populated with every unit that is known to the library.
(Under the hood, the script has a safety mechanism to make sure that we
actually use every command line parameter in the script. This new
parameter would run afoul of this mechanism, because it's mutually
exclusive with the
--units
argument. Therefore, we use--all-units
to populate
--units
, and then delete--all-units
.)Next, we create build rules that use this new flag to generate
single-file versions with all units, with and without the
<iostream>
dependency. Each new rule gets its own unit test.
Finally, we update the installation docs to provide this option. We
provide an appropriate degree of discouragement for general use, and
clarity around suitable use cases. The godbolt link is currently
"broken" (it doesn't compile), but we expect it to get fixed
automatically once this PR lands.
Test plan:
--units
nor--all-units
: builds with no units.--units
: includes specified units.--all-units
: includes all units.--units
and--all-units
: exits with error.Fixes #174.