Applied patch for IPP linking under MinGW (thanks to Philippe FOUBERT) #1906

This commit is contained in:
Andrey Kamaev 2012-05-14 14:56:17 +00:00
parent 26fb7603c0
commit 9275adff81

View File

@ -220,11 +220,11 @@ function(set_ipp_variables _LATEST_VERSION)
endfunction() endfunction()
# ------------------------------------------------------------------------ # ------------------------------------------------------------------------
# This section will look for IPP through IPPROOT env variable # This section will look for IPP through IPPROOT env variable
# Note, IPPROOT is not set by IPP installer, you may need to set it manually # Note, IPPROOT is not set by IPP installer, you may need to set it manually
# ------------------------------------------------------------------------ # ------------------------------------------------------------------------
find_path( find_path(
IPP_H_PATH IPP_H_PATH
NAMES ippversion.h NAMES ippversion.h
PATHS $ENV{IPPROOT} PATHS $ENV{IPPROOT}
@ -233,8 +233,7 @@ endfunction()
NO_DEFAULT_PATH NO_DEFAULT_PATH
NO_CMAKE_PATH) NO_CMAKE_PATH)
if(IPP_H_PATH) if(IPP_H_PATH)
set(IPP_FOUND 1) set(IPP_FOUND 1)
# traverse up to IPPROOT level # traverse up to IPPROOT level
@ -251,14 +250,10 @@ endfunction()
# set IPP INCLUDE, LIB dirs and library names # set IPP INCLUDE, LIB dirs and library names
set_ipp_variables(${IPP_LATEST_VERSION_STR}) set_ipp_variables(${IPP_LATEST_VERSION_STR})
endif()
endif()
if(IPP_FOUND) if(NOT IPP_FOUND)
return()
endif()
# reset var from previous search # reset var from previous search
set(IPP_H_PATH) set(IPP_H_PATH)
@ -304,8 +299,9 @@ endfunction()
endforeach() endforeach()
endif() endif()
endforeach() endforeach()
endif()
if(IPP_FOUND) if(IPP_FOUND)
# set IPP INCLUDE, LIB dirs and library names # set IPP INCLUDE, LIB dirs and library names
set_ipp_variables(${IPP_LATEST_VERSION_STR}) set_ipp_variables(${IPP_LATEST_VERSION_STR})
@ -319,4 +315,22 @@ endfunction()
DOC "The path to Intel(R) IPP header files" DOC "The path to Intel(R) IPP header files"
NO_DEFAULT_PATH NO_DEFAULT_PATH
NO_CMAKE_PATH) NO_CMAKE_PATH)
endif() endif()
if(WIN32 AND MINGW AND NOT IPP_LATEST_VERSION_MAJOR LESS 7)
# Since IPP built with Microsoft compiler and /GS option
# ======================================================
# From Windows SDK 7.1
# (usually in "C:\Program Files\Microsoft Visual Studio 10.0\VC\lib"),
# to avoid undefined reference to __security_cookie and _chkstk:
set(MSV_RUNTMCHK "RunTmChk")
set(IPP_LIBRARIES ${IPP_LIBRARIES} ${MSV_RUNTMCHK}${IPP_LIB_SUFFIX})
# To avoid undefined reference to _alldiv and _chkstk
# ===================================================
# NB: it may require a recompilation of w32api (after having modified
# the file ntdll.def) to export the required functions
# See http://code.opencv.org/issues/1906 for additional details
set(MSV_NTDLL "ntdll")
set(IPP_LIBRARIES ${IPP_LIBRARIES} ${MSV_NTDLL}${IPP_LIB_SUFFIX})
endif()