Skip to content

Commit b781876

Browse files
committed
Fix deps include dirs listing
1 parent 9c09b6b commit b781876

File tree

7 files changed

+17
-5
lines changed

7 files changed

+17
-5
lines changed

Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
name = "conan"
3-
version = "0.4.0"
3+
version = "0.4.1"
44
readme = "README.md"
55
license = "MIT/Apache-2.0"
66
keywords = ["conan", "cmake", "build-dependencies"]

src/build.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ use crate::util::find_program;
1212
#[derive(Debug, Error)]
1313
pub enum ConanBuildError {}
1414

15+
/// A command for building a Conan package.
1516
pub struct BuildCommand {
1617
recipe_path: Option<PathBuf>,
1718
build_path: Option<PathBuf>,
@@ -23,6 +24,7 @@ pub struct BuildCommand {
2324
should_install: bool,
2425
}
2526

27+
/// Builder pattern for creating a `BuildCommand`
2628
#[derive(Default)]
2729
pub struct BuildCommandBuilder {
2830
recipe_path: Option<PathBuf>,

src/install.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@ pub enum ConanInstallError {
2828
Other(String),
2929
}
3030

31+
/// Conan build policy
3132
#[derive(Clone, PartialEq)]
3233
pub enum BuildPolicy {
3334
Never,

src/install/build_info/build_dependency.rs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,7 @@ where
4040
deserializer.deserialize_option(JsonStringOrStringVecVisitor)
4141
}
4242

43+
/// A build dependency.
4344
#[derive(Serialize, Deserialize)]
4445
pub struct BuildDependency {
4546
pub(crate) version: String,
@@ -72,8 +73,8 @@ impl BuildDependency {
7273
self.lib_paths.get(0).map(|x| &**x)
7374
}
7475

75-
pub fn get_include_dir(&self) -> Option<&str> {
76-
self.include_paths.get(0).map(|x| &**x)
76+
pub fn get_include_dirs(&self) -> Vec<&str> {
77+
self.include_paths.iter().map(|x| &**x).collect()
7778
}
7879

7980
pub fn get_binary_dir(&self) -> Option<&str> {

src/install/build_info/build_settings.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ use std::env;
22

33
use serde::{Deserialize, Serialize};
44

5+
/// Conan build type
56
#[allow(dead_code)]
67
#[derive(Clone, PartialEq)]
78
pub enum BuildType {
@@ -30,6 +31,7 @@ impl BuildType {
3031
}
3132
}
3233

34+
/// Conan build settings
3335
#[derive(Serialize, Deserialize)]
3436
pub struct BuildSettings {
3537
pub(crate) arch: Option<String>,

src/lib.rs

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,5 +5,8 @@ mod util;
55

66
// API
77
pub use build::{BuildCommand, BuildCommandBuilder};
8-
pub use install::{build_info::BuildSettings, BuildPolicy, InstallCommand, InstallCommandBuilder};
9-
pub use package::{PackageCommand, PackageCommandBuilder, ConanPackage};
8+
pub use install::{
9+
build_info::{BuildDependency, BuildInfo, BuildSettings},
10+
BuildPolicy, InstallCommand, InstallCommandBuilder,
11+
};
12+
pub use package::{ConanPackage, PackageCommand, PackageCommandBuilder};

src/package.rs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,10 +32,12 @@ pub enum ConanPackageError {
3232
Other(String),
3333
}
3434

35+
/// Thin Wrapper around binary packages that contain libraries and headers
3536
pub struct ConanPackage {
3637
path: PathBuf,
3738
}
3839

40+
/// "conan package" command runner
3941
#[derive(Default)]
4042
pub struct PackageCommand {
4143
build_path: Option<PathBuf>,
@@ -57,6 +59,7 @@ impl Default for PackageCommandBuilder {
5759
}
5860
}
5961

62+
/// Command arguments builder for "conan package"
6063
pub struct PackageCommandBuilder {
6164
build_path: Option<PathBuf>,
6265
install_path: Option<PathBuf>,

0 commit comments

Comments
 (0)