[Beignet] [PATCH 2/3] Modify the CMakeLists file for PCH build
junyan.he at inbox.com
junyan.he at inbox.com
Thu Dec 12 23:30:57 PST 2013
From: Junyan He <junyan.he at linux.intel.com>
Signed-off-by: Junyan He <junyan.he at linux.intel.com>
---
backend/src/CMakeLists.txt | 32 +++++++++++++++-----------------
1 file changed, 15 insertions(+), 17 deletions(-)
diff --git a/backend/src/CMakeLists.txt b/backend/src/CMakeLists.txt
index 36bf688..3d16038 100644
--- a/backend/src/CMakeLists.txt
+++ b/backend/src/CMakeLists.txt
@@ -36,23 +36,13 @@ add_custom_command(
DEPENDS ${ocl_gen_blob_cmd} ${ocl_stdlib_tmpl_file} ${ocl_common_header_file} ${ocl_vector_file} ${ocl_as_file} ${ocl_convert_file})
-set (pch_object ${ocl_blob_file}.pch)
+set (pch_object ocl_pch.pch ocl_pch-cl-std=CL1.1.pch ocl_pch-cl-single-precision-constant.pch)
# generate pch object
-if (LLVM_VERSION_NODOT VERSION_GREATER 32)
- set (clang_cmd -cc1 -x cl -triple spir -ffp-contract=off -emit-pch)
-else (LLVM_VERSION_NODOT VERSION_GREATER 32)
- if (LLVM_VERSION_NODOT VERSION_GREATER 31)
- set (clang_cmd -cc1 -x cl -triple nvptx -ffp-contract=off -emit-pch)
- else (LLVM_VERSION_NODOT VERSION_GREATER 31)
- set (clang_cmd -cc1 -x cl -triple ptx32 -emit-pch)
- endif (LLVM_VERSION_NODOT VERSION_GREATER 31)
-endif (LLVM_VERSION_NODOT VERSION_GREATER 32)
-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} ${ocl_blob_file} -o ${pch_object}
+ OUTPUT ${pch_object} ocl_pch.version
+ COMMAND rm -f ${pch_object} ocl_pch.version
+ COMMAND ./gen_ocl_pch.sh -p./
+ COMMAND cp ocl_pch.pch ${CMAKE_CURRENT_BINARY_DIR}/../../src/
DEPENDS ${ocl_blob_file}
)
@@ -160,10 +150,18 @@ ADD_EXECUTABLE(gbe_bin_generater gbe_bin_generater.cpp)
TARGET_LINK_LIBRARIES(gbe_bin_generater gbe)
install (TARGETS gbe LIBRARY DESTINATION lib)
-install (FILES ${pch_object} DESTINATION lib)
+install (FILES ${pch_object} DESTINATION share/beignet)
+install (FILES ocl_pch.version DESTINATION share/beignet)
+install (FILES ocl_stdlib.h DESTINATION share/beignet)
install (FILES backend/program.h DESTINATION include/gen)
-set (PCH_OBJECT_DIR "${pch_object};${CMAKE_INSTALL_PREFIX}/lib/ocl_stdlib.h.pch")
+set(pch_install_files "")
+set(pch_srcdir_files "")
+foreach(f ${pch_object})
+ set(pch_install_files ${pch_install_files};${CMAKE_INSTALL_PREFIX}/share/beignet/${f})
+endforeach(f)
+
+set (PCH_OBJECT_DIR "${pch_object};${pch_install_files}")
configure_file (
"GBEConfig.h.in"
"GBEConfig.h"
--
1.8.3.2
More information about the Beignet
mailing list