Fix GN visibility checks when building with chromium.
Standalone pdfium doesn't have a //base/BUILD.gn upon which to depend,
so it must depend on the partition_allocator sub-directory targets.
These violate GN constraints, however, when PDFium is built in a
non-standalone manner and //base is available.
This is currently blocking a roll of PDFium into chromium.
Bug: pdfium:2038
Change-Id: Ib2c6a84876036902d6873dedfc18e030c5aa7c6c
Reviewed-on: https://pdfium-review.googlesource.com/c/pdfium/+/107711
Reviewed-by: K. Moon <kmoon@chromium.org>
Reviewed-by: Nigi <nigi@chromium.org>
Commit-Queue: Tom Sepez <tsepez@chromium.org>
diff --git a/core/fxcrt/BUILD.gn b/core/fxcrt/BUILD.gn
index 6837b1a..b6dc8de 100644
--- a/core/fxcrt/BUILD.gn
+++ b/core/fxcrt/BUILD.gn
@@ -2,6 +2,7 @@
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
+import("//build_overrides/build.gni")
import("../../pdfium.gni")
import("../../testing/test.gni")
@@ -9,12 +10,15 @@
sources = [ "unowned_ptr.h" ]
deps = [ "../../third_party:pdfium_compiler_specific" ]
configs += [ "../../:pdfium_strict_config" ]
-
if (pdf_use_partition_alloc) {
- deps += [
- "//base/allocator/partition_allocator:partition_alloc_buildflags",
- "//base/allocator/partition_allocator:raw_ptr",
- ]
+ if (build_with_chromium) {
+ deps += [ "//base" ]
+ } else {
+ deps += [
+ "//base/allocator/partition_allocator:partition_alloc_buildflags",
+ "//base/allocator/partition_allocator:raw_ptr",
+ ]
+ }
}
}
@@ -145,11 +149,15 @@
]
if (pdf_use_partition_alloc) {
sources += [ "fx_memory_pa.cpp" ]
- deps += [
- "//base/allocator/partition_allocator:partition_alloc",
- "//base/allocator/partition_allocator:partition_alloc_buildflags",
- "//base/allocator/partition_allocator:raw_ptr",
- ]
+ if (build_with_chromium) {
+ deps += [ "//base" ]
+ } else {
+ deps += [
+ "//base/allocator/partition_allocator:partition_alloc",
+ "//base/allocator/partition_allocator:partition_alloc_buildflags",
+ "//base/allocator/partition_allocator:raw_ptr",
+ ]
+ }
} else {
sources += [ "fx_memory_malloc.cpp" ]
}