Restrict Pigweed's top-level BUILD.gn to Pigweed
Pigweed's top-level BUILD.gn expands all of Pigweed's code with several
toolchains. For external projects, this slows gn gen unnecessarily.
Pigweed's BUILD.gn also defines various targets intended for upstream
use only, which downstream projects should not rely on.
Projects that wish to pull in all Pigweed code may import
$dir_pigweed/modules.gni and use the pw_modules and pw_module_tests
lists.
Change-Id: I7b2ccbcb36d541ec94acdeb0fdf231298752c2d3
Reviewed-on: https://pigweed-review.googlesource.com/c/pigweed/pigweed/+/84125
Reviewed-by: Anthony DiGirolamo <tonymd@google.com>
Pigweed-Auto-Submit: Wyatt Hepler <hepler@google.com>
Commit-Queue: Auto-Submit <auto-submit@pigweed.google.com.iam.gserviceaccount.com>
Commit-Queue: Wyatt Hepler <hepler@google.com>
diff --git a/BUILD.gn b/BUILD.gn
index fad4216..b8f0ccb 100644
--- a/BUILD.gn
+++ b/BUILD.gn
@@ -61,6 +61,14 @@
}
}
+# Verify that this BUILD.gn file is only used by Pigweed itself.
+assert(get_path_info("//", "abspath") == get_path_info(".", "abspath"),
+ "Pigweed's top-level BUILD.gn may only be used when building upstream " +
+ "Pigweed. To pull all Pigweed code into your build, import " +
+ "\$dir_pigweed/modules.gni and create a top-level pw_test_group " +
+ "that depends on the tests in pw_modules_tests. See " +
+ "https://pigweed.dev/build_system.html for details.")
+
group("pw_system_demo") {
deps = [ "$dir_pw_system:system_examples" ]
}