diff options
Diffstat (limited to 'recipes-devtools/spirv-llvm-translator')
3 files changed, 100 insertions, 0 deletions
diff --git a/recipes-devtools/spirv-llvm-translator/spirv-llvm-translator/0001-Use-12.0.0-for-base-llvm-version.patch b/recipes-devtools/spirv-llvm-translator/spirv-llvm-translator/0001-Use-12.0.0-for-base-llvm-version.patch new file mode 100644 index 0000000..b52d97b --- /dev/null +++ b/recipes-devtools/spirv-llvm-translator/spirv-llvm-translator/0001-Use-12.0.0-for-base-llvm-version.patch | |||
@@ -0,0 +1,26 @@ | |||
1 | From 1e38777c321605d13f9ad254880e73459877d7da Mon Sep 17 00:00:00 2001 | ||
2 | From: Khem Raj <raj.khem@gmail.com> | ||
3 | Date: Sun, 14 Feb 2021 18:43:21 -0800 | ||
4 | Subject: [PATCH] Use 12.0.0 for base llvm version | ||
5 | |||
6 | Upstream-Status: Pending | ||
7 | Signed-off-by: Khem Raj <raj.khem@gmail.com> | ||
8 | --- | ||
9 | CMakeLists.txt | 2 +- | ||
10 | 1 file changed, 1 insertion(+), 1 deletion(-) | ||
11 | |||
12 | diff --git a/CMakeLists.txt b/CMakeLists.txt | ||
13 | index 0ddb55ce..a9cd1978 100644 | ||
14 | --- a/CMakeLists.txt | ||
15 | +++ b/CMakeLists.txt | ||
16 | @@ -1,6 +1,6 @@ | ||
17 | cmake_minimum_required(VERSION 3.3) | ||
18 | |||
19 | -set (BASE_LLVM_VERSION 13.0.0) | ||
20 | +set (BASE_LLVM_VERSION 12.0.0) | ||
21 | set(LLVM_SPIRV_VERSION ${BASE_LLVM_VERSION}.0) | ||
22 | |||
23 | option(LLVM_SPIRV_INCLUDE_TESTS | ||
24 | -- | ||
25 | 2.30.1 | ||
26 | |||
diff --git a/recipes-devtools/spirv-llvm-translator/spirv-llvm-translator/0001-cmake-allow-to-enable-disable-ccache.patch b/recipes-devtools/spirv-llvm-translator/spirv-llvm-translator/0001-cmake-allow-to-enable-disable-ccache.patch new file mode 100644 index 0000000..68cdda4 --- /dev/null +++ b/recipes-devtools/spirv-llvm-translator/spirv-llvm-translator/0001-cmake-allow-to-enable-disable-ccache.patch | |||
@@ -0,0 +1,32 @@ | |||
1 | From 13b679eb76e6877b40fd41b91e71cb172bcf7b26 Mon Sep 17 00:00:00 2001 | ||
2 | From: Naveen Saini <naveen.kumar.saini@intel.com> | ||
3 | Date: Thu, 4 Mar 2021 11:23:20 +0800 | ||
4 | Subject: [PATCH] cmake: allow to enable/disable ccache | ||
5 | |||
6 | By default ccache is enabled. | ||
7 | |||
8 | Upstream-Status: Submitted [https://github.com/KhronosGroup/SPIRV-LLVM-Translator/pull/930] | ||
9 | |||
10 | Signed-off-by: Naveen Saini <naveen.kumar.saini@intel.com> | ||
11 | --- | ||
12 | CMakeLists.txt | 3 ++- | ||
13 | 1 file changed, 2 insertions(+), 1 deletion(-) | ||
14 | |||
15 | diff --git a/CMakeLists.txt b/CMakeLists.txt | ||
16 | index 0ddb55c..c7d0498 100644 | ||
17 | --- a/CMakeLists.txt | ||
18 | +++ b/CMakeLists.txt | ||
19 | @@ -50,8 +50,9 @@ if(LLVM_SPIRV_BUILD_EXTERNAL) | ||
20 | |||
21 | message(STATUS "Found LLVM: ${LLVM_VERSION}") | ||
22 | |||
23 | + option(CCACHE_ALLOWED "allow use of ccache" TRUE) | ||
24 | find_program(CCACHE_EXE_FOUND ccache) | ||
25 | - if(CCACHE_EXE_FOUND) | ||
26 | + if(CCACHE_EXE_FOUND AND CCACHE_ALLOWED) | ||
27 | message(STATUS "Found ccache: ${CCACHE_EXE_FOUND}") | ||
28 | set_property(GLOBAL PROPERTY RULE_LAUNCH_COMPILE ccache) | ||
29 | set_property(GLOBAL PROPERTY RULE_LAUNCH_LINK ccache) | ||
30 | -- | ||
31 | 2.17.1 | ||
32 | |||
diff --git a/recipes-devtools/spirv-llvm-translator/spirv-llvm-translator_git.bb b/recipes-devtools/spirv-llvm-translator/spirv-llvm-translator_git.bb new file mode 100644 index 0000000..171d54f --- /dev/null +++ b/recipes-devtools/spirv-llvm-translator/spirv-llvm-translator_git.bb | |||
@@ -0,0 +1,42 @@ | |||
1 | LICENSE = "NCSA" | ||
2 | LIC_FILES_CHKSUM = "file://LICENSE.TXT;md5=47e311aa9caedd1b3abf098bd7814d1d" | ||
3 | |||
4 | BRANCH = "llvm_release_120" | ||
5 | SRC_URI = "git://github.com/KhronosGroup/SPIRV-LLVM-Translator/;protocol=https;branch=${BRANCH} \ | ||
6 | file://0001-Use-12.0.0-for-base-llvm-version.patch \ | ||
7 | file://0001-cmake-allow-to-enable-disable-ccache.patch \ | ||
8 | " | ||
9 | |||
10 | PV = "12.0.0" | ||
11 | SRCREV = "c65388fcd4eac9ce070fc330d5fe263ba2c72d66" | ||
12 | |||
13 | S = "${WORKDIR}/git" | ||
14 | |||
15 | DEPENDS = "spirv-tools clang" | ||
16 | |||
17 | inherit cmake pkgconfig python3native | ||
18 | |||
19 | OECMAKE_GENERATOR = "Unix Makefiles" | ||
20 | |||
21 | # Specify any options you want to pass to cmake using EXTRA_OECMAKE: | ||
22 | EXTRA_OECMAKE = "\ | ||
23 | -DBUILD_SHARED_LIBS=ON \ | ||
24 | -DLLVM_SPIRV_BUILD_EXTERNAL=YES \ | ||
25 | -DCMAKE_BUILD_TYPE=Release \ | ||
26 | -DCMAKE_POSITION_INDEPENDENT_CODE=ON \ | ||
27 | -DCMAKE_SKIP_RPATH=ON \ | ||
28 | -DLLVM_EXTERNAL_LIT=lit \ | ||
29 | -DLLVM_INCLUDE_TESTS=ON \ | ||
30 | -Wno-dev \ | ||
31 | -DCCACHE_ALLOWED=FALSE \ | ||
32 | " | ||
33 | |||
34 | do_compile_append() { | ||
35 | oe_runmake llvm-spirv | ||
36 | } | ||
37 | |||
38 | do_install_append() { | ||
39 | install -Dm755 ${B}/tools/llvm-spirv/llvm-spirv ${D}${bindir}/llvm-spirv | ||
40 | } | ||
41 | |||
42 | BBCLASSEXTEND = "native nativesdk" | ||