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
3d0f4fe1
Commit
3d0f4fe1
authored
Apr 26, 2012
by
Andrey Kamaev
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fixed compiler flags for debug builds
parent
f208535b
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
18 additions
and
18 deletions
+18
-18
OpenCVCompilerOptions.cmake
cmake/OpenCVCompilerOptions.cmake
+18
-18
No files found.
cmake/OpenCVCompilerOptions.cmake
View file @
3d0f4fe1
...
...
@@ -62,27 +62,27 @@ if(CMAKE_COMPILER_IS_GNUCXX)
# Other optimizations
if
(
ENABLE_OMIT_FRAME_POINTER
)
set
(
OPENCV_EXTRA_C_FLAGS
_RELEASE
"
${
OPENCV_EXTRA_C_FLAGS_RELEASE
}
-fomit-frame-pointer"
)
set
(
OPENCV_EXTRA_C_FLAGS
"
${
OPENCV_EXTRA_C_FLAGS
}
-fomit-frame-pointer"
)
else
()
set
(
OPENCV_EXTRA_C_FLAGS
_RELEASE
"
${
OPENCV_EXTRA_C_FLAGS_RELEASE
}
-fno-omit-frame-pointer"
)
set
(
OPENCV_EXTRA_C_FLAGS
"
${
OPENCV_EXTRA_C_FLAGS
}
-fno-omit-frame-pointer"
)
endif
()
if
(
ENABLE_FAST_MATH
)
set
(
OPENCV_EXTRA_C_FLAGS
_RELEASE
"
${
OPENCV_EXTRA_C_FLAGS_RELEASE
}
-ffast-math"
)
set
(
OPENCV_EXTRA_C_FLAGS
"
${
OPENCV_EXTRA_C_FLAGS
}
-ffast-math"
)
endif
()
if
(
ENABLE_POWERPC
)
set
(
OPENCV_EXTRA_C_FLAGS
_RELEASE
"
${
OPENCV_EXTRA_C_FLAGS_RELEASE
}
-mcpu=G3 -mtune=G5"
)
set
(
OPENCV_EXTRA_C_FLAGS
"
${
OPENCV_EXTRA_C_FLAGS
}
-mcpu=G3 -mtune=G5"
)
endif
()
if
(
ENABLE_SSE
)
set
(
OPENCV_EXTRA_C_FLAGS
_RELEASE
"
${
OPENCV_EXTRA_C_FLAGS_RELEASE
}
-msse"
)
set
(
OPENCV_EXTRA_C_FLAGS
"
${
OPENCV_EXTRA_C_FLAGS
}
-msse"
)
endif
()
if
(
ENABLE_SSE2
)
set
(
OPENCV_EXTRA_C_FLAGS
_RELEASE
"
${
OPENCV_EXTRA_C_FLAGS_RELEASE
}
-msse2"
)
set
(
OPENCV_EXTRA_C_FLAGS
"
${
OPENCV_EXTRA_C_FLAGS
}
-msse2"
)
endif
()
# SSE3 and further should be disabled under MingW because it generates compiler errors
if
(
NOT MINGW
)
if
(
ENABLE_SSE3
)
set
(
OPENCV_EXTRA_C_FLAGS
_RELEASE
"
${
OPENCV_EXTRA_C_FLAGS_RELEASE
}
-msse3"
)
set
(
OPENCV_EXTRA_C_FLAGS
"
${
OPENCV_EXTRA_C_FLAGS
}
-msse3"
)
endif
()
if
(
${
CMAKE_OPENCV_GCC_VERSION_NUM
}
GREATER 402
)
...
...
@@ -94,14 +94,14 @@ if(CMAKE_COMPILER_IS_GNUCXX)
if
(
HAVE_GCC42_OR_NEWER OR APPLE
)
if
(
ENABLE_SSSE3
)
set
(
OPENCV_EXTRA_C_FLAGS
_RELEASE
"
${
OPENCV_EXTRA_C_FLAGS_RELEASE
}
-mssse3"
)
set
(
OPENCV_EXTRA_C_FLAGS
"
${
OPENCV_EXTRA_C_FLAGS
}
-mssse3"
)
endif
()
if
(
HAVE_GCC43_OR_NEWER
)
if
(
ENABLE_SSE41
)
set
(
OPENCV_EXTRA_C_FLAGS
_RELEASE
"
${
OPENCV_EXTRA_C_FLAGS_RELEASE
}
-msse4.1"
)
set
(
OPENCV_EXTRA_C_FLAGS
"
${
OPENCV_EXTRA_C_FLAGS
}
-msse4.1"
)
endif
()
if
(
ENABLE_SSE42
)
set
(
OPENCV_EXTRA_C_FLAGS
_RELEASE
"
${
OPENCV_EXTRA_C_FLAGS_RELEASE
}
-msse4.2"
)
set
(
OPENCV_EXTRA_C_FLAGS
"
${
OPENCV_EXTRA_C_FLAGS
}
-msse4.2"
)
endif
()
endif
()
endif
()
...
...
@@ -110,16 +110,16 @@ if(CMAKE_COMPILER_IS_GNUCXX)
if
(
X86 OR X86_64
)
if
(
NOT APPLE AND CMAKE_SIZEOF_VOID_P EQUAL 4
)
if
(
ENABLE_SSE2
)
set
(
OPENCV_EXTRA_C_FLAGS
_RELEASE
"
${
OPENCV_EXTRA_C_FLAGS_RELEASE
}
-mfpmath=sse"
)
# !! important - be on the same wave with x64 compilers
set
(
OPENCV_EXTRA_C_FLAGS
"
${
OPENCV_EXTRA_C_FLAGS
}
-mfpmath=sse"
)
# !! important - be on the same wave with x64 compilers
else
()
set
(
OPENCV_EXTRA_C_FLAGS
_RELEASE
"
${
OPENCV_EXTRA_C_FLAGS_RELEASE
}
-mfpmath=387"
)
set
(
OPENCV_EXTRA_C_FLAGS
"
${
OPENCV_EXTRA_C_FLAGS
}
-mfpmath=387"
)
endif
()
endif
()
endif
()
# Profiling?
if
(
ENABLE_PROFILING
)
set
(
OPENCV_EXTRA_C_FLAGS
_RELEASE
"
${
OPENCV_EXTRA_C_FLAGS_RELEASE
}
-pg -g"
)
set
(
OPENCV_EXTRA_C_FLAGS
"
${
OPENCV_EXTRA_C_FLAGS
}
-pg -g"
)
# turn off incompatible options
foreach
(
flags CMAKE_CXX_FLAGS CMAKE_C_FLAGS CMAKE_CXX_FLAGS_RELEASE CMAKE_C_FLAGS_RELEASE CMAKE_CXX_FLAGS_DEBUG CMAKE_C_FLAGS_DEBUG OPENCV_EXTRA_C_FLAGS_RELEASE
)
string
(
REPLACE
"-fomit-frame-pointer"
""
${
flags
}
"
${${
flags
}}
"
)
...
...
@@ -141,20 +141,20 @@ if(MSVC)
# 64-bit MSVC compiler uses SSE/SSE2 by default
if
(
NOT MSVC64
)
if
(
ENABLE_SSE
)
set
(
OPENCV_EXTRA_C_FLAGS
_RELEASE
"
${
OPENCV_EXTRA_C_FLAGS_RELEASE
}
/arch:SSE"
)
set
(
OPENCV_EXTRA_C_FLAGS
"
${
OPENCV_EXTRA_C_FLAGS
}
/arch:SSE"
)
endif
()
if
(
ENABLE_SSE2
)
set
(
OPENCV_EXTRA_C_FLAGS
_RELEASE
"
${
OPENCV_EXTRA_C_FLAGS_RELEASE
}
/arch:SSE2"
)
set
(
OPENCV_EXTRA_C_FLAGS
"
${
OPENCV_EXTRA_C_FLAGS
}
/arch:SSE2"
)
endif
()
endif
()
if
(
ENABLE_SSE3
)
set
(
OPENCV_EXTRA_C_FLAGS
_RELEASE
"
${
OPENCV_EXTRA_C_FLAGS_RELEASE
}
/arch:SSE3"
)
set
(
OPENCV_EXTRA_C_FLAGS
"
${
OPENCV_EXTRA_C_FLAGS
}
/arch:SSE3"
)
endif
()
if
(
ENABLE_SSE4_1
)
set
(
OPENCV_EXTRA_C_FLAGS
_RELEASE
"
${
OPENCV_EXTRA_C_FLAGS_RELEASE
}
/arch:SSE4.1"
)
set
(
OPENCV_EXTRA_C_FLAGS
"
${
OPENCV_EXTRA_C_FLAGS
}
/arch:SSE4.1"
)
endif
()
if
(
ENABLE_SSE OR ENABLE_SSE2 OR ENABLE_SSE3 OR ENABLE_SSE4_1
)
set
(
OPENCV_EXTRA_C_FLAGS
_RELEASE
"
${
OPENCV_EXTRA_C_FLAGS_RELEASE
}
/Oi"
)
set
(
OPENCV_EXTRA_C_FLAGS
"
${
OPENCV_EXTRA_C_FLAGS
}
/Oi"
)
endif
()
endif
()
...
...
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