pw_presubmit: Add Emboss GN build

Add GN Emboss build presubmit check. This verifies that the Emboss
GN rules and build templates are successfully processed by GN when
dir_pw_third_party_emboss is configured to the Emboss package path.

Bug: b/267339628

Change-Id: I522b3b07f1c001d5b9408adf3b5132e213b1e8bc
Reviewed-on: https://pigweed-review.googlesource.com/c/pigweed/pigweed/+/127332
Reviewed-by: Rob Mohr <mohrr@google.com>
Commit-Queue: Ben Lawson <benlawson@google.com>
diff --git a/pw_presubmit/py/pw_presubmit/pigweed_presubmit.py b/pw_presubmit/py/pw_presubmit/pigweed_presubmit.py
index 495bcd8..6bcd87f 100755
--- a/pw_presubmit/py/pw_presubmit/pigweed_presubmit.py
+++ b/pw_presubmit/py/pw_presubmit/pigweed_presubmit.py
@@ -67,7 +67,14 @@
 
 # Trigger builds if files with these extensions change.
 _BUILD_FILE_FILTER = presubmit.FileFilter(
-    suffix=(*format_code.C_FORMAT.extensions, '.py', '.rst', '.gn', '.gni')
+    suffix=(
+        *format_code.C_FORMAT.extensions,
+        '.py',
+        '.rst',
+        '.gn',
+        '.gni',
+        '.emb',
+    )
 )
 
 _OPTIMIZATION_LEVELS = 'debug', 'size_optimized', 'speed_optimized'
@@ -203,6 +210,18 @@
 )
 
 
+gn_emboss_build = build.GnGenNinja(
+    name='gn_emboss_build',
+    packages=('emboss',),
+    gn_args=dict(
+        dir_pw_third_party_emboss=lambda ctx: '"{}"'.format(
+            ctx.package_root / 'emboss'
+        ),
+        pw_C_OPTIMIZATION_LEVELS=_OPTIMIZATION_LEVELS,
+    ),
+    ninja_targets=(*_at_all_optimization_levels(f'host_{_HOST_COMPILER}'),),
+)
+
 gn_nanopb_build = build.GnGenNinja(
     name='gn_nanopb_build',
     path_filter=_BUILD_FILE_FILTER,
@@ -911,6 +930,7 @@
 # program block CQ on Linux.
 MISC = (
     # keep-sorted: start
+    gn_emboss_build,
     gn_nanopb_build,
     gn_pico_build,
     gn_pw_system_demo_build,