Skip to content

Allow for autogen bypass, partial fix for #264 #252 #207, ref #303 - #347

Open
timkpaine wants to merge 1 commit into
mainfrom
tkp/autogen
Open

Allow for autogen bypass, partial fix for #264 #252 #207, ref #303#347
timkpaine wants to merge 1 commit into
mainfrom
tkp/autogen

Conversation

@timkpaine

@timkpaine timkpaine commented Jul 19, 2024

Copy link
Copy Markdown
Member

This PR does a few things:

  • Small tweaks to autogen script to include the python command in the generated files
  • Inline the autogenerated files needed for the csp main build
    • Add tests to enforce that these dont deviate
  • Tweak cmake autogen command to look for existing autogen files

@timkpaine timkpaine added type: enhancement Issues and PRs related to improvements to existing features lang: c++ Issues and PRs related to the C++ codebase part: build Issues and PRs related to the build process labels Jul 19, 2024
@timkpaine
timkpaine force-pushed the tkp/autogen branch 2 times, most recently from 460fe5a to b897318 Compare July 19, 2024 20:08
@timkpaine
timkpaine marked this pull request as ready for review July 19, 2024 21:14
@timkpaine
timkpaine force-pushed the tkp/autogen branch 3 times, most recently from 9d3b6d0 to 6f2430e Compare August 8, 2024 02:10
Comment thread cpp/csp/adapters/websocket/csp_autogen/websocket_types.cpp
@timkpaine
timkpaine force-pushed the tkp/autogen branch 3 times, most recently from 576cf64 to e3ef98d Compare March 4, 2025 22:16
@timkpaine
timkpaine marked this pull request as draft August 14, 2025 21:27
@timkpaine
timkpaine marked this pull request as ready for review February 14, 2026 22:51
@timkpaine
timkpaine requested a review from arhamchopra as a code owner August 13, 2026 21:36
csp_autogen generates C++ struct bindings at build time, which requires a working Python csp
import during the C++ build. Allow that step to be bypassed by checking generated sources into
the tree: Findcsp_autogen.cmake now prefers in-source csp_autogen/<name>.{h,cpp} when both are
present and only falls back to the generate-at-build-time custom command otherwise.

Adds the pregenerated sources for csp/engine and the websocket adapter, along with
test_pregenerated_types.py to catch them drifting from what the generator would produce.

The generator gains --omit_asserts to drop the static offset/alignment/size assertions, which
are only valid for the interpreter and platform that generated them and so cannot be baked into
checked-in sources. Generated files are stamped with the command that produced them, imports of
csp.impl.enum/struct are deferred to call sites so the module can be imported without a built
csp, and csp/core/Platform.h is added to the common includes.

Signed-off-by: Tim Paine <3105306+timkpaine@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

lang: c++ Issues and PRs related to the C++ codebase part: build Issues and PRs related to the build process type: enhancement Issues and PRs related to improvements to existing features

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant