mirror of
https://github.com/google/brotli.git
synced 2026-09-22 06:35:52 +00:00
[PR #1406] Fix Emscripten detection false positives and unsuppressible status me… #2018
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
📋 Pull Request Information
Original PR: https://github.com/google/brotli/pull/1406
Author: @mannewalis
Created: 12/10/2025
Status: 🔄 Open
Base:
master← Head:fix/emscripten-detection📝 Commits (1)
7607185Fix Emscripten detection false positives and unsuppressible status messages📊 Changes
1 file changed (+15 additions, -9 deletions)
View changed files
📝
CMakeLists.txt(+15 -9)📄 Description
…ssages
Issue 1: False positive Emscripten detection
The check_c_source_compiles() test incorrectly detected Emscripten when building with non-Emscripten WASM toolchains (e.g., WASI SDK). In cross- compilation scenarios, CMake creates a static library instead of an executable for compile tests. An empty source file (when EMSCRIPTEN is not defined) successfully archives into a static library, causing the test to pass when it should fail.
Resolution: Use the EMSCRIPTEN CMake variable set by Emscripten's official toolchain file, which is the recommended detection method. Remove the unreliable check_c_source_compiles() fallback.
Issue 2: Unsuppressible status messages
The message() calls lacked a type argument, making them always print regardless of CMake's log level settings.
Resolution: Add STATUS type to message() calls so they can be suppressed with CMake's --log-level option.
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.