[Beignet] [PATCH] add support for cross compiler

Zhigang Gong zhigang.gong at linux.intel.com
Sun Apr 27 19:51:39 PDT 2014


The patch LGTM, will push latter.
could you write another patch to update the document
to describe how to use this new feature? Thanks.

On Thu, Apr 24, 2014 at 02:18:00AM +0800, Guo Yejun wrote:
> Signed-off-by: Guo Yejun <yejun.guo at intel.com>
> ---
>  CMake/FindLLVM.cmake       | 2 +-
>  backend/src/CMakeLists.txt | 8 ++++----
>  2 files changed, 5 insertions(+), 5 deletions(-)
> 
> diff --git a/CMake/FindLLVM.cmake b/CMake/FindLLVM.cmake
> index 97ee7db..556b3a9 100644
> --- a/CMake/FindLLVM.cmake
> +++ b/CMake/FindLLVM.cmake
> @@ -84,7 +84,7 @@ endif (LLVM_VERSION_NODOT VERSION_GREATER 34)
>  macro(add_one_lib name)
>    FIND_LIBRARY(CLANG_LIB
>      NAMES ${name}
> -    PATHS ${LLVM_LIBRARY_DIR} )
> +    PATHS ${LLVM_LIBRARY_DIR} NO_DEFAULT_PATH)
>    set(CLANG_LIBRARIES ${CLANG_LIBRARIES} ${CLANG_LIB})
>  	unset(CLANG_LIB CACHE)
>  endmacro()
> diff --git a/backend/src/CMakeLists.txt b/backend/src/CMakeLists.txt
> index 6d0cfa8..2d59644 100644
> --- a/backend/src/CMakeLists.txt
> +++ b/backend/src/CMakeLists.txt
> @@ -58,8 +58,8 @@ set (clang_cmd ${clang_cmd} -fno-builtin -DGEN7_SAMPLER_CLAMP_BORDER_WORKAROUND)
>  add_custom_command(
>       OUTPUT ${pch_object}
>       COMMAND rm -f ${pch_object}
> -     COMMAND clang ${clang_cmd} --relocatable-pch -emit-pch -isysroot ${CMAKE_CURRENT_BINARY_DIR} ${ocl_blob_file} -o ${pch_object}
> -     COMMAND clang ${clang_cmd} -emit-pch ${ocl_blob_file} -o ${local_pch_object}
> +     COMMAND ${CMAKE_BINARY_PATH}clang ${clang_cmd} --relocatable-pch -emit-pch -isysroot ${CMAKE_CURRENT_BINARY_DIR} ${ocl_blob_file} -o ${pch_object}
> +     COMMAND ${CMAKE_BINARY_PATH}clang ${clang_cmd} -emit-pch ${ocl_blob_file} -o ${local_pch_object}
>       DEPENDS ${ocl_blob_file}
>       )
>  
> @@ -71,14 +71,14 @@ macro(ll_add_library ll_lib ll_sources)
>    add_custom_command(
>         OUTPUT  ${ll}.bc
>         COMMAND rm -f ${ll}.bc
> -       COMMAND llvm-as -o ${ll}.bc ${GBE_SOURCE_DIR}/src/${ll}
> +       COMMAND ${CMAKE_BINARY_PATH}llvm-as -o ${ll}.bc ${GBE_SOURCE_DIR}/src/${ll}
>         DEPENDS ${ll}
>         )
>    set (ll_objects ${ll_objects} ${ll}.bc)
>    endforeach (ll ${ll_sources})
>    add_custom_command(
>         OUTPUT ${ll_lib}
> -       COMMAND llvm-link -o ${ll_lib} ${ll_objects}
> +       COMMAND ${CMAKE_BINARY_PATH}llvm-link -o ${ll_lib} ${ll_objects}
>         DEPENDS ${ll_objects}
>         )
>    add_custom_target(${ll_lib}
> -- 
> 1.8.3.2
> 
> _______________________________________________
> Beignet mailing list
> Beignet at lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/beignet


More information about the Beignet mailing list