Skip to content
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

fixes(#23): ignore vcpkg config of crates dependencies #24

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all 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
2 changes: 1 addition & 1 deletion Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "cargo-vcpkg"
version = "0.1.7"
version = "0.1.8"
authors = ["Jim McGrath <[email protected]>"]
edition = "2018"
license = "MIT/Apache-2.0"
Expand Down
24 changes: 18 additions & 6 deletions src/main.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
use anyhow::{bail, Context};
//use indicatif::{ProgressBar, ProgressStyle};
use serde::Deserialize;
use std::path::Path;
use std::{
collections::BTreeMap,
ffi::OsString,
Expand Down Expand Up @@ -335,13 +336,24 @@ fn process_metadata(
let mut vcpkg_triplet = None;
let mut overlay_triplets_path = None;

// dbg!(&metadata.workspace_root);
// dbg!(&metadata.workspace_metadata);
for p in &metadata.packages {
// println!("-------------");
// dbg!(&p);
let workspace_root_path = Path::new(&metadata.workspace_root);

dbg!(&metadata.workspace_root);
dbg!(&metadata.workspace_metadata);
// Our current crates metadata is last, so start at the end.
for p in metadata.packages.iter() {
if let Ok(v) = serde_json::from_value::<Metadata>(p.metadata.clone()) {
// dbg!(&v);
let manifest_parent_path = Path::new(&p.manifest_path).parent();
let package_is_from_workspace = manifest_parent_path.is_some()
&& manifest_parent_path.unwrap() == workspace_root_path;

if !package_is_from_workspace {
println!("'{}' is not from our workspace. Package manifest path={}. Current workspace={}", p.name, p.manifest_path, metadata.workspace_root);
continue;
}

dbg!(&v);
dbg!(&p.manifest_path);
let v = v.vcpkg;
let is_root_crate = p.id == *root_crate;

Expand Down