Utilities for interacting with a TPM2.0 used for access to the Xaptum Edge Network Fabric.
- cmake version >= 3.0
- A C99-compliant compiler
- Currently, only supports POSIX platforms
xaptum-tpm
uses CMake as its build system:
# Create a subdirectory to hold the build
mkdir -p build
cd build
# Configure the build
cmake .. -DCMAKE_BUILD_TYPE=Release -DBUILD_SHARED_LIBS=ON
# Build the library
cmake --build .
In addition to the standard CMake options the following configuration options and variables are supported.
If BUILD_SHARED_LIBS
is set, the shared library is built. If
BUILD_STATIC_LIBS
is set, the static library is built. If both are
set, both libraries will be built. If neither is set, the static
library will be built.
STATIC_SUFFIX
, if defined, will be appended to the static library
name. For example,
cmake .. -DBUILD_STATIC_LIBS=ON -DSTATIC_SUFFIX=_static
cmake --build .
will create a static library named libxaptum-tpm_static.a
.
Set the standard CMake variable CMAKE_POSITION_INDEPENDENT_CODE
to
ON
to force compilation with -fPIC
for static libraries. The
default is OFF
for static libraries and ON
for shared libraries.
Set the standard CMake variable BUILD_TESTING
to OFF
to disable
the building of tests. The default value is ON
.
CMake creates a target for installation.
cd build
cmake --build . --target install
Set the CMAKE_INSTALL_PREFIX
variable when configuring the build to
modify the installation location.
The tests assume that a TPM2.0 simulator (for instance, IBM's simulator) is listening locally on TCP port 2321. This can be achieved by running the following in the background, before starting the tests:
.travis/install-ibm-tpm2.sh <installation dir>
.travis/run-ibm-tpm2.sh
Then, to run the test suite:
cd build
ctest -V