blob: 319071a3119c18f8ae787cba675d6436d924d7c4 [file] [log] [blame]
Brad Bishop1a4b7ee2018-12-16 17:11:34 -08001From fa76d8646bb2b9b514728eeef41afed7c43a36f2 Mon Sep 17 00:00:00 2001
2From: Khem Raj <raj.khem@gmail.com>
3Date: Tue, 11 Sep 2018 18:18:33 -0700
4Subject: [PATCH] Check for clang before using -isystem
5
6When cross compiling with clang, the internal C++ headers are not found
7when adding sysroot to -isystem, that is redundant anyway because it
8will look for headers insider --sysroot path with same quality as it
9would do with -isystem otherwise
10
11Upstream-Status: Submitted [https://github.com/opencv/opencv/pull/12504]
12Signed-off-by: Khem Raj <raj.khem@gmail.com>
13---
14 cmake/OpenCVUtils.cmake | 2 +-
15 1 file changed, 1 insertion(+), 1 deletion(-)
16
17diff --git a/cmake/OpenCVUtils.cmake b/cmake/OpenCVUtils.cmake
18index 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--
312.18.0
32