[ppapi] Prep moving ENABLE_PLUGINS into content/public/common This will allow us to remove a bunch of #include ppapi inside content without breaking the build everywhere. Bug: 40511450 Change-Id: I1386dbcada5c4589c55af408bf2995080f6aa633 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/6685852 Reviewed-by: Derek Schuff <dschuff@chromium.org> Commit-Queue: Dave Tapuska <dtapuska@chromium.org> Auto-Submit: Dave Tapuska <dtapuska@chromium.org> Reviewed-by: Lei Zhang <thestig@chromium.org> Commit-Queue: Derek Schuff <dschuff@chromium.org> Cr-Commit-Position: refs/heads/main@{#1480158} NOKEYCHECK=True GitOrigin-RevId: 9cf63231e10aa5abc4479f063b33545bf986cfff
diff --git a/buildflags/BUILD.gn b/buildflags/BUILD.gn index f5e728c..e6c5cde 100644 --- a/buildflags/BUILD.gn +++ b/buildflags/BUILD.gn
@@ -2,17 +2,15 @@ # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. -import("//build/buildflag_header.gni") -import("//ppapi/buildflags/buildflags.gni") +import("//build/config/features.gni") -# This file is in a separate directory so all targets in the build can refer to -# the buildflag header to get the necessary preprocessor defines without -# bringing in all of Pepper. +# To support the removal of ppapi we use just a static PPAPI definition +# that depends on //content. +source_set("buildflags") { + sources = [ "buildflags.h" ] + public_deps = [ "//build:blink_buildflags" ] -buildflag_header("buildflags") { - header = "buildflags.h" - flags = [ - "ENABLE_PLUGINS=$enable_plugins", - "ENABLE_PPAPI=$enable_ppapi", - ] + if (use_blink) { + public_deps += [ "//content/public/common:buildflags" ] + } }
diff --git a/buildflags/DEPS b/buildflags/DEPS new file mode 100644 index 0000000..a291259 --- /dev/null +++ b/buildflags/DEPS
@@ -0,0 +1,3 @@ +include_rules = [ + "+content/public/common/buildflags.h", +]
diff --git a/buildflags/buildflags.gni b/buildflags/buildflags.gni index af2c81e..5e23de2 100644 --- a/buildflags/buildflags.gni +++ b/buildflags/buildflags.gni
@@ -21,4 +21,4 @@ enable_ppapi = false } -assert(enable_plugins || !enable_ppapi) +assert(!enable_ppapi)
diff --git a/buildflags/buildflags.h b/buildflags/buildflags.h new file mode 100644 index 0000000..3cde163 --- /dev/null +++ b/buildflags/buildflags.h
@@ -0,0 +1,22 @@ +// Copyright 2025 The Chromium Authors +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#ifndef PPAPI_BUILDFLAGS_BUILDFLAGS_H_ +#define PPAPI_BUILDFLAGS_BUILDFLAGS_H_ + +#include "build/blink_buildflags.h" +#include "build/buildflag.h" // IWYU pragma: export + +#if BUILDFLAG(USE_BLINK) +#include "content/public/common/buildflags.h" +#endif + +// IWYU pragma: always_keep + +// The ENABLE_PLUGINS build flag is moved into content/public/common but +// many files still include this file, so we statically generate it with +// an include of the content flag generation until all files are adjusted. +#define BUILDFLAG_INTERNAL_ENABLE_PPAPI() (0) + +#endif // PPAPI_BUILDFLAGS_BUILDFLAGS_H_