diff options
-rw-r--r-- | meta-oe/recipes-core/opencl/files/0001-Ignore-Compiler-Warnings.patch | 43 | ||||
-rw-r--r-- | meta-oe/recipes-core/opencl/opencl-cts_2024.08.08.bb | 28 |
2 files changed, 71 insertions, 0 deletions
diff --git a/meta-oe/recipes-core/opencl/files/0001-Ignore-Compiler-Warnings.patch b/meta-oe/recipes-core/opencl/files/0001-Ignore-Compiler-Warnings.patch new file mode 100644 index 0000000000..2e8b52d794 --- /dev/null +++ b/meta-oe/recipes-core/opencl/files/0001-Ignore-Compiler-Warnings.patch | |||
@@ -0,0 +1,43 @@ | |||
1 | From 082ce10dd191f036f5a6e1fb31134e9736ba3643 Mon Sep 17 00:00:00 2001 | ||
2 | From: Antonios Christidis <a-christidis@ti.com> | ||
3 | Date: Fri, 17 Jan 2025 15:05:39 -0600 | ||
4 | Subject: [PATCH] Create CMake option ENABLE_WERROR | ||
5 | |||
6 | This creates an option that can be toggled on or off when configuring the project. | ||
7 | By default, it's set to ON | ||
8 | |||
9 | Upstream-Status: Pending | ||
10 | Signed-off-by: Antonios Christidis <a-christidis@ti.com> | ||
11 | Signed-off-by: Khem Raj <raj.khem@gmail.com> | ||
12 | |||
13 | --- | ||
14 | CMakeLists.txt | 4 +++- | ||
15 | 1 file changed, 3 insertions(+), 1 deletion(-) | ||
16 | |||
17 | --- a/CMakeLists.txt | ||
18 | +++ b/CMakeLists.txt | ||
19 | @@ -19,6 +19,16 @@ add_definitions(-DCL_USE_DEPRECATED_OPEN | ||
20 | add_definitions(-DCL_USE_DEPRECATED_OPENCL_1_0_APIS=1) | ||
21 | add_definitions(-DCL_NO_EXTENSION_PROTOTYPES) | ||
22 | |||
23 | +option(ENABLE_WERROR "Enable warnings as errors" ON) | ||
24 | + | ||
25 | +if(ENABLE_WERROR) | ||
26 | + if(MSVC) | ||
27 | + add_compile_options(/WX) | ||
28 | + else() | ||
29 | + add_compile_options(-Werror) | ||
30 | + endif() | ||
31 | +endif() | ||
32 | + | ||
33 | option(USE_CL_EXPERIMENTAL "Use Experimental definitions" OFF) | ||
34 | if(USE_CL_EXPERIMENTAL) | ||
35 | add_definitions(-DCL_EXPERIMENTAL) | ||
36 | @@ -99,7 +109,6 @@ if(CMAKE_COMPILER_IS_GNUCC OR "${CMAKE_C | ||
37 | add_cxx_flag_if_supported(-Wmisleading-indentation) | ||
38 | add_cxx_flag_if_supported(-Wunused-function) | ||
39 | add_cxx_flag_if_supported(-Wunused-variable) | ||
40 | - add_cxx_flag_if_supported(-Werror) | ||
41 | if(NOT CMAKE_BUILD_TYPE MATCHES "Release|RelWithDebInfo|MinSizeRel") | ||
42 | # Enable more warnings if not doing a release build. | ||
43 | add_cxx_flag_if_supported(-Wall) | ||
diff --git a/meta-oe/recipes-core/opencl/opencl-cts_2024.08.08.bb b/meta-oe/recipes-core/opencl/opencl-cts_2024.08.08.bb new file mode 100644 index 0000000000..69181916b1 --- /dev/null +++ b/meta-oe/recipes-core/opencl/opencl-cts_2024.08.08.bb | |||
@@ -0,0 +1,28 @@ | |||
1 | SUMMARY = "OpenCL CTS" | ||
2 | DESCRIPTION = "OpenCL CTS test suite" | ||
3 | LICENSE = "Apache-2.0" | ||
4 | LIC_FILES_CHKSUM = "file://LICENSE.txt;md5=3b83ef96387f14655fc854ddc3c6bd57" | ||
5 | |||
6 | inherit pkgconfig cmake | ||
7 | |||
8 | DEPENDS += "opencl-headers opencl-icd-loader" | ||
9 | RDEPENDS:${PN} += "python3-core python3-io" | ||
10 | |||
11 | S = "${WORKDIR}/git" | ||
12 | |||
13 | SRC_URI = "git://github.com/KhronosGroup/OpenCL-CTS.git;protocol=https;branch=main;lfs=0 \ | ||
14 | file://0001-Ignore-Compiler-Warnings.patch" | ||
15 | |||
16 | SRCREV = "a406b340913f622da089b00f284a597656c10239" | ||
17 | |||
18 | EXTRA_OECMAKE:append = " -DENABLE_WERROR=OFF -DCL_INCLUDE_DIR=${STAGING_INCDIR} -DCL_LIB_DIR=${STAGING_LIBDIR} -DOPENCL_LIBRARIES=OpenCL" | ||
19 | |||
20 | SECURITY_STRINGFORMAT:remove = "-Werror=format-security" | ||
21 | |||
22 | do_install() { | ||
23 | install -d ${D}${bindir}/opencl_test_conformance | ||
24 | cp -r ${B}/test_conformance/* ${D}${bindir}/opencl_test_conformance | ||
25 | sed -i 's:/usr/bin/python:/usr/bin/python3:g' ${D}${bindir}/opencl_test_conformance/run_conformance.py | ||
26 | find "${D}${bindir}/opencl_test_conformance" -name cmake_install.cmake -type f -delete | ||
27 | find "${D}${bindir}/opencl_test_conformance" -name CMakeFiles -type d -exec rm -rf "{}" \; -depth | ||
28 | } | ||