From 5b03fecb8f11c05cdc27b47c4b48c21c3453130c Mon Sep 17 00:00:00 2001 From: "Hutchings Samuel (ETAS/ERS-PRM)" Date: Fri, 7 Oct 2022 12:04:13 +0100 Subject: Tasking: Simplify processor list matching regex --- Modules/Compiler/Tasking.cmake | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Modules/Compiler/Tasking.cmake b/Modules/Compiler/Tasking.cmake index 30d4c69..d0c2f79 100644 --- a/Modules/Compiler/Tasking.cmake +++ b/Modules/Compiler/Tasking.cmake @@ -21,9 +21,9 @@ function(__tasking_set_processor_list lang out_var) execute_process(COMMAND "${CMAKE_${lang}_COMPILER}" --cpu-list OUTPUT_VARIABLE processor_list ERROR_VARIABLE processor_list) - string(REGEX MATCHALL "[ ]+([A-Za-z0-9_]+)[ ]+[^ ]([^ ]+ ?)*[ ]+[A-Za-z0-9\\.]+[ ]+[A-Za-z0-9\.]+\n" processor_list "${processor_list}") + string(REGEX MATCHALL " +([A-Za-z0-9_]+)[^\n]+\n" processor_list "${processor_list}") list(POP_FRONT processor_list) - string(REGEX REPLACE "[ ]+([A-Za-z0-9_]+)[ ]+[^ ]([^ ]+ ?)*[ ]+[A-Za-z0-9\\.]+[ ]+[A-Za-z0-9\.]+\n" "\\1" processor_list "${processor_list}") + string(REGEX REPLACE " +([A-Za-z0-9_]+)[^\n]+\n" "\\1" processor_list "${processor_list}") set(${out_var} "${processor_list}" PARENT_SCOPE) endfunction() -- cgit v0.12