diff options
Diffstat (limited to 'meta/recipes-devtools/clang/libclc_git.bb')
-rw-r--r-- | meta/recipes-devtools/clang/libclc_git.bb | 43 |
1 files changed, 43 insertions, 0 deletions
diff --git a/meta/recipes-devtools/clang/libclc_git.bb b/meta/recipes-devtools/clang/libclc_git.bb new file mode 100644 index 0000000000..ed31de503a --- /dev/null +++ b/meta/recipes-devtools/clang/libclc_git.bb | |||
@@ -0,0 +1,43 @@ | |||
1 | SUMMARY = "Implementation of the library requirements of the OpenCL C programming language." | ||
2 | HOMEPAGE = "https://libclc.llvm.org" | ||
3 | SECTION = "devel" | ||
4 | |||
5 | require common-clang.inc | ||
6 | require common-source.inc | ||
7 | |||
8 | LIC_FILES_CHKSUM = "file://libclc/LICENSE.TXT;md5=7cc795f6cbb2d801d84336b83c8017db" | ||
9 | |||
10 | inherit cmake pkgconfig | ||
11 | |||
12 | # Depend explicitly on clang-native instead of using TOOLCHAIN as the build | ||
13 | # objects from this recipe are build explicitly using clang for GPU targets. | ||
14 | # We could INHIBIT_DEFAULT_DEPS to avoid any other toolchain but then we need | ||
15 | # to wrestle CMake to configure without a toolchain. | ||
16 | DEPENDS += "clang-native spirv-llvm-translator-native" | ||
17 | |||
18 | OECMAKE_SOURCEPATH = "${S}/libclc" | ||
19 | B_NATIVE = "${B}-native" | ||
20 | |||
21 | # Semicolon-separated list of targets to build | ||
22 | LIBCLC_TARGETS ?= "all" | ||
23 | |||
24 | EXTRA_OECMAKE = "-DLIBCLC_TARGETS_TO_BUILD=${LIBCLC_TARGETS} \ | ||
25 | -DPREPARE_BUILTINS=${B_NATIVE}/prepare_builtins" | ||
26 | |||
27 | # Need to build a native prepare_builtins binary in target builds. The easiest | ||
28 | # way to do this is with a second native cmake build tree. | ||
29 | do_build_prepare_builtins() { | ||
30 | cmake --fresh -G Ninja \ | ||
31 | -S ${OECMAKE_SOURCEPATH} -B ${B_NATIVE} \ | ||
32 | -DCMAKE_TOOLCHAIN_FILE:FILEPATH=${WORKDIR}/toolchain-native.cmake \ | ||
33 | -DLIBCLC_TARGETS_TO_BUILD= | ||
34 | cmake --build ${B_NATIVE} --target prepare_builtins | ||
35 | } | ||
36 | do_build_prepare_builtins:class-native() { | ||
37 | : | ||
38 | } | ||
39 | do_configure[prefuncs] += "do_build_prepare_builtins" | ||
40 | |||
41 | FILES:${PN} += "${datadir}/clc" | ||
42 | |||
43 | BBCLASSEXTEND = "native nativesdk" | ||