| # Copyright 2024 The Chromium Authors | |
| # Use of this source code is governed by a BSD-style license that can be | |
| # found in the LICENSE file. | |
| # Copied from Chromium //third_party/simdutf/BUILD.gn | |
| import("//build/config/avx512.gni") | |
| config("simdutf_config") { | |
| include_dirs = [ "src" ] | |
| } | |
| source_set("header") { | |
| sources = [ | |
| "simdutf.h", | |
| "src/simdutf.h", | |
| ] | |
| } | |
| source_set("simdutf") { | |
| sources = [ "src/simdutf.cpp" ] | |
| public_deps = [ ":header" ] | |
| public_configs = [ ":simdutf_config" ] | |
| cflags_cc = [ | |
| "-Wno-unused-const-variable", | |
| "-Wno-unused-function", | |
| ] | |
| # TODO(crbug.com/483020951): Replace this with `-Wno-array-bounds-member` if | |
| # that gets implemented. Then patch simdutf and remove this completely. | |
| # Upstream issue: https://github.com/simdutf/simdutf/issues/938 | |
| cflags = [ "-Wno-array-bounds" ] | |
| defines = [] | |
| if (!allow_avx512) { | |
| defines += [ "SIMDUTF_IMPLEMENTATION_ICELAKE=0" ] | |
| } | |
| if (is_win) { | |
| # Supress dllexports when included in chrome.exe. | |
| defines += [ "SIMDUTF_DLLIMPORTEXPORT=" ] | |
| } | |
| configs -= [ "//build/config/compiler:chromium_code" ] | |
| configs += [ "//build/config/compiler:no_chromium_code" ] | |
| if (!is_debug) { | |
| configs -= [ "//build/config/compiler:default_optimization" ] | |
| configs += [ "//build/config/compiler:optimize_speed" ] | |
| } | |
| } |