dawn-cmake/third_party/gn/abseil-cpp/BUILD.gn

171 lines
5.7 KiB
Plaintext
Raw Normal View History

# Copyright 2021 The Dawn Authors
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
import("../../../scripts/dawn_overrides_with_defaults.gni")
import("${dawn_root}/scripts/dawn_features.gni")
config("absl_config") {
if (dawn_standalone && is_clang) {
cflags = [
# Allow the use of enable_if()
"-Wno-gcc-compat",
]
}
include_dirs = [ "${dawn_abseil_dir}" ]
}
template("absl_source_set") {
source_set(target_name) {
forward_variables_from(invoker, "*")
if (!defined(public_configs)) {
public_configs = []
}
public_configs += [ ":absl_config" ]
}
}
#
# absl/base
#
absl_source_set("log_severity") {
sources = [ "${dawn_abseil_dir}/absl/base/log_severity.cc" ]
public = [ "${dawn_abseil_dir}/absl/base/log_severity.h" ]
}
absl_source_set("raw_logging_internal") {
sources = [ "${dawn_abseil_dir}/absl/base/internal/raw_logging.cc" ]
public = [ "${dawn_abseil_dir}/absl/base/internal/raw_logging.h" ]
Revert "Enable gn check for all build targets." This reverts commit 61bc38fd52161ce7c0722a966eb4d66315b07cc1. Reason for revert: Appears to have broken the Dawn->Chromium autoroller, which is now seeing Abseil linking issues on Mac and Linux. Example failing roll: https://chromium-review.googlesource.com/c/chromium/src/+/3590451/ Example error log: https://logs.chromium.org/logs/chromium/buildbucket/cr-buildbucket/8816532799903001889/+/u/compile__with_patch_/stdout Log Excerpt: [802/31819] LINK ./dawn_unittests FAILED: dawn_unittests TOOL_VERSION=1650247560 ../../build/toolchain/apple/linker_driver.py -Wcrl,strippath,../../build/mac_files/xcode_binaries/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/strip -Wcrl,installnametoolpath,../../build/mac_files/xcode_binaries/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/install_name_tool ../../third_party/llvm-build/Release+Asserts/bin/clang++ -Werror -fuse-ld=lld -Wl,-fatal_warnings -Wl,--color-diagnostics -arch x86_64 -no-canonical-prefixes -Wl,-dead_strip -nostdlib++ -isysroot ../../build/mac_files/xcode_binaries/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX12.3.sdk -mmacosx-version-min=10.11.0 -fprofile-instr-generate -Wl,-ObjC -rpath @executable_path/ -o "./dawn_unittests" "@./dawn_unittests.rsp" ld64.lld: error: duplicate symbol: __ZN4absl15AsciiStrToLowerEPNSt3__112basic_stringIcNS0_11char_traitsIcEENS0_9allocatorIcEEEE >>> defined in obj/third_party/dawn/third_party/gn/abseil-cpp/strings/ascii.o >>> defined in obj/third_party/abseil-cpp/absl/strings/strings/ascii.o ld64.lld: error: duplicate symbol: __ZN4absl15AsciiStrToUpperEPNSt3__112basic_stringIcNS0_11char_traitsIcEENS0_9allocatorIcEEEE >>> defined in obj/third_party/dawn/third_party/gn/abseil-cpp/strings/ascii.o >>> defined in obj/third_party/abseil-cpp/absl/strings/strings/ascii.o ld64.lld: error: duplicate symbol: __ZN4absl26RemoveExtraAsciiWhitespaceEPNSt3__112basic_stringIcNS0_11char_traitsIcEENS0_9allocatorIcEEEE >>> defined in obj/third_party/dawn/third_party/gn/abseil-cpp/strings/ascii.o >>> defined in obj/third_party/abseil-cpp/absl/strings/strings/ascii.o Original change's description: > Enable gn check for all build targets. > > This CL removes the `check_targets` entry from the .gn file which > will enable checking all targets. Two of the GN targets have had > missing dependencies added. > > The `gn/abseil-cpp/BUILD.gn` was referenced against the Chromium > BUILD.gn for abseil to make sure the `public_deps` and `deps` > match in the two versions. The paths are re-written to match > the Dawn paths. > > Bug: dawn:1372 > Change-Id: I371e17ec9647e6627429be5c81eb7985da3cc5b3 > Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/86861 > Auto-Submit: Dan Sinclair <dsinclair@chromium.org> > Kokoro: Kokoro <noreply+kokoro@google.com> > Reviewed-by: Brandon Jones <bajones@chromium.org> > Reviewed-by: Corentin Wallez <cwallez@chromium.org> > Commit-Queue: Corentin Wallez <cwallez@chromium.org> # Not skipping CQ checks because original CL landed > 1 day ago. Bug: dawn:1372 Change-Id: I1ce6d62138cd99aa3a75c74eea0ac04ce5048b6b Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/87161 Reviewed-by: Brandon Jones <bajones@chromium.org> Auto-Submit: Brandon Jones <bajones@chromium.org> Reviewed-by: Shrek Shao <shrekshao@google.com> Kokoro: Kokoro <noreply+kokoro@google.com> Reviewed-by: Austin Eng <enga@chromium.org> Commit-Queue: Austin Eng <enga@chromium.org>
2022-04-18 17:35:53 +00:00
public_deps = [ ":log_severity" ]
visibility = [ ":*" ]
}
absl_source_set("throw_delegate") {
sources = [ "${dawn_abseil_dir}/absl/base/internal/throw_delegate.cc" ]
public = [ "${dawn_abseil_dir}/absl/base/internal/throw_delegate.h" ]
public_deps = [ ":raw_logging_internal" ]
visibility = [ ":*" ]
}
#
# absl/numeric
#
absl_source_set("int128") {
sources = [
"${dawn_abseil_dir}/absl/numeric/int128.cc",
"${dawn_abseil_dir}/absl/numeric/int128_have_intrinsic.inc",
"${dawn_abseil_dir}/absl/numeric/int128_no_intrinsic.inc",
]
public = [ "${dawn_abseil_dir}/absl/numeric/int128.h" ]
}
#
# absl/strings
#
absl_source_set("strings") {
sources = [
"${dawn_abseil_dir}/absl/strings/ascii.cc",
"${dawn_abseil_dir}/absl/strings/charconv.cc",
"${dawn_abseil_dir}/absl/strings/escaping.cc",
"${dawn_abseil_dir}/absl/strings/internal/charconv_bigint.cc",
"${dawn_abseil_dir}/absl/strings/internal/charconv_bigint.h",
"${dawn_abseil_dir}/absl/strings/internal/charconv_parse.cc",
"${dawn_abseil_dir}/absl/strings/internal/charconv_parse.h",
"${dawn_abseil_dir}/absl/strings/internal/memutil.cc",
"${dawn_abseil_dir}/absl/strings/internal/memutil.h",
"${dawn_abseil_dir}/absl/strings/internal/stl_type_traits.h",
"${dawn_abseil_dir}/absl/strings/internal/str_join_internal.h",
"${dawn_abseil_dir}/absl/strings/internal/str_split_internal.h",
"${dawn_abseil_dir}/absl/strings/match.cc",
"${dawn_abseil_dir}/absl/strings/numbers.cc",
"${dawn_abseil_dir}/absl/strings/str_cat.cc",
"${dawn_abseil_dir}/absl/strings/str_replace.cc",
"${dawn_abseil_dir}/absl/strings/str_split.cc",
"${dawn_abseil_dir}/absl/strings/string_view.cc",
"${dawn_abseil_dir}/absl/strings/substitute.cc",
]
public = [
"${dawn_abseil_dir}/absl/strings/ascii.h",
"${dawn_abseil_dir}/absl/strings/charconv.h",
"${dawn_abseil_dir}/absl/strings/escaping.h",
"${dawn_abseil_dir}/absl/strings/internal/string_constant.h",
"${dawn_abseil_dir}/absl/strings/match.h",
"${dawn_abseil_dir}/absl/strings/numbers.h",
"${dawn_abseil_dir}/absl/strings/str_cat.h",
"${dawn_abseil_dir}/absl/strings/str_join.h",
"${dawn_abseil_dir}/absl/strings/str_replace.h",
"${dawn_abseil_dir}/absl/strings/str_split.h",
"${dawn_abseil_dir}/absl/strings/string_view.h",
"${dawn_abseil_dir}/absl/strings/strip.h",
"${dawn_abseil_dir}/absl/strings/substitute.h",
]
deps = [
":int128",
":raw_logging_internal",
":strings_internal",
":throw_delegate",
]
}
absl_source_set("strings_internal") {
sources = [
"${dawn_abseil_dir}/absl/strings/internal/escaping.cc",
"${dawn_abseil_dir}/absl/strings/internal/ostringstream.cc",
"${dawn_abseil_dir}/absl/strings/internal/utf8.cc",
]
public = [
"${dawn_abseil_dir}/absl/strings/internal/char_map.h",
"${dawn_abseil_dir}/absl/strings/internal/escaping.h",
"${dawn_abseil_dir}/absl/strings/internal/ostringstream.h",
"${dawn_abseil_dir}/absl/strings/internal/resize_uninitialized.h",
"${dawn_abseil_dir}/absl/strings/internal/utf8.h",
]
Revert "Enable gn check for all build targets." This reverts commit 61bc38fd52161ce7c0722a966eb4d66315b07cc1. Reason for revert: Appears to have broken the Dawn->Chromium autoroller, which is now seeing Abseil linking issues on Mac and Linux. Example failing roll: https://chromium-review.googlesource.com/c/chromium/src/+/3590451/ Example error log: https://logs.chromium.org/logs/chromium/buildbucket/cr-buildbucket/8816532799903001889/+/u/compile__with_patch_/stdout Log Excerpt: [802/31819] LINK ./dawn_unittests FAILED: dawn_unittests TOOL_VERSION=1650247560 ../../build/toolchain/apple/linker_driver.py -Wcrl,strippath,../../build/mac_files/xcode_binaries/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/strip -Wcrl,installnametoolpath,../../build/mac_files/xcode_binaries/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/install_name_tool ../../third_party/llvm-build/Release+Asserts/bin/clang++ -Werror -fuse-ld=lld -Wl,-fatal_warnings -Wl,--color-diagnostics -arch x86_64 -no-canonical-prefixes -Wl,-dead_strip -nostdlib++ -isysroot ../../build/mac_files/xcode_binaries/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX12.3.sdk -mmacosx-version-min=10.11.0 -fprofile-instr-generate -Wl,-ObjC -rpath @executable_path/ -o "./dawn_unittests" "@./dawn_unittests.rsp" ld64.lld: error: duplicate symbol: __ZN4absl15AsciiStrToLowerEPNSt3__112basic_stringIcNS0_11char_traitsIcEENS0_9allocatorIcEEEE >>> defined in obj/third_party/dawn/third_party/gn/abseil-cpp/strings/ascii.o >>> defined in obj/third_party/abseil-cpp/absl/strings/strings/ascii.o ld64.lld: error: duplicate symbol: __ZN4absl15AsciiStrToUpperEPNSt3__112basic_stringIcNS0_11char_traitsIcEENS0_9allocatorIcEEEE >>> defined in obj/third_party/dawn/third_party/gn/abseil-cpp/strings/ascii.o >>> defined in obj/third_party/abseil-cpp/absl/strings/strings/ascii.o ld64.lld: error: duplicate symbol: __ZN4absl26RemoveExtraAsciiWhitespaceEPNSt3__112basic_stringIcNS0_11char_traitsIcEENS0_9allocatorIcEEEE >>> defined in obj/third_party/dawn/third_party/gn/abseil-cpp/strings/ascii.o >>> defined in obj/third_party/abseil-cpp/absl/strings/strings/ascii.o Original change's description: > Enable gn check for all build targets. > > This CL removes the `check_targets` entry from the .gn file which > will enable checking all targets. Two of the GN targets have had > missing dependencies added. > > The `gn/abseil-cpp/BUILD.gn` was referenced against the Chromium > BUILD.gn for abseil to make sure the `public_deps` and `deps` > match in the two versions. The paths are re-written to match > the Dawn paths. > > Bug: dawn:1372 > Change-Id: I371e17ec9647e6627429be5c81eb7985da3cc5b3 > Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/86861 > Auto-Submit: Dan Sinclair <dsinclair@chromium.org> > Kokoro: Kokoro <noreply+kokoro@google.com> > Reviewed-by: Brandon Jones <bajones@chromium.org> > Reviewed-by: Corentin Wallez <cwallez@chromium.org> > Commit-Queue: Corentin Wallez <cwallez@chromium.org> # Not skipping CQ checks because original CL landed > 1 day ago. Bug: dawn:1372 Change-Id: I1ce6d62138cd99aa3a75c74eea0ac04ce5048b6b Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/87161 Reviewed-by: Brandon Jones <bajones@chromium.org> Auto-Submit: Brandon Jones <bajones@chromium.org> Reviewed-by: Shrek Shao <shrekshao@google.com> Kokoro: Kokoro <noreply+kokoro@google.com> Reviewed-by: Austin Eng <enga@chromium.org> Commit-Queue: Austin Eng <enga@chromium.org>
2022-04-18 17:35:53 +00:00
deps = [ ":raw_logging_internal" ]
}
absl_source_set("str_format") {
public = [ "${dawn_abseil_dir}/absl/strings/str_format.h" ]
deps = [ ":str_format_internal" ]
}
absl_source_set("str_format_internal") {
sources = [
"${dawn_abseil_dir}/absl/strings/internal/str_format/arg.cc",
"${dawn_abseil_dir}/absl/strings/internal/str_format/bind.cc",
"${dawn_abseil_dir}/absl/strings/internal/str_format/extension.cc",
"${dawn_abseil_dir}/absl/strings/internal/str_format/float_conversion.cc",
"${dawn_abseil_dir}/absl/strings/internal/str_format/output.cc",
"${dawn_abseil_dir}/absl/strings/internal/str_format/parser.cc",
]
public = [
"${dawn_abseil_dir}/absl/strings/internal/str_format/arg.h",
"${dawn_abseil_dir}/absl/strings/internal/str_format/bind.h",
"${dawn_abseil_dir}/absl/strings/internal/str_format/checker.h",
"${dawn_abseil_dir}/absl/strings/internal/str_format/extension.h",
"${dawn_abseil_dir}/absl/strings/internal/str_format/float_conversion.h",
"${dawn_abseil_dir}/absl/strings/internal/str_format/output.h",
"${dawn_abseil_dir}/absl/strings/internal/str_format/parser.h",
]
visibility = [ ":*" ]
deps = [
":int128",
":strings",
]
}