Add an "internals" section to the book#983
Conversation
c2faedc to
3839f87
Compare
3839f87 to
4e0b8a2
Compare
|
I just had another idea on how to organize the build. We had the additional problem that if you depend on a crate that is build with cxx-qt-build (e..g cxx-qt-lib), you need to make sure that crate is built before your own one. To ensure this is actually the case, it needs to be added to the Now, what if that token was just the manifest? So it would work like this:
This way we would completely avoid the need to serialize and deserialize the manifest and force our users to include everything in the right order. @ahayzen-kdab what do you think? I already discussed this with @vimpostor this morning, and he pointed out that the downside would be more code added to the library, but that should hopefully be optimized out, as it is only used in the build script, not in the final binary. |
|
@LeonMatthesKDAB Sounds good, how do you make the options set in the build.rs exposed to the function that is returning the struct? Is this all done automatically by cxx-qt-build ? Eg if i add extra defines in the build.rs to the cxx-qt-build, does that write them somewhere in the out_dir ? Then somehow include_build_manifest includes those during the build and exposes the defines back in the method ? As this is before where we needed both a lib and headers crate. |
|
Yes, all that data can go into the generated function. The manifest can automatically include certain options (like the modules). Out of that data, we generate a manifest.rs file and dump it in the OUT_DIR. include_build_manifest can then expand to: include!(concat!(env!("OUT_DIR"), "/cxx_qt_build/manifest.rs"));which would include the Rust code inside the library itself. |
This should now be close to what we're aiming for as described in KDAB#983.
5a408f0 to
2c24ace
Compare
This should now be close to what we're aiming for as described in KDAB#983.
This should now be close to what we're aiming for as described in KDAB#983.
This should now be close to what we're aiming for as described in #983.
2c24ace to
f879817
Compare
f879817 to
b52b797
Compare
7e8b2d3 to
647b856
Compare
This section should explain some of our internal architecture decisions so that we can remember them and contributors can understand them more easily
647b856 to
9bd54dc
Compare
ahayzen-kdab
left a comment
There was a problem hiding this comment.
LGTM :-) @LeonMatthesKDAB did you want to detail those CMake situations in this change or another?
|
I'll work on a fix first then detail the CMake integration after that. |
This section should explain some of our internal architecture decisions so that we can remember them and contributors can understand them more easily