[libcxx-commits] [pstl] r355918 - [pstl] Properly extract the version number from pstl_config.h

Louis Dionne via libcxx-commits libcxx-commits at lists.llvm.org
Tue Mar 12 06:48:26 PDT 2019


Author: ldionne
Date: Tue Mar 12 06:48:25 2019
New Revision: 355918

URL: http://llvm.org/viewvc/llvm-project?rev=355918&view=rev
Log:
[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.

Modified:
    pstl/trunk/CMakeLists.txt

Modified: pstl/trunk/CMakeLists.txt
URL: http://llvm.org/viewvc/llvm-project/pstl/trunk/CMakeLists.txt?rev=355918&r1=355917&r2=355918&view=diff
==============================================================================
--- pstl/trunk/CMakeLists.txt (original)
+++ pstl/trunk/CMakeLists.txt Tue Mar 12 06:48:25 2019
@@ -10,7 +10,7 @@ list(APPEND CMAKE_MODULE_PATH "${CMAKE_C
 
 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")
 




More information about the libcxx-commits mailing list