From ddcb2bb71b216149d362c69f545d6b454c9b41c1 Mon Sep 17 00:00:00 2001 From: Gabor Buella Date: Mon, 26 Aug 2019 09:42:30 +0000 Subject: [PATCH] [NFC][cmake] Build fix in tools/llvm-config/CMakeLists.txt To avoid the following error message (using cmake version 3.13.4) : ``` CMake Error at tools/llvm-config/CMakeLists.txt:37 (string): Syntax error in cmake code when parsing string-std=[^ ]\+Invalid escape sequence \+ ``` Reviewed By: mgorny Differential Revision: https://reviews.llvm.org/D58619 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@369887 91177308-0d34-0410-b5e6-96231b3b80d8 --- tools/llvm-config/CMakeLists.txt | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/tools/llvm-config/CMakeLists.txt b/tools/llvm-config/CMakeLists.txt index 15a0cf229c1..99466bdf356 100644 --- a/tools/llvm-config/CMakeLists.txt +++ b/tools/llvm-config/CMakeLists.txt @@ -34,9 +34,9 @@ get_property(COMPILE_FLAGS TARGET llvm-config PROPERTY COMPILE_FLAGS) # NOTE: We don't want to start extracting any random C/CXX flags that the # user may add that could affect the ABI. We only want to extract flags # that have been added by the LLVM build system. -string(REGEX MATCH "-std=[^ ]\+" LLVM_CXX_STD_FLAG ${CMAKE_CXX_FLAGS}) -string(REGEX MATCH "-stdlib=[^ ]\+" LLVM_CXX_STDLIB_FLAG ${CMAKE_CXX_FLAGS}) -string(REGEX MATCH "-std=[^ ]\+" LLVM_C_STD_FLAG ${CMAKE_C_FLAGS}) +string(REGEX MATCH "-std=[^ ]+" LLVM_CXX_STD_FLAG ${CMAKE_CXX_FLAGS}) +string(REGEX MATCH "-stdlib=[^ ]+" LLVM_CXX_STDLIB_FLAG ${CMAKE_CXX_FLAGS}) +string(REGEX MATCH "-std=[^ ]+" LLVM_C_STD_FLAG ${CMAKE_C_FLAGS}) # Use configure_file to create BuildVariables.inc. set(LLVM_SRC_ROOT ${LLVM_MAIN_SRC_DIR}) -- 2.40.0