diff --git a/src/lib.rs b/src/lib.rs index 566ffa8..fe99d5c 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -129,6 +129,9 @@ pub struct Config { /// should DLLs be copied to OUT_DIR? copy_dlls: bool, + /// override vcpkg installed path instead of using VCPKG_ROOT/installed + vcpkg_installed_dir: Option, + /// override VCPKG_ROOT environment variable vcpkg_root: Option, @@ -390,8 +393,11 @@ fn find_vcpkg_target(cfg: &Config, target_triplet: &TargetTriplet) -> Result Result, Error> { // load updates to the status file that have yet to be normalized let status_update_dir = target.status_path.join("updates"); - let paths = try!( - fs::read_dir(status_update_dir).map_err(|e| Error::VcpkgInstallation(format!( - "could not read status file updates dir: {}", + let paths = try!(fs::read_dir(status_update_dir.clone()).map_err( + |e| Error::VcpkgInstallation(format!( + "could not read status file updates dir ({}): {}", + status_update_dir.display(), e - ))) - ); + )) + )); // get all of the paths of the update files into a Vec let mut paths = try!(paths @@ -1056,6 +1063,12 @@ impl Config { self } + /// Specify vcpkg installed directory. This is useful for manifest mode and custom vcpkg installation. + pub fn vcpkg_installed_dir(&mut self, vcpkg_installed_dir: PathBuf) -> &mut Config { + self.vcpkg_installed_dir = Some(vcpkg_installed_dir); + self + } + /// Define which path to use as vcpkg root overriding the VCPKG_ROOT environment variable /// Default to `None`, which means use VCPKG_ROOT or try to find out automatically pub fn vcpkg_root(&mut self, vcpkg_root: PathBuf) -> &mut Config {