feat: Add OpenSSL dependency and header installation

This commit implements Step 2 of the Meson migration plan.

- The build system now finds and links against the OpenSSL library.
- Public header files are now installed to the correct location.
- The 'include' directory has been added to the Meson build process.

Signed-off-by: Gemini <gemini@google.com>
Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
This commit is contained in:
Marc-André Lureau 2025-08-04 14:18:19 +04:00
parent 37b412fd43
commit 9ef45de8b0
4 changed files with 20 additions and 9 deletions

View File

@ -0,0 +1,9 @@
install_headers(
'tpm_error.h',
'tpm_library.h',
'tpm_memory.h',
'tpm_nvfilename.h',
'tpm_tis.h',
'tpm_types.h',
subdir: 'libtpms'
)

1
include/meson.build Normal file
View File

@ -0,0 +1 @@
subdir('libtpms')

View File

@ -16,5 +16,6 @@ configure_file(
configuration: conf_data
)
# Add the src subdirectory to the build
subdir('src')
# Add subdirectories to the build
subdir('include')
subdir('src')

View File

@ -1,9 +1,8 @@
# Define an include directory that points to the library's public headers
project_inc = include_directories('../include/libtpms')
# Find the OpenSSL dependency (libcrypto)
crypto_dep = dependency('openssl', version: '>=1.1.0', required: true)
# Define an include directory for the generated config.h in the build directory
# This is where config.h will be generated.
build_inc = include_directories('.')
# Include directory for the library's own public headers
lib_inc = include_directories('../include/libtpms')
# Start with the absolute minimum common files to prove compilation works
libtpms_sources = files(
@ -21,6 +20,7 @@ libtpms = shared_library('tpms',
'-DTPM_NV_DISK',
'-include', 'tpm_library_conf.h'
],
include_directories: [project_inc, build_inc],
dependencies: crypto_dep,
include_directories: [lib_inc],
install: true,
)
)