Commit 9743ad34 authored by James Zern's avatar James Zern Committed by Chromium LUCI CQ

libgav1,BUILD.gn: split sse4 files to a separate target

this allows flagging the code with -msse4.1; fixes a build failure with
clang-cl as for msvc builds sse4 support is assumed, but clang-cl
requires the -m flag to enable it.

Bug: 1151489
Change-Id: I3d29e5c3d4985b76ad44e9ca15886c0428c5c140
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2561030
Commit-Queue: James Zern <jzern@google.com>
Reviewed-by: default avatarDale Curtis <dalecurtis@chromium.org>
Reviewed-by: default avatarHirokazu Honda <hiroh@chromium.org>
Cr-Commit-Position: refs/heads/master@{#832690}
parent 03d8f4f7
......@@ -59,10 +59,31 @@ if (enable_libgav1_decoder || use_libgav1_parser) {
configs += [ "//build/config/compiler:no_chromium_code" ]
configs += [ ":private_libgav1_config" ]
deps = [
":libgav1_dsp_sse4",
":libgav1_utils",
]
public_configs = [ ":public_libgav1_config" ]
sources = gav1_dsp_sources + gav1_dsp_headers_sources
}
# SSE4 sources are split to their own target as Chrome is currently built
# with -msse3.
source_set("libgav1_dsp_sse4") {
configs -= [ "//build/config/compiler:chromium_code" ]
configs += [ "//build/config/compiler:no_chromium_code" ]
configs += [ ":private_libgav1_config" ]
deps = [ ":libgav1_utils" ]
public_configs = [ ":public_libgav1_config" ]
sources = gav1_dsp_sources
if (current_cpu == "x86" || current_cpu == "x64") {
cflags = [ "-msse4.1" ]
}
sources = gav1_dsp_sse4_sources + gav1_dsp_sse4_headers_sources +
gav1_dsp_headers_sources
}
static_library("libgav1") {
......
......@@ -101,8 +101,28 @@ func main() {
found := false
for _, d := range topDirs {
if strings.HasPrefix(f, d) {
bd := filepath.Base(d)
m[bd] = append(m[bd], f)
var bd string
for _, asm := range []string{"sse4"} {
pattern := "*_" + asm + "*"
if match, err := filepath.Match(pattern, filepath.Base(f)); err != nil {
panic(err)
} else if match {
bd = filepath.Base(d) + "_" + asm
break
}
}
if bd == "" {
bd = filepath.Base(d)
}
// Split the dsp headers out to their own variables as the
// assembly may depend on both its headers and the top-level
// headers.
if strings.HasPrefix(bd, "dsp") && filepath.Ext(f) == ".h" {
m[bd+"_headers"] = append(m[bd+"_headers"], f)
} else {
m[bd] = append(m[bd], f)
}
found = true
break
}
......
This diff is collapsed.
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