fix cmake

* enable fp16 feature correctly with gcc on x86/x86_64
This commit is contained in:
Tomoaki Teshima 2016-06-06 18:49:12 +09:00
parent 4239bac4ed
commit 15f8bc6f37

View File

@ -170,9 +170,6 @@ if(CMAKE_COMPILER_IS_GNUCXX)
add_extra_compiler_option(-mfma) add_extra_compiler_option(-mfma)
endif() endif()
endif() endif()
if((X86 OR X86_64) AND NOT MSVC)
add_extra_compiler_option(-mf16c)
endif((X86 OR X86_64) AND NOT MSVC)
# GCC depresses SSEx instructions when -mavx is used. Instead, it generates new AVX instructions or AVX equivalence for all SSEx instructions when needed. # GCC depresses SSEx instructions when -mavx is used. Instead, it generates new AVX instructions or AVX equivalence for all SSEx instructions when needed.
if(NOT OPENCV_EXTRA_CXX_FLAGS MATCHES "-mavx") if(NOT OPENCV_EXTRA_CXX_FLAGS MATCHES "-mavx")
@ -204,6 +201,9 @@ if(CMAKE_COMPILER_IS_GNUCXX)
add_extra_compiler_option(-mpopcnt) add_extra_compiler_option(-mpopcnt)
endif() endif()
endif() endif()
if((X86 OR X86_64) AND NOT MSVC)
add_extra_compiler_option(-mf16c)
endif((X86 OR X86_64) AND NOT MSVC)
endif(NOT MINGW) endif(NOT MINGW)
if(X86 OR X86_64) if(X86 OR X86_64)