Skip to content

Commit 2df045f

Browse files
authored
Merge pull request #595 from Superhepper/Bundled-Feature-Doc-Update
Updates the documentation regarding the bundled feature.
2 parents 088d53b + 130c9d3 commit 2df045f

File tree

3 files changed

+15
-8
lines changed

3 files changed

+15
-8
lines changed

tss-esapi-sys/README.md

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,8 @@ must therefore link to all of them at build time.
1818

1919
The paths to the libraries are discovered using `pkg-config` - make sure they
2020
are discoverable in this way on your system. Our build script looks for
21-
`tss2-esys`, `tss2-tctildr` and `tss2-mu`. A minimum version of `4.1.3` is
22-
required for all of them.
21+
`tss2-sys`, `tss2-esys`, `tss2-tctildr` and `tss2-mu`. A minimum version of `4.1.3` is
22+
required for all of them. On windows `tss2-tcti-tbs` is also required.
2323

2424
Having installed the open-source implementation libraries at `/usr/local/lib` (by default), it
2525
might happen that `pkg-config` can not find them. Run the following command if that is the
@@ -51,8 +51,12 @@ environment variable `TPM_TSS_SOURCE_PATH` or it will be retrieved from
5151
Github during the build. The version to retrieve can be controlled by setting
5252
the `TPM2_TSS_SOURCE_VERSION` environment variable.
5353
[!IMPORTANT]
54-
On windows it might be necessary to manually create the VERSION file
55-
when a local source is being used.
54+
* The `bundled` feature will make it possible to build the crate without
55+
having to worry about the `tpm2-tss` library dependencies. But it is still
56+
necessary to make the shared libraries available to the executable that uses
57+
the library.
58+
* On Windows it might be necessary to manually create the `VERSION` file
59+
when a local source is being used.
5660

5761
To enable this feature:
5862

tss-esapi-sys/build.rs

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -869,10 +869,8 @@ pub mod tpm2_tss {
869869
"release" => "Release",
870870
_ => panic!("Unknown cargo profile: {}", profile),
871871
};
872-
println!(
873-
"cargo:rustc-link-search=dylib={}",
874-
_source_path.join("x64").join(build_string).display()
875-
);
872+
let lib_out_path: PathBuf = _source_path.join("x64").join(build_string);
873+
println!("cargo:rustc-link-search=all={}", lib_out_path.display());
876874
}
877875
}
878876
}

tss-esapi/README.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,11 @@ The crate currently offers the following features:
3535
* `rustcrypto-full` (disabled by default) - provides conversion from all
3636
supported elliptic curves, rsa or hashes.
3737
Support for individual hash, rsa or curves can be pulled individually.
38+
* `bundled` - Downloads, builds and dynamically links against the tpm2-tss libraries.
39+
This means that the executable using the crate needs to have the tpm2-tss shared
40+
libraries available to the executable. This can be achieved by copying the shared libraries
41+
to the same folder as the executable or by adding the path to them to the appropriate environmental
42+
variable e.g. `LD_LIBRARY_PATH`, `DYLD_FALLBACK_LIBRARY_PATH` or `PATH`.
3843

3944
## Cross compiling
4045

0 commit comments

Comments
 (0)