diff options
author | Brad King <brad.king@kitware.com> | 2022-10-07 15:22:38 (GMT) |
---|---|---|
committer | Kitware Robot <kwrobot@kitware.com> | 2022-10-07 15:22:49 (GMT) |
commit | 269652a81468637c03bbdc4ef56e0090ccae78bb (patch) | |
tree | dcf040bf5eeec9af87650f269233aa2d43b4a04d /Modules | |
parent | a07be2ffd18a03cc30153f8bafbe47f8e640eb44 (diff) | |
parent | 5b03fecb8f11c05cdc27b47c4b48c21c3453130c (diff) | |
download | CMake-269652a81468637c03bbdc4ef56e0090ccae78bb.zip CMake-269652a81468637c03bbdc4ef56e0090ccae78bb.tar.gz CMake-269652a81468637c03bbdc4ef56e0090ccae78bb.tar.bz2 |
Merge topic 'Tasking-regex-fix'
5b03fecb8f Tasking: Simplify processor list matching regex
Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !7752
Diffstat (limited to 'Modules')
-rw-r--r-- | Modules/Compiler/Tasking.cmake | 4 |
1 files 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() |