Skip to content

Linux: gate WSC source files and zlib system deps on HC_NOWEBSOCKETS/HC_NOZLIB#992

Merged
v-patrickpe merged 3 commits into
mainfrom
user/v-patrickpe/linux-wsc-deps-conditional
Jun 9, 2026
Merged

Linux: gate WSC source files and zlib system deps on HC_NOWEBSOCKETS/HC_NOZLIB#992
v-patrickpe merged 3 commits into
mainfrom
user/v-patrickpe/linux-wsc-deps-conditional

Conversation

@v-patrickpe

Copy link
Copy Markdown
Contributor

Addresses the first two checklist items in #989.

After #965, Linux consumers opting out of WebSockets (HC_NOWEBSOCKETS) or zlib (HC_NOZLIB) still paid the cost of building websocketpp_websocket.cpp and installing zlib1g/zlib1g-dev system packages.

Changes

  1. Build/libHttpClient.Linux/CMakeLists.txt — wrap websocketpp_websocket.{cpp,h} + x509_cert_utilities.hpp addition to LINUX_SOURCE_FILES in if (NOT DEFINED HC_NOWEBSOCKETS). Matches the existing pattern at line 89 (if (NOT DEFINED HC_NOZLIB) guards the zlib source list).

  2. Build/libHttpClient.Linux/install_dependencies.bash — skip zlib1g / zlib1g-dev when HC_NOZLIB=true or HC_NOWEBSOCKETS=true. WSC is the only consumer of zlib on Linux, so both opt-outs make zlib unnecessary. Build toolchain deps (clang/make/autoconf/automake/libtool) are unchanged.

Validation

  • No CMakeLists.txt logic change for the default path (HC_NOWEBSOCKETS undefined → same source list as before).
  • install_dependencies.bash default behavior unchanged when neither env var is set.
  • --check mode adapts automatically (loops over the same library_dependencies array, which is empty in the opt-out case).

Not in this PR (tracked in #989)

Resolves first two boxes of #989.


Re-opened on upstream repo (was: #990 from fork; closed per @rgomez391's request to enable ADO CI auto-trigger).

…HC_NOZLIB

After #965, websocketpp_websocket.cpp was added to LINUX_SOURCE_FILES unconditionally
and install_dependencies.bash installed zlib1g/zlib1g-dev unconditionally. Consumers
opting out via HC_NOWEBSOCKETS or HC_NOZLIB still paid the build/dep cost.

- CMakeLists.txt: gate websocketpp_websocket.{cpp,h} + x509_cert_utilities.hpp on
  NOT DEFINED HC_NOWEBSOCKETS (matches existing HC_NOZLIB gating pattern at line 89).
- install_dependencies.bash: skip zlib1g/zlib1g-dev when HC_NOZLIB=true or
  HC_NOWEBSOCKETS=true (compression cannot run without zlib, and websockets are
  the only consumer of compression).

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
option(HC_NOWEBSOCKETS ...) at line 10 always defines the variable, so
'if (NOT DEFINED HC_NOWEBSOCKETS)' was always false and the websocketpp
sources never got appended. Match the truthy-check pattern already used
at line 201 (HC_ENABLE_WEBSOCKET_COMPRESSION AND NOT HC_NOWEBSOCKETS).

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

@v-patrickpe v-patrickpe left a comment

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Hey @jasonsandlin! LHC pair is ready when you are:

  • #991 (GDK ASIO per-file def): green, no reviews yet
  • #992 (this PR, Linux WSC/zlib deps gate): pushed 99671ef fixing the CMake gate (option() on L10 always defines HC_NOWEBSOCKETS, so if (NOT DEFINED ...) never fires; switched to truthy check matching L201). CI re-running.

Let me know if your WSC design changes the shape of #992.

@v-patrickpe v-patrickpe merged commit fb37fde into main Jun 9, 2026
19 checks passed
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