| # Copyright 2020 The Chromium Authors. All rights reserved. |
| # Use of this source code is governed by a BSD-style license that can be |
| # found in the LICENSE file. |
| |
| # This config is applied to targets that depend on libhwy |
| config("libhwy_external_config") { |
| include_dirs = [ "src" ] |
| defines = [] |
| if (target_cpu == "x86") { |
| # Highway automatically disables AVX2 and AVX3 targets when compiling in |
| # 32-bit mode due to bugs in the generated code. However, when doing so it |
| # prints a warning (#pragma message). This flag silences that warning by |
| # explicitly disabling AVX2 and AVX3 targets. |
| defines += [ "HWY_BROKEN_TARGETS=(HWY_AVX2|HWY_AVX3)" ] |
| } |
| } |
| |
| source_set("libhwy") { |
| sources = [ |
| "src/hwy/aligned_allocator.cc", |
| "src/hwy/targets.cc", |
| ] |
| |
| public_configs = [ ":libhwy_external_config" ] |
| } |