diff options
3 files changed, 64 insertions, 0 deletions
diff --git a/meta-oe/recipes-support/opencv/opencv/0001-Check-for-clang-before-using-isystem.patch b/meta-oe/recipes-support/opencv/opencv/0001-Check-for-clang-before-using-isystem.patch new file mode 100644 index 0000000000..319071a311 --- /dev/null +++ b/meta-oe/recipes-support/opencv/opencv/0001-Check-for-clang-before-using-isystem.patch | |||
| @@ -0,0 +1,32 @@ | |||
| 1 | From fa76d8646bb2b9b514728eeef41afed7c43a36f2 Mon Sep 17 00:00:00 2001 | ||
| 2 | From: Khem Raj <raj.khem@gmail.com> | ||
| 3 | Date: Tue, 11 Sep 2018 18:18:33 -0700 | ||
| 4 | Subject: [PATCH] Check for clang before using -isystem | ||
| 5 | |||
| 6 | When cross compiling with clang, the internal C++ headers are not found | ||
| 7 | when adding sysroot to -isystem, that is redundant anyway because it | ||
| 8 | will look for headers insider --sysroot path with same quality as it | ||
| 9 | would do with -isystem otherwise | ||
| 10 | |||
| 11 | Upstream-Status: Submitted [https://github.com/opencv/opencv/pull/12504] | ||
| 12 | Signed-off-by: Khem Raj <raj.khem@gmail.com> | ||
| 13 | --- | ||
| 14 | cmake/OpenCVUtils.cmake | 2 +- | ||
| 15 | 1 file changed, 1 insertion(+), 1 deletion(-) | ||
| 16 | |||
| 17 | diff --git a/cmake/OpenCVUtils.cmake b/cmake/OpenCVUtils.cmake | ||
| 18 | index fae91c165f..60c20192dc 100644 | ||
| 19 | --- a/cmake/OpenCVUtils.cmake | ||
| 20 | +++ b/cmake/OpenCVUtils.cmake | ||
| 21 | @@ -259,7 +259,7 @@ function(ocv_include_directories) | ||
| 22 | ocv_is_opencv_directory(__is_opencv_dir "${dir}") | ||
| 23 | if(__is_opencv_dir) | ||
| 24 | list(APPEND __add_before "${dir}") | ||
| 25 | - elseif(CV_GCC AND NOT CMAKE_CXX_COMPILER_VERSION VERSION_LESS "6.0" AND | ||
| 26 | + elseif(((CV_GCC AND NOT CMAKE_CXX_COMPILER_VERSION VERSION_LESS "6.0") OR CV_CLANG) AND | ||
| 27 | dir MATCHES "/usr/include$") | ||
| 28 | # workaround for GCC 6.x bug | ||
| 29 | else() | ||
| 30 | -- | ||
| 31 | 2.18.0 | ||
| 32 | |||
diff --git a/meta-oe/recipes-support/opencv/opencv/0001-Dont-use-isystem.patch b/meta-oe/recipes-support/opencv/opencv/0001-Dont-use-isystem.patch new file mode 100644 index 0000000000..bf0b80a30b --- /dev/null +++ b/meta-oe/recipes-support/opencv/opencv/0001-Dont-use-isystem.patch | |||
| @@ -0,0 +1,30 @@ | |||
| 1 | From 7144c44ec70dee73a628463b99ffeed74b1a8ef6 Mon Sep 17 00:00:00 2001 | ||
| 2 | From: Khem Raj <raj.khem@gmail.com> | ||
| 3 | Date: Tue, 11 Sep 2018 00:21:18 -0700 | ||
| 4 | Subject: [PATCH] Dont use isystem | ||
| 5 | |||
| 6 | clang really does not like it | ||
| 7 | |||
| 8 | Upstream-Status: Pending | ||
| 9 | |||
| 10 | Signed-off-by: Khem Raj <raj.khem@gmail.com> | ||
| 11 | --- | ||
| 12 | cmake/OpenCVPCHSupport.cmake | 2 ++ | ||
| 13 | 1 file changed, 2 insertions(+) | ||
| 14 | |||
| 15 | diff --git a/cmake/OpenCVPCHSupport.cmake b/cmake/OpenCVPCHSupport.cmake | ||
| 16 | index f9b1b48b65..fe27a136f5 100644 | ||
| 17 | --- a/cmake/OpenCVPCHSupport.cmake | ||
| 18 | +++ b/cmake/OpenCVPCHSupport.cmake | ||
| 19 | @@ -18,6 +18,8 @@ IF(CV_GCC) | ||
| 20 | SET(PCHSupport_FOUND TRUE) | ||
| 21 | ENDIF() | ||
| 22 | |||
| 23 | + SET(CMAKE_INCLUDE_SYSTEM_FLAG_C "-I") | ||
| 24 | + SET(CMAKE_INCLUDE_SYSTEM_FLAG_CXX "-I") | ||
| 25 | SET(_PCH_include_prefix "-I") | ||
| 26 | SET(_PCH_isystem_prefix "-isystem") | ||
| 27 | SET(_PCH_define_prefix "-D") | ||
| 28 | -- | ||
| 29 | 2.18.0 | ||
| 30 | |||
diff --git a/meta-oe/recipes-support/opencv/opencv_3.4.3.bb b/meta-oe/recipes-support/opencv/opencv_3.4.3.bb index 403146e7cd..0a99700b4a 100644 --- a/meta-oe/recipes-support/opencv/opencv_3.4.3.bb +++ b/meta-oe/recipes-support/opencv/opencv_3.4.3.bb | |||
| @@ -51,6 +51,8 @@ SRC_URI = "git://github.com/opencv/opencv.git;name=opencv \ | |||
| 51 | file://0003-To-fix-errors-as-following.patch \ | 51 | file://0003-To-fix-errors-as-following.patch \ |
| 52 | file://fixpkgconfig.patch \ | 52 | file://fixpkgconfig.patch \ |
| 53 | file://0001-Temporarliy-work-around-deprecated-ffmpeg-RAW-functi.patch \ | 53 | file://0001-Temporarliy-work-around-deprecated-ffmpeg-RAW-functi.patch \ |
| 54 | file://0001-Dont-use-isystem.patch \ | ||
| 55 | file://0001-Check-for-clang-before-using-isystem.patch \ | ||
| 54 | " | 56 | " |
| 55 | PV = "3.4.3+git${SRCPV}" | 57 | PV = "3.4.3+git${SRCPV}" |
| 56 | 58 | ||
