Skip to content

CMake: Add custom CMake code to simplify build #978

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 21 commits into from
Jun 27, 2024

Conversation

LeonMatthesKDAB
Copy link
Collaborator

No description provided.

@LeonMatthesKDAB LeonMatthesKDAB force-pushed the 963-custom-cmake branch 3 times, most recently from 1c1c062 to 5bf7d30 Compare June 18, 2024 14:12
ahayzen-kdab and others added 7 commits June 19, 2024 15:34
This allows us to get away without whole-archive in CMake by declaring
an OBJECT library instead.
Otherwise, Ninja will complain, as it needs **some** rule to build the
target, even if that rule does nothing.
This caused a build failure when not building a binary.
Linking the object file in shouldn't produce issues.
@LeonMatthesKDAB LeonMatthesKDAB force-pushed the 963-custom-cmake branch 2 times, most recently from 2236f5c to adbd9a2 Compare June 19, 2024 14:20
And don't redirect the first build output to /dev/null

This should allow us to see what exactly is failing in CI.
This can be used to e.g. register custom types, import plugins, declare
modules, etc.
This reverts commit 40f5ad1.

We are now building and linking object files directly, which works
nicely with CMake and seems to work for Rust as well.
This may be a clippy bug, as `cargo expand` tells me the generated
functions do indeed have a `# Safety` section in their documentation.

The `# Safety` sections also show up in the output of `cargo doc`.
So it's unclear why clippy is complaining.
This way we don't need a separate object file and CMake target for this.
@LeonMatthesKDAB LeonMatthesKDAB marked this pull request as ready for review June 21, 2024 10:21
This way we don't run into issues where multiple build scripts are
writing to the same initializers file.
Copy link
Collaborator

@ahayzen-kdab ahayzen-kdab left a comment

Choose a reason for hiding this comment

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

Lets go with this for now and hope that the manifest folders work as described in #983

@LeonMatthesKDAB LeonMatthesKDAB merged commit 0b9aa01 into KDAB:main Jun 27, 2024
10 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.

3 participants