[PR #1406] Fix Emscripten detection false positives and unsuppressible status me… #2018

Open
opened 2026-01-29 20:56:57 +00:00 by claunia · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/google/brotli/pull/1406
Author: @mannewalis
Created: 12/10/2025
Status: 🔄 Open

Base: masterHead: fix/emscripten-detection


📝 Commits (1)

  • 7607185 Fix 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.

## 📋 Pull Request Information **Original PR:** https://github.com/google/brotli/pull/1406 **Author:** [@mannewalis](https://github.com/mannewalis) **Created:** 12/10/2025 **Status:** 🔄 Open **Base:** `master` ← **Head:** `fix/emscripten-detection` --- ### 📝 Commits (1) - [`7607185`](https://github.com/google/brotli/commit/7607185e2624bbe4fed65c5476e3166a57cdea14) Fix Emscripten detection false positives and unsuppressible status messages ### 📊 Changes **1 file changed** (+15 additions, -9 deletions) <details> <summary>View changed files</summary> 📝 `CMakeLists.txt` (+15 -9) </details> ### 📄 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. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
claunia added the pull-request label 2026-01-29 20:56:57 +00:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/brotli#2018