Added own CMake macro for compiler flag checks (to not depend on CMake version)

This commit is contained in:
Andrey Kamaev
2012-06-12 16:11:30 +00:00
parent 37212f5e00
commit 4ddcf06404
2 changed files with 55 additions and 19 deletions

View File

@@ -50,15 +50,9 @@ endmacro()
if(MINGW)
# http://gcc.gnu.org/bugzilla/show_bug.cgi?id=40838
# 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_FLAGS "${OPENCV_EXTRA_FLAGS} -mstackrealign")
else()
CHECK_CXX_COMPILER_FLAG(-mpreferred-stack-boundary=2 HAVE_PREFERRED_STACKBOUNDARY_FLAG)
if(HAVE_PREFERRED_STACKBOUNDARY_FLAG)
set(OPENCV_EXTRA_FLAGS "${OPENCV_EXTRA_FLAGS} -mstackrealign")
endif()
add_extra_compiler_option(-mstackrealign)
if(NOT HAVE_CXX_MSTACKREALIGN)
add_extra_compiler_option(-mpreferred-stack-boundary=2)
endif()
endif()