mirror of
https://github.com/encounter/dawn-cmake.git
synced 2025-05-14 03:11:29 +00:00
Since CMake 3.21, the Ninja generator now outputs absolute paths to source files, rather than relative. These paths are what __FILE__ gets mapped to during compilation, and is what gtest outputs for test failures. This broke fix-tests, which assumed a build-relative source path. This change detects when the source file path is absolute, and converts it to a build-relative one. Also, on Windows, absolute paths include the drive with a colon character, so I added matching the colon to the regex for the path portion. Change-Id: I065161d65f098023376b7e479d8a24a83beb1df7 Reviewed-on: https://dawn-review.googlesource.com/c/tint/+/69440 Kokoro: Kokoro <noreply+kokoro@google.com> Reviewed-by: Ben Clayton <bclayton@google.com> Commit-Queue: Antonio Maiorano <amaiorano@google.com>