Auto-generate Version_libclang_bindings module#15
Merged
Conversation
bolt12
force-pushed
the
tcard/Version_libclang_bindings
branch
from
November 20, 2025 10:14
8da389b to
4187d0b
Compare
bolt12
force-pushed
the
tcard/Version_libclang_bindings
branch
from
November 20, 2025 10:21
4187d0b to
ca69eeb
Compare
bolt12
enabled auto-merge
November 20, 2025 10:23
bolt12
force-pushed
the
tcard/Version_libclang_bindings
branch
from
November 20, 2025 10:59
ca69eeb to
bab0424
Compare
bolt12
disabled auto-merge
November 20, 2025 11:11
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 PR adds
clangVersionCompileTime :: Textto theClang.Versionmodule. It is the full version string as reported byclang_getClangVersionat compile-time. This is done so that we can useclang_getClangVersionat run-time and compare the versions (as text, not parsed versions).This works by using
autoconfto link a C program that prints the version. This program is run, and the output is captured. The version string is then written into a Haskell module template, with double quotes escaped. The module is namedVersion_libclang_bindingsto match the naming style of otherautogenmodules. It is exposed internally (inother-modules), andclangVersionCompileTimeis re-exported by public moduleClang.Version.This has not been tested on Windows or macOS yet, but it should work.