Skip to content

build(sdk): gate -Werror behind PJ_WARNINGS_AS_ERRORS + add Conan Center recipe#139

Merged
facontidavide merged 3 commits into
mainfrom
conan-center-recipe
Jul 1, 2026
Merged

build(sdk): gate -Werror behind PJ_WARNINGS_AS_ERRORS + add Conan Center recipe#139
facontidavide merged 3 commits into
mainfrom
conan-center-recipe

Conversation

@facontidavide

Copy link
Copy Markdown
Contributor

What

Prepares the SDK for publication on Conan Center and stages the recipe.

Source change (one line of behavior): add option(PJ_WARNINGS_AS_ERRORS ... ON) and gate -Werror / /WX behind it. Default is ON, so our own builds, CI, and build.sh are unchanged. Third-party packaging (Conan Center's multi-compiler build matrix in particular) sets it OFF so a not-yet-pinned compiler version cannot fail an otherwise-fine build on a new warning. wasm32 still never gets -Werror (unchanged).

Recipe (staged, not consumed by our build): packaging/conan-center-index/recipes/plotjuggler_sdk/ — copy this tree into a fork of conan-io/conan-center-index to submit.

  • all/conanfile.py — downloads the released tag tarball (no vendored sources), validate()s C++20 + compiler minimums, builds with PJ_WARNINGS_AS_ERRORS=OFF, and strips the project-installed CMake config/targets (CCI re-derives them from package_info()) while keeping PjPluginManifest.cmake as a build module.
  • all/conandata.yml, config.ymlv0.14.0 url + sha256.
  • all/test_package/ — minimal consumer that links libpj_base.a via parseNumber<double> to exercise real linkage, not just headers.
  • README.md — submission + local-test workflow, prerequisites, recurring cost.

Verification

  • conan create ... -s compiler.cppstd=20 → success; nlohmann_json/3.12.0, fmt/12.1.0, fast_float/8.1.0 all resolve from Conan Center; test_package links and runs.
  • validate() correctly rejects sub-C++20 profiles.
  • Packaged tree drops Config*/Targets*, keeps PjPluginManifest.cmake + both licenses; all 8 archives present.
  • ./build.sh --debug && ./test.sh48/48 green (this branch, with default -Werror ON).

Follow-ups (before the CCI PR — not in this PR)

  • Cut a release tag that includes the -Werror gate; re-point config.yml/conandata.yml at it + new sha256 (current 0.14.0 hash is the pre-gate tag).
  • Decide the entry version (0.14.x vs 1.0.0, per the SDK's pj.data_processors.v1 → 1.0.0 rule).
  • Reviewer-facing decisions: keep/drop the with_host / assert_throws options; confirm the compiler-minimum map.

Release impact

No ABI/API change to installed headers. The new CMake option is additive with a behavior-preserving default → PATCH at most (the recipe itself ships no consumer-visible header change).

🤖 Generated with Claude Code

…ter recipe

Add the option PJ_WARNINGS_AS_ERRORS (default ON, so our own builds and CI are
unchanged) and gate -Werror / /WX behind it. Third-party packaging — Conan
Center's multi-compiler matrix in particular — sets it OFF so a not-yet-pinned
compiler version cannot fail an otherwise-fine build on a new warning. wasm32
still never gets -Werror (unchanged).

Stage the Conan Center Index recipe under packaging/conan-center-index/ (copy
recipes/plotjuggler_sdk/ into a fork of conan-io/conan-center-index to submit):
- all/conanfile.py: downloads the released tag tarball (no vendored sources),
  validate()s C++20 + compiler minimums, builds with PJ_WARNINGS_AS_ERRORS=OFF,
  strips the project-installed CMake config/targets (CCI re-derives them from
  package_info()) while keeping PjPluginManifest.cmake as a build module.
- all/conandata.yml, config.yml: v0.14.0 source url + sha256 (placeholder tag;
  re-point at the release that ships the -Werror gate before submitting).
- all/test_package/: minimal consumer that links libpj_base.a via
  parseNumber<double> to exercise real linkage, not just headers.
- README.md: submission + local-test workflow, prerequisites, recurring cost.

Verified: conan create with -s compiler.cppstd=20 succeeds (deps resolve from
Conan Center; test_package links and runs); validate() rejects sub-C++20;
packaged tree drops Config*/Targets* and keeps PjPluginManifest.cmake + both
licenses. ./build.sh --debug && ./test.sh green (48/48).

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@facontidavide facontidavide force-pushed the conan-center-recipe branch from d98e7fa to e210966 Compare July 1, 2026 15:29
facontidavide and others added 2 commits July 1, 2026 17:51
Three verified correctness fixes to the staged CCI recipe (conanfile.py only;
no change to the SDK build):

- assert_throws: export PJ_ASSERT_THROWS as a `base` component define when the
  option is set. assert.hpp branches on it at the consumer's compile time and
  upstream marks it PUBLIC on pj_base; stripping the project CMake targets for
  CCI dropped it, so a package built to throw would hand consumers assert().
  Verified: the generated consumer CMakeDeps data now carries
  `-DPJ_ASSERT_THROWS` on the base component.
- MSVC: restore `/Zc:preprocessor` on the plugin_sdk component (via is_msvc).
  Upstream sets it INTERFACE on the dialog SDK target for PJ_DIALOG_PLUGIN's
  variadic macro; it was lost when the project targets were stripped.
- fPIC: drop the option. Every static target hardcodes
  POSITION_INDEPENDENT_CODE ON upstream (plugins are dlopen'd shared objects),
  so fPIC was a no-op knob — CCI requires options to have an observable effect.
  Verified: `-o &:fPIC=False` now errors "option 'fPIC' doesn't exist".

Not changed: the pre-gate v0.14.0 sha256 in conandata.yml stays a documented
placeholder (re-point at a tag containing the PJ_WARNINGS_AS_ERRORS gate before
submitting). README already carries no fPIC reference.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Addresses the remaining Codex nit: the test_package linked only plugin_sdk and
never touched plugin_host, so a mis-wired plugin_host lib list or missing `dl`
system_lib would go uncaught.

Now, when the package is built with_host (default), the consumer also links
plotjuggler_sdk::plugin_host and constructs an empty PluginRuntimeCatalog — a
disk-less, no-throw default ctor that lives in libpj_plugin_runtime_catalog.a
and cascades the loader archives (and libdl) onto the link line. The
test_package conanfile mirrors the tested package's with_host option into a
TEST_WITH_HOST cache variable so `-o with_host=False` still builds (the
plugin_host component does not exist there).

Verified both matrix points: with_host=True links plugin_host and runs with no
undefined references (proving the lib/syslib wiring); with_host=False builds
and runs without it.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@facontidavide facontidavide merged commit a769e69 into main Jul 1, 2026
4 checks passed
@facontidavide facontidavide deleted the conan-center-recipe branch July 1, 2026 16:18
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.

1 participant