From 6bf0c4457d9977db168e0f24d6ce39dd0cbe2a5f Mon Sep 17 00:00:00 2001 From: Zhigang Gong Date: Thu, 9 Jan 2014 17:36:37 +0800 Subject: Refine the method to find pch and pcm files. When compile user kernels, we need to find the precompiled header file and the precompiled module file. The previous implementation will find the build directory then find the system directory. This is not elegant when it is packaged to a distro. It doesn't need to search the build directory. So I change the default search path to the system directory only. And for the deveoper, I change the build script to set a proper environment variable and make the gbe bin generator and the utest could find the local pch files and pcm files firstly. The only change is now, after the build process. Before the user run the utests, it need to set up the environment firstly. Just invoke . utest/setenv.sh. Then everything should be the same as previous. This setenv.sh also set the OCL_KERNEL_PATH, so you don't need to set it manually now. This patch also update the document. v2: add the missing setenv.sh. Signed-off-by: Zhigang Gong Tested-by: "Song, Ruiling" --- backend/CMakeLists.txt | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'backend/CMakeLists.txt') diff --git a/backend/CMakeLists.txt b/backend/CMakeLists.txt index 476c6f27..dd55a4a6 100644 --- a/backend/CMakeLists.txt +++ b/backend/CMakeLists.txt @@ -91,9 +91,15 @@ elseif (COMPILER STREQUAL "ICC") set (CCMAKE_CXX_FLAGS_MINSIZEREL "-Os -DGBE_DEBUG=0") set (CMAKE_EXE_LINKER_FLAGS "") endif () + include_directories (${CMAKE_CURRENT_BINARY_DIR}) ############################################################## # Project source code ############################################################## add_subdirectory (src) +set(LOCAL_PCH_OBJECT_DIR ${LOCAL_PCH_OBJECT_DIR} PARENT_SCOPE) +set(LOCAL_PCM_OBJECT_DIR ${LOCAL_PCM_OBJECT_DIR} PARENT_SCOPE) +set (GBE_BIN_GENERATER + OCL_PCM_PATH=${LOCAL_PCM_OBJECT_DIR} OCL_PCH_PATH=${LOCAL_PCH_OBJECT_DIR} ${CMAKE_CURRENT_BINARY_DIR}/src/gbe_bin_generater + PARENT_SCOPE) -- cgit v1.2.3