Skip to content

Commit a34b8d4

Browse files
committed
Merge pull request opencv#7391 from alalek:24_fix_7388
2 parents 72becbb + c181f2f commit a34b8d4

File tree

2 files changed

+4
-6
lines changed

2 files changed

+4
-6
lines changed

cmake/OpenCVPCHSupport.cmake

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -14,12 +14,7 @@
1414

1515
IF(CMAKE_COMPILER_IS_GNUCXX)
1616

17-
EXEC_PROGRAM(
18-
${CMAKE_CXX_COMPILER}
19-
ARGS ${CMAKE_CXX_COMPILER_ARG1} -dumpversion
20-
OUTPUT_VARIABLE gcc_compiler_version)
21-
#MESSAGE("GCC Version: ${gcc_compiler_version}")
22-
IF(gcc_compiler_version VERSION_GREATER "4.2.-1" AND gcc_compiler_version VERSION_LESS "6.0.0")
17+
IF(NOT CMAKE_CXX_COMPILER_VERSION VERSION_LESS "4.2.0")
2318
SET(PCHSupport_FOUND TRUE)
2419
ENDIF()
2520

cmake/OpenCVUtils.cmake

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,9 @@ function(ocv_include_directories)
4141
get_filename_component(__abs_dir "${dir}" ABSOLUTE)
4242
if("${__abs_dir}" MATCHES "^${OpenCV_SOURCE_DIR}" OR "${__abs_dir}" MATCHES "^${OpenCV_BINARY_DIR}")
4343
list(APPEND __add_before "${dir}")
44+
elseif(CMAKE_COMPILER_IS_GNUCXX AND NOT CMAKE_CXX_COMPILER_VERSION VERSION_LESS "6.0" AND
45+
dir MATCHES "/usr/include$")
46+
# workaround for GCC 6.x bug
4447
else()
4548
include_directories(AFTER SYSTEM "${dir}")
4649
endif()

0 commit comments

Comments
 (0)