Skip to content

Conversation

@dudantas
Copy link
Collaborator

@dudantas dudantas commented Nov 20, 2025

This pull request refactors the build configuration to improve platform compatibility and simplify dependency management for threading support. The main changes focus on how patches are applied for abseil and protobuf, and how threading is handled, especially for WASM builds. Additionally, references to the abseil library and its usage have been removed from the build system.

Build and Dependency Management Improvements:

  • Refactored patch application in browser/overlay-ports/abseil/portfile.cmake and browser/overlay-ports/protobuf/portfile.cmake to conditionally include the use_pthread.patch only when not targeting Emscripten, improving cross-platform compatibility and reducing unnecessary patching. [1] [2]
  • Removed abseil from the dependency list in vcpkg.json, simplifying the project's dependency graph.

Threading Support Enhancements:

  • Updated src/CMakeLists.txt to add special handling for threads when building for WASM: sets pthread preferences, attempts to find the Threads package, and if not found, creates an imported interface target with pthread flags. This ensures robust threading support across platforms, especially for WASM.

Cleanup of Abseil Usage:

  • Removed absl::log_internal_check_op from link targets in all platform-specific sections of src/CMakeLists.txt, fully eliminating abseil linkage from the build. [1] [2] [3] [4]

@dudantas dudantas changed the title Add WASM-specific thread configuration to CMake ci/cd: add WASM-specific thread configuration to CMake Nov 20, 2025
Copy link

@chatgpt-codex-connector chatgpt-codex-connector bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Abseil has been removed from the dependency list in vcpkg.json and related CMake configuration. Patch handling for abseil and protobuf portfiles is now conditional on the target platform, improving compatibility with Emscripten. References to absl::log_internal_check_op have been removed from build targets.
@dudantas dudantas force-pushed the dudantas/fix-emscripten-build branch from 2269dee to 6091071 Compare November 20, 2025 06:02
Tests are no longer built when targeting WASM, and the gtest dependency is excluded from WASM builds in vcpkg.json. This streamlines the build process for WASM platforms where tests are not supported.
@dudantas dudantas force-pushed the dudantas/fix-emscripten-build branch from 72842a0 to 6595509 Compare November 24, 2025 23:52
Relocated the WASM detection logic from src/CMakeLists.txt to the main CMakeLists.txt to centralize configuration and avoid redundancy.
Updated CMakeLists.txt and vcpkg.json to include Abseil (absl) as a required dependency for the project.
Corrected indentation for PATCHES in abseil and protobuf portfiles to improve CMake formatting. Added abseil::log_internal_check_op to target link libraries in CMakeLists.txt for all platforms. Updated vcpkg.json to move abseil dependency up in the list for consistency.
Reorganizes CMakeLists.txt to improve handling of threading and package finding for WASM builds. Moves some package find commands outside WASM conditional and ensures Threads are only found when not targeting WASM. Also updates protobuf CMake logic to avoid unnecessary thread flags for WASM.
Eliminated Threads::Threads from the WASM build target in CMakeLists.txt, as threading is not supported or required in this configuration.
Introduces a new 'wasm-debug' configure and build preset in CMakePresets.json for building with Emscripten. Updates vcpkg.json to exclude OpenSSL on wasm32 platforms, improving compatibility for WebAssembly builds.
@sonarqubecloud
Copy link

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants