Add the PCH support when building the source.
authorJunyan He <junyan.he@linux.intel.com>
Wed, 17 Jul 2013 08:38:41 +0000 (16:38 +0800)
committerZhigang Gong <zhigang.gong@linux.intel.com>
Wed, 24 Jul 2013 03:51:11 +0000 (11:51 +0800)
commit1f47239299adb1401c50820ee5655e51bbb0a517
tree8e589312b664eb1c459fedcc9b09378108092e30
parenta6f93dce83253cdf086cd547ad21032cd374a13d
Add the PCH support when building the source.

Because the utest grows bigger, the runtime compiling time seems a big
problem to cause the utest_run very slow.  Most of the time wastes on
re-parsing the big header file such as ocl_stdlib.h.
Using the PCH feature of Clang can shorten the compiling time a lot.
Because we build the pch file at building time, but some source
has runtime building option for LLVM, and these options may cause
the compitable problem between the pch header and the CL source code.
We fallback to build the whole header and source when we find the
options are not compitable.

v2 from Zhigang:
Based on junyan's patch, I made the following changes and fixing:
1. Change the way to find correct pch file, now we just define
two possible locations of the header file at build time. Don't
need to query the linker to get correct pch file directory.

2. Use python to generate a big blob of all ocl standard headers
into one file.

3. Fix those broken dependencies in the CMakeLists.txt, now it
works fine.

Signed-off-by: Junyan He <junyan.he@linux.intel.com>
Signed-off-by: Zhigang Gong <zhigang.gong@linux.intel.com>
Reviewed-by: Simon Richter <Simon.Richter@hogyros.de>
backend/CMakeLists.txt
backend/src/CMakeLists.txt
backend/src/GBEConfig.h.in
backend/src/backend/program.cpp
backend/src/ocl_stdlib.tmpl.h
backend/src/update_blob_ocl_header.py