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
4a3141ac
Commit
4a3141ac
authored
May 17, 2012
by
Andrey Kamaev
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
#1932 Fixed SSE instability on mingw32
parent
def87eae
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
15 additions
and
15 deletions
+15
-15
OpenCVCompilerOptions.cmake
cmake/OpenCVCompilerOptions.cmake
+15
-15
No files found.
cmake/OpenCVCompilerOptions.cmake
View file @
4a3141ac
if
(
WIN32
)
# mingw compiler is known to produce unstable SSE code with -O3 hence we are trying to use -O2 instead
if
(
CMAKE_COMPILER_IS_GNUCXX
)
foreach
(
flags CMAKE_CXX_FLAGS CMAKE_CXX_FLAGS_RELEASE CMAKE_CXX_FLAGS_DEBUG
)
string
(
REPLACE
"-O3"
"-O2"
${
flags
}
"
${${
flags
}}
"
)
endforeach
()
endif
()
if
(
CMAKE_COMPILER_IS_GNUCC
)
foreach
(
flags CMAKE_C_FLAGS CMAKE_C_FLAGS_RELEASE CMAKE_C_FLAGS_DEBUG
)
string
(
REPLACE
"-O3"
"-O2"
${
flags
}
"
${${
flags
}}
"
)
endforeach
()
endif
()
endif
()
if
(
MSVC
)
if
(
CMAKE_CXX_FLAGS STREQUAL CMAKE_CXX_FLAGS_INIT
)
# override cmake default exception handling option
...
...
@@ -28,6 +13,21 @@ set(OPENCV_EXTRA_EXE_LINKER_FLAGS "")
set
(
OPENCV_EXTRA_EXE_LINKER_FLAGS_RELEASE
""
)
set
(
OPENCV_EXTRA_EXE_LINKER_FLAGS_DEBUG
""
)
if
(
MINGW
)
# mingw compiler is known to produce unstable SSE code
# here we are trying to workaround the problem
include
(
CheckCXXCompilerFlag
)
CHECK_CXX_COMPILER_FLAG
(
-mstackrealign HAVE_STACKREALIGN_FLAG
)
if
(
HAVE_STACKREALIGN_FLAG
)
set
(
OPENCV_EXTRA_C_FLAGS
"
${
OPENCV_EXTRA_C_FLAGS
}
-mstackrealign"
)
else
()
CHECK_CXX_COMPILER_FLAG
(
-mpreferred-stack-boundary=2 HAVE_PREFERRED_STACKBOUNDARY_FLAG
)
if
(
HAVE_PREFERRED_STACKBOUNDARY_FLAG
)
set
(
OPENCV_EXTRA_C_FLAGS
"
${
OPENCV_EXTRA_C_FLAGS
}
-mstackrealign"
)
endif
()
endif
()
endif
()
if
(
CMAKE_COMPILER_IS_GNUCXX
)
# High level of warnings.
set
(
OPENCV_EXTRA_C_FLAGS
"
${
OPENCV_EXTRA_C_FLAGS
}
-Wall"
)
...
...
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