Split annotation header from codegen tool via APIARY_BUILD_TOOL#2
Merged
Conversation
Add an APIARY_BUILD_TOOL option (default ON) that gates the libtooling
executable separately from the header-only annotation contract.
Previously, descending into this CMakeLists always ran
find_package(Clang/LLVM) and built the apiary executable, and the
apiary_annotations target + its header install only happened as a
side effect of that descent. A consumer that wanted just the APIARY_*
macros (every annotated C++ TU) was forced to pull in the full
Clang/LLVM dev stack, and gating the descent to avoid that silently
dropped the annotation-header install too — leaving find_package(Apiary)
and install trees without apiary/Annotations.hpp.
Now:
* apiary::annotations (INTERFACE) and the include/apiary header install
are unconditional — no Clang/LLVM required.
* find_package(Clang/LLVM), the apiary executable, its links, alias,
and the tool-driven smoke/golden/pyi tests are guarded by
APIARY_BUILD_TOOL. The pure-Python doc_lint test still runs either way.
* The executable joins the ApiaryTargets export only when built;
ApiaryConfig sets APIARY_TOOL_FOUND and documents that apiary::apiary
may be absent in a header-only install.
This lets a consumer (Einsums) vendor the annotation macros in a pure-C++
build while enabling the tool only for bindings generation or docs.
Verified: APIARY_BUILD_TOOL=OFF configures and installs with no
Clang/LLVM and ships include/apiary/Annotations.hpp; =ON finds LLVM and
builds the executable as before.
Signed-off-by: Justin Turney <justin.turney@gmail.com>
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.
Add an APIARY_BUILD_TOOL option (default ON) that gates the libtooling executable separately from the header-only annotation contract.
Previously, descending into this CMakeLists always ran find_package(Clang/LLVM) and built the apiary executable, and the apiary_annotations target + its header install only happened as a side effect of that descent. A consumer that wanted just the APIARY_* macros (every annotated C++ TU) was forced to pull in the full Clang/LLVM dev stack, and gating the descent to avoid that silently dropped the annotation-header install too — leaving find_package(Apiary) and install trees without apiary/Annotations.hpp.
Now:
This lets a consumer (Einsums) vendor the annotation macros in a pure-C++ build while enabling the tool only for bindings generation or docs.
Verified: APIARY_BUILD_TOOL=OFF configures and installs with no Clang/LLVM and ships include/apiary/Annotations.hpp; =ON finds LLVM and builds the executable as before.