From cd490ac7f2debee09a514a428ae16c37341bb643 Mon Sep 17 00:00:00 2001
From: Wan-Teh Chang <wtc@google.com>
Date: Tue, 19 Mar 2024 17:06:32 -0700
Subject: [PATCH] Pass the -DSANITIZE=<type> cmake option to libaom

This is the official way to build libaom with sanitizer support:
https://aomedia.googlesource.com/aom/+/master/README.md#sanitizers
---
 .github/workflows/ci-unix-static-sanitized.yml | 9 ++++-----
 1 file changed, 4 insertions(+), 5 deletions(-)

diff --git a/.github/workflows/ci-unix-static-sanitized.yml b/.github/workflows/ci-unix-static-sanitized.yml
index 569585f4d8..f7801a3770 100644
--- a/.github/workflows/ci-unix-static-sanitized.yml
+++ b/.github/workflows/ci-unix-static-sanitized.yml
@@ -41,11 +41,10 @@ jobs:
       - name: Build aom
         if: steps.cache-ext.outputs.cache-hit != 'true'
         working-directory: ./ext
-        run: ./aom.cmd
-        env:
-          CFLAGS: -fsanitize=${{ matrix.sanitizer }}
-          CXXFLAGS: -fsanitize=${{ matrix.sanitizer }}
-          LDFLAGS: -fsanitize=${{ matrix.sanitizer }}
+        run: >
+          sed -i -e 's/cmake -G Ninja \(.*\) \.\./cmake -G Ninja \1 -DSANITIZE=${{ matrix.sanitizer }} ../g' aom.cmd
+
+          ./aom.cmd
       - name: Build dav1d
         if: steps.cache-ext.outputs.cache-hit != 'true'
         working-directory: ./ext