Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in / Register
Toggle navigation
O
opencv
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Packages
Packages
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
submodule
opencv
Commits
6cfe4a85
Commit
6cfe4a85
authored
Oct 07, 2016
by
Alexander Alekhin
Committed by
Alexander Alekhin
Oct 07, 2016
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
cmake: fix ocv_check_compiler_flag
parent
dd379ec9
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
26 additions
and
6 deletions
+26
-6
OpenCVUtils.cmake
cmake/OpenCVUtils.cmake
+26
-6
No files found.
cmake/OpenCVUtils.cmake
View file @
6cfe4a85
...
...
@@ -199,7 +199,7 @@ set(OCV_COMPILER_FAIL_REGEX
"[Uu]nknown option"
# HP
"[Ww]arning: [Oo]ption"
# SunPro
"command option .* is not recognized"
# XL
"not supported in this configuration
; ignored"
# AIX
"not supported in this configuration
, ignored"
# AIX (';' is replaced with ',')
"File with unknown suffix passed to linker"
# PGI
"WARNING: unknown flag:"
# Open64
)
...
...
@@ -238,12 +238,25 @@ MACRO(ocv_check_compiler_flag LANG FLAG RESULT)
COMPILE_DEFINITIONS
"
${
FLAG
}
"
OUTPUT_VARIABLE OUTPUT
)
FOREACH
(
_regex
${
OCV_COMPILER_FAIL_REGEX
}
)
IF
(
"
${
OUTPUT
}
"
MATCHES
"
${
_regex
}
"
)
SET
(
${
RESULT
}
0
)
if
(
${
RESULT
}
)
string
(
REPLACE
";"
","
OUTPUT_LINES
"
${
OUTPUT
}
"
)
string
(
REPLACE
"
\n
"
";"
OUTPUT_LINES
"
${
OUTPUT_LINES
}
"
)
foreach
(
_regex
${
OCV_COMPILER_FAIL_REGEX
}
)
if
(
NOT
${
RESULT
}
)
break
()
endif
()
foreach
(
_line
${
OUTPUT_LINES
}
)
if
(
"
${
_line
}
"
MATCHES
"
${
_regex
}
"
)
file
(
APPEND
${
CMAKE_BINARY_DIR
}${
CMAKE_FILES_DIRECTORY
}
/CMakeError.log
"Build output check failed:
\n
"
" Regex: '
${
_regex
}
'
\n
"
" Output line: '
${
_line
}
'
\n
"
)
set
(
${
RESULT
}
0
)
break
()
ENDIF
()
ENDFOREACH
()
endif
()
endforeach
()
endforeach
()
endif
()
IF
(
${
RESULT
}
)
SET
(
${
RESULT
}
1 CACHE INTERNAL
"Test
${
RESULT
}
"
)
...
...
@@ -251,6 +264,13 @@ MACRO(ocv_check_compiler_flag LANG FLAG RESULT)
ELSE
(
${
RESULT
}
)
MESSAGE
(
STATUS
"Performing Test
${
RESULT
}
- Failed"
)
SET
(
${
RESULT
}
""
CACHE INTERNAL
"Test
${
RESULT
}
"
)
file
(
APPEND
${
CMAKE_BINARY_DIR
}${
CMAKE_FILES_DIRECTORY
}
/CMakeError.log
"Compilation failed:
\n
"
" source file: '
${
_fname
}
'
\n
"
" check option: '
${
FLAG
}
'
\n
"
"===== BUILD LOG =====
\n
"
"
${
OUTPUT
}
\n
"
"===== END =====
\n\n
"
)
ENDIF
(
${
RESULT
}
)
else
()
SET
(
${
RESULT
}
0
)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment