[LLVMdev] Problem in LLVM CMake modules

Óscar Fuentes ofv at wanadoo.es
Sat Jul 7 17:02:09 PDT 2012


Óscar Fuentes <ofv at wanadoo.es> writes:

> This patch *seems* to fix the problem (cmake regexps are not thoroughly
> documented):
>
> --- a/cmake/modules/LLVM-Config.cmake
> +++ b/cmake/modules/LLVM-Config.cmake
> @@ -160,7 +160,7 @@ function(explicit_map_components_to_libraries out_libs)
>      list(REVERSE expanded_components)
>      list(APPEND processed ${lib})
>      # Find the maximum index that doesn't have to be re-processed:
> -    while(NOT "${expanded_components}" MATCHES "^${processed}.*" )
> +    while(NOT "${expanded_components}" MATCHES "^${processed}(;)|(.*)")
>        list(REMOVE_AT processed -1)
>      endwhile()
>      list(LENGTH processed cursor)

The patch above doesn't make any sense. This looks more correct:

--- a/cmake/modules/LLVM-Config.cmake
+++ b/cmake/modules/LLVM-Config.cmake
@@ -160,7 +160,7 @@ function(explicit_map_components_to_libraries out_libs)
     list(REVERSE expanded_components)
     list(APPEND processed ${lib})
     # Find the maximum index that doesn't have to be re-processed:
-    while(NOT "${expanded_components}" MATCHES "^${processed}.*" )
+    while(NOT "${expanded_components}" MATCHES "^${processed};|$")
       list(REMOVE_AT processed -1)
     endwhile()
     list(LENGTH processed cursor)




More information about the llvm-dev mailing list