Skip to content

Commit c755a88

Browse files
Manu343726foonathan
authored andcommitted
Ignore git tags in llvm-config version numbers (#65)
Some llvm precompiled releases, such as 5.0.0 have a git tag as part of the version number given by their llvm-config, but the rest of the setup (for example, the system includes directory) uses the semantic versioning tag ("5.0.0") only. This commit adds a regex filter to ignore any tag appended to the llvm version number, if any.
1 parent 7c54a84 commit c755a88

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

external/external.cmake

+4
Original file line numberDiff line numberDiff line change
@@ -122,6 +122,10 @@ function(_cppast_find_libclang config_tool min_version force)
122122
# check version
123123
execute_process(COMMAND ${LLVM_CONFIG_BINARY} --version
124124
OUTPUT_VARIABLE llvm_version OUTPUT_STRIP_TRAILING_WHITESPACE)
125+
126+
# Ignore git tags in the version string, get the semver number only
127+
string(REGEX REPLACE "([0-9]).([0-9]).([0-9])(.*)" "\\1.\\2.\\3" llvm_version "${llvm_version}")
128+
125129
if(llvm_version VERSION_LESS min_version)
126130
message(FATAL_ERROR "Outdated LLVM version ${llvm_version}, minimal supported is ${min_version}")
127131
else()

0 commit comments

Comments
 (0)