summaryrefslogtreecommitdiff
path: root/backend/src/CMakeLists.txt
diff options
context:
space:
mode:
authorZhigang Gong <zhigang.gong@intel.com>2014-01-09 17:36:37 +0800
committerZhigang Gong <zhigang.gong@intel.com>2014-01-10 17:27:55 +0800
commit32ac28b2b66e571ab190a6ea4487ad809390df83 (patch)
tree0b0154497cd1e61ae38194cedf2fe73f91bf2a22 /backend/src/CMakeLists.txt
parentc9d1b85a151ed3918a65584b654e5ff059a7724c (diff)
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. Signed-off-by: Zhigang Gong <zhigang.gong@intel.com>
Diffstat (limited to 'backend/src/CMakeLists.txt')
-rw-r--r--backend/src/CMakeLists.txt8
1 files changed, 6 insertions, 2 deletions
diff --git a/backend/src/CMakeLists.txt b/backend/src/CMakeLists.txt
index d19cb50e..d15e7b77 100644
--- a/backend/src/CMakeLists.txt
+++ b/backend/src/CMakeLists.txt
@@ -195,9 +195,13 @@ TARGET_LINK_LIBRARIES(gbe_bin_generater gbe)
install (FILES ${ocl_blob_file} DESTINATION lib/beignet)
install (FILES ${pch_object} DESTINATION lib/beignet)
install (FILES ${CMAKE_CURRENT_BINARY_DIR}/${pcm_lib} DESTINATION lib/beignet)
+# When build beignet itself, we need to export the local precompiled header file and precompiled module
+# file to libcl and utests.
+set (LOCAL_PCH_OBJECT_DIR "${local_pch_object}:${beignet_install_path}/ocl_stdlib.h.pch" PARENT_SCOPE)
+set (LOCAL_PCM_OBJECT_DIR "${CMAKE_CURRENT_BINARY_DIR}/${pcm_lib}:${beignet_install_path}/${pcm_lib}" PARENT_SCOPE)
-set (PCH_OBJECT_DIR "${local_pch_object};${beignet_install_path}/ocl_stdlib.h.pch")
-set (PCM_LIB_DIR "${CMAKE_CURRENT_BINARY_DIR}/${pcm_lib};${beignet_install_path}/${pcm_lib}")
+set (PCH_OBJECT_DIR "${beignet_install_path}/ocl_stdlib.h.pch")
+set (PCM_OBJECT_DIR "${beignet_install_path}/${pcm_lib}")
configure_file (
"GBEConfig.h.in"
"GBEConfig.h"