[Beignet] [PATCH] FindLLVM: check for empty system-libs variable

Yang, Rong R rong.r.yang at intel.com
Sun Dec 27 17:30:58 PST 2015


Pushed, thanks.

> -----Original Message-----
> From: Beignet [mailto:beignet-bounces at lists.freedesktop.org] On Behalf Of
> Steven Newbury
> Sent: Thursday, December 24, 2015 0:26
> To: beignet at lists.freedesktop.org
> Subject: [Beignet] [PATCH] FindLLVM: check for empty system-libs variable
> 
> When dynamic linking against LLVM, "llvm-config --system-libs" may be
> empty.  Add check for a result before attempting to call REGEX REPLACE with
> an empty variable.
> 
> Signed-off-by: Steven Newbury <steve at snewbury.org.uk>
> ---
>  CMake/FindLLVM.cmake | 2 +++
>  1 file changed, 2 insertions(+)
> 
> diff --git a/CMake/FindLLVM.cmake b/CMake/FindLLVM.cmake index
> a148321..8758026 100644
> --- a/CMake/FindLLVM.cmake
> +++ b/CMake/FindLLVM.cmake
> @@ -99,7 +99,9 @@ execute_process(
>    OUTPUT_VARIABLE LLVM_SYSTEM_LIBS_ORIG
>    OUTPUT_STRIP_TRAILING_WHITESPACE
>  )
> +if (LLVM_SYSTEM_LIBS_ORIG)
>  string(REGEX REPLACE " *\n" "" LLVM_SYSTEM_LIBS
> ${LLVM_SYSTEM_LIBS_ORIG})
> +endif (LLVM_SYSTEM_LIBS_ORIG)
>  endif (LLVM_VERSION_NODOT VERSION_GREATER 34)
> 
>  macro(add_one_lib name)
> --
> 2.6.4


More information about the Beignet mailing list