[pstl] Properly extract the version number from pstl_config.h
Previously, we'd be performing math on `#define PSTL_VERSION NNN` instead of just `NNN`. It seems like older CMakes didn't complain, but newer CMakes do complain because it doesn't make sense. llvm-svn: 355918
This commit is contained in:
parent
e62e93e1d8
commit
0f4ce2b0d7
|
@ -10,7 +10,7 @@ list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/cmake")
|
|||
|
||||
set(PARALLELSTL_VERSION_FILE "${CMAKE_CURRENT_SOURCE_DIR}/include/pstl/internal/pstl_config.h")
|
||||
file(STRINGS "${PARALLELSTL_VERSION_FILE}" PARALLELSTL_VERSION_SOURCE REGEX "#define PSTL_VERSION .*$")
|
||||
string(REGEX MATCH "#define PSTL_VERSION (.*)$" PARALLELSTL_VERSION_SOURCE "${PARALLELSTL_VERSION_SOURCE}")
|
||||
string(REGEX REPLACE "#define PSTL_VERSION (.*)$" "\\1" PARALLELSTL_VERSION_SOURCE "${PARALLELSTL_VERSION_SOURCE}")
|
||||
math(EXPR VERSION_MAJOR "${PARALLELSTL_VERSION_SOURCE} / 100")
|
||||
math(EXPR VERSION_MINOR "${PARALLELSTL_VERSION_SOURCE} % 100")
|
||||
|
||||
|
|
Loading…
Reference in New Issue