Commit 0b3c9052 authored by Tom Finegan's avatar Tom Finegan
Browse files

Correct cmake intrinsic flag translation.

MSVC only. Use the AVX/AVX2 flags only for AVX and AVX2. Ignore
the SSE flags since they're not needed with MSVC.

BUG=https://bugs.chromium.org/p/aomedia/issues/detail?id=76

Change-Id: I0f3ac40ffb1f9c53a16272f0781df176317732f6
parent 15338d5f
......@@ -12,13 +12,13 @@
# Translate $flag to one which MSVC understands, and write the new flag to the
# variable named by $translated_flag (or unset it, when MSVC needs no flag).
function (get_msvc_intrinsic_flag flag translated_flag)
if ("${flag}" STREQUAL "-msse2")
# MSVC does not require a flag for SSE2 (as of MSVS 14).
unset(${translated_flag} PARENT_SCOPE)
if ("${flag}" STREQUAL "-mavx")
set(${translated_flag} "/arch:AVX" PARENT_SCOPE)
elseif ("${flag}" STREQUAL "-mavx2")
set(${translated_flag} "/arch:AVX2" PARENT_SCOPE)
else ()
set(${translated_flag} "/arch:AVX" PARENT_SCOPE)
# MSVC does not need flags for intrinsics flavors other than AVX/AVX2.
unset(${translated_flag} PARENT_SCOPE)
endif ()
endfunction ()
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment