blob: fdd2db83ebb8af1d490e39826104ce1f5c9cc87a [file] [log] [blame] [edit]
# Import `dawn_gen_root` and `dawn_partition_alloc_dir`
import("../../../scripts/dawn_overrides_with_defaults.gni")
# This file provides Dawn, the MiraclePtr "raw_ptr" definition.
# Depending on the configuration, this is either:
# - Delegated to the `partition_alloc` library.
# - Provided by Dawn itself as "no-op" implementation.
# This define the same targets as in partition_alloc. See Chrome's file:
# - base/allocator/partition_allocator/BUILD.gn
# - base/allocator/partition_allocator/src/partition_alloc/BUILD.gn
if (defined(dawn_partition_alloc_dir)) {
group("raw_ptr") {
public_deps = [ "${dawn_partition_alloc_dir}:raw_ptr" ]
}
group("buildflags") {
public_deps = [ "${dawn_partition_alloc_dir}:buildflags" ]
}
# PartitionAlloc do not fully support MSVC cl.exe compiler. The condition
# is_clang || !is_win is the one used by partition_alloc.
is_clang_or_gcc = is_clang || !is_win
if (is_clang_or_gcc) {
group("partition_alloc") {
public_deps = [ "${dawn_partition_alloc_dir}:partition_alloc" ]
}
}
} else {
config("public_includes") {
include_dirs = [ "." ]
}
source_set("raw_ptr") {
public_configs = [ ":public_includes" ]
public = [
"partition_alloc/pointers/raw_ptr.h",
"partition_alloc/pointers/raw_ptr_exclusion.h",
"partition_alloc/pointers/raw_ref.h",
]
}
source_set("buildflags") {
public_configs = [ ":public_includes" ]
public = [ "partition_alloc/partition_alloc_buildflags.h" ]
}
# The Dawn no-op implementation of PartitionAlloc only contains buildflags
# to detect the feature is disabled.
group("partition_alloc") {
public_deps = [ ":buildflags" ]
}
}