From 9ef45de8b07fcc4a05be49fc614d2d66ce750018 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= Date: Mon, 4 Aug 2025 14:18:19 +0400 Subject: [PATCH] feat: Add OpenSSL dependency and header installation MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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 Signed-off-by: Marc-André Lureau --- include/libtpms/meson.build | 9 +++++++++ include/meson.build | 1 + meson.build | 5 +++-- src/meson.build | 14 +++++++------- 4 files changed, 20 insertions(+), 9 deletions(-) create mode 100644 include/libtpms/meson.build create mode 100644 include/meson.build diff --git a/include/libtpms/meson.build b/include/libtpms/meson.build new file mode 100644 index 00000000..b983d97a --- /dev/null +++ b/include/libtpms/meson.build @@ -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' +) diff --git a/include/meson.build b/include/meson.build new file mode 100644 index 00000000..3cdac638 --- /dev/null +++ b/include/meson.build @@ -0,0 +1 @@ +subdir('libtpms') diff --git a/meson.build b/meson.build index decd02c7..78e162fa 100644 --- a/meson.build +++ b/meson.build @@ -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') \ No newline at end of file diff --git a/src/meson.build b/src/meson.build index fe685b70..fa3e37cd 100644 --- a/src/meson.build +++ b/src/meson.build @@ -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, -) \ No newline at end of file +)