diff --git a/.github/workflows/github-cxx-qt-tests.yml b/.github/workflows/github-cxx-qt-tests.yml index a5056aaec..f02e66305 100644 --- a/.github/workflows/github-cxx-qt-tests.yml +++ b/.github/workflows/github-cxx-qt-tests.yml @@ -213,7 +213,7 @@ jobs: CC: ${{ matrix.cc }} CXX: ${{ matrix.cxx }} - name: "Build" - run: cmake --build build --config Release --parallel 2 + run: cmake --build build --config Release --parallel 1 working-directory: ${{ matrix.workspace }} env: RUSTC_WRAPPER: sccache diff --git a/CMakeLists.txt b/CMakeLists.txt index b33d2d2dd..4ece66d99 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -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 - ${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) diff --git a/examples/meta_project/CMakeLists.txt b/examples/meta_project/CMakeLists.txt index 00b09b06f..c8269dba7 100644 --- a/examples/meta_project/CMakeLists.txt +++ b/examples/meta_project/CMakeLists.txt @@ -34,7 +34,7 @@ if(NOT Corrosion_FOUND) endif() set(CRATE qml-meta-project) -corrosion_import_crate(MANIFEST_PATH rust/main/Cargo.toml CRATES ${CRATE}) +corrosion_import_crate(MANIFEST_PATH rust/main/Cargo.toml CRATES ${CRATE} FLAGS -j1) set(CXXQT_EXPORT_DIR "${CMAKE_CURRENT_BINARY_DIR}/cxxqt") corrosion_set_env_vars(${CRATE} "CXXQT_EXPORT_DIR=${CXXQT_EXPORT_DIR}" diff --git a/examples/meta_project/rust/main/src/lib.rs b/examples/meta_project/rust/main/src/lib.rs index 73b514826..9133ec875 100644 --- a/examples/meta_project/rust/main/src/lib.rs +++ b/examples/meta_project/rust/main/src/lib.rs @@ -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;