Skip to content
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 7 additions & 4 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -202,10 +202,13 @@ endif()
set(CARGO_TARGET_DIR "${CMAKE_BINARY_DIR}/${BUILD_DIR}/cargo/build")

# Add CMake tests for `cargo test/clippy/fmt/doc`.
add_test(NAME cargo_tests COMMAND cargo test --features link_qt_object_files --all-targets --target-dir
${CARGO_TARGET_DIR})
add_test(NAME cargo_doc_tests COMMAND cargo test --features link_qt_object_files --doc --target-dir
Copy link
Owner

Choose a reason for hiding this comment

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

can --all-targets and --exclude not be combined? So that it does "all except qml-meta-project"

Copy link
Owner

Choose a reason for hiding this comment

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

Also this failed to build on Windows Qt 5 🤔

Copy link
Author

Choose a reason for hiding this comment

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

--exclude only works with --workspace, not --all-targets

${CARGO_TARGET_DIR})

# qml-meta-project has issues linking with Qt 5 on Windows, as well as with GNU ld.gold.
# There are no Cargo tests for that example anyway, so skip building it with `cargo test`.
add_test(NAME cargo_tests COMMAND cargo test --features link_qt_object_files --workspace --exclude qml-meta-project
--target-dir ${CARGO_TARGET_DIR})
add_test(NAME cargo_doc_tests COMMAND cargo test --features link_qt_object_files --doc
--target-dir ${CARGO_TARGET_DIR})
add_test(NAME cargo_doc COMMAND cargo doc --workspace --target-dir ${CARGO_TARGET_DIR})
add_test(NAME cargo_clippy COMMAND cargo clippy --all-targets --target-dir
${CARGO_TARGET_DIR} -- -D warnings)
Expand Down
6 changes: 3 additions & 3 deletions examples/meta_project/rust/main/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,6 @@ mod main_object;

// Ensure the symbols from the rlib dependencies end up
// in the staticlib (if you use Rust symbols from these
// crates in this crate, you can skip these `pub use` statements).
pub use sub1;
pub use sub2;
// crates in this crate, you can skip these `extern crate` statements).
extern crate sub1;
extern crate sub2;