diff options
author | Daiki Ueno <dueno@redhat.com> | 2019-05-15 13:09:25 +0200 |
---|---|---|
committer | Daiki Ueno <ueno@gnu.org> | 2019-06-18 14:17:28 +0200 |
commit | 4f956698b64ac6eb8e5e8b7d143ceb11f1133814 (patch) | |
tree | 95b8c43ebcddf75f04ac900523e35882a14ae4d4 /common | |
parent | 411a7a6d31cd5584ff9837260d77d8c306d3b557 (diff) |
build: Add meson build support
This adds support for meson as an alternative build system.
Diffstat (limited to 'common')
-rw-r--r-- | common/meson.build | 99 |
1 files changed, 99 insertions, 0 deletions
diff --git a/common/meson.build b/common/meson.build new file mode 100644 index 0000000..4614bcb --- /dev/null +++ b/common/meson.build @@ -0,0 +1,99 @@ +install_headers('pkcs11.h', 'pkcs11x.h', subdir: 'p11-kit-1/p11-kit') + +libp11_common_sources = [ + 'argv.c', + 'attrs.c', + 'array.c', + 'buffer.c', + 'compat.c', + 'constants.c', + 'debug.c', + 'dict.c', + 'hash.c', + 'lexer.c', + 'message.c', + 'path.c', + 'runtime.c', + 'url.c' +] + +libp11_common = static_library('p11-common', libp11_common_sources, + gnu_symbol_visibility: 'hidden', + include_directories: configinc) + +libp11_common_dep = declare_dependency(include_directories: [configinc, + commoninc], + link_with: libp11_common) + +libp11_library = static_library('p11-library', 'library.c', + gnu_symbol_visibility: 'hidden', + include_directories: configinc) + +libp11_library_dep = declare_dependency(include_directories: [configinc, + commoninc], + link_with: libp11_library) + +libp11_test_sources = [ + 'mock.c', + 'test.c' +] + +libp11_test = static_library('p11-test', libp11_test_sources, + include_directories: configinc) +libp11_test_dep = declare_dependency(include_directories: [configinc, + commoninc], + link_with: libp11_test) + +libp11_tool_sources = [ + 'tool.c' +] + +if host_system != 'windows' + libp11_tool_sources += ['unix-peer.c', 'unix-peer.h'] +endif + +libp11_tool = static_library('p11-tool', libp11_tool_sources, + include_directories: configinc) +libp11_tool_dep = declare_dependency(include_directories: [configinc, + commoninc], + link_with: libp11_tool) + +# Tests ---------------------------------------------------------------- + +common_tests = [ + 'test-tests', + 'test-compat', + 'test-hash', + 'test-dict', + 'test-array', + 'test-constants', + 'test-attrs', + 'test-buffer', + 'test-url', + 'test-path', + 'test-lexer', + 'test-message', + 'test-argv', + 'test-runtime' +] + +foreach name : common_tests + t = executable(name, '@0@.c'.format(name), + c_args: tests_c_args, + include_directories: configinc, + dependencies: dlopen_deps, + link_with: [libp11_test, libp11_common]) + test(name, t) +endforeach + +common_progs = [ + 'frob-getauxval', + 'frob-getenv' +] + +foreach name : common_progs + executable(name, '@0@.c'.format(name), + include_directories: configinc, + dependencies: dlopen_deps, + link_with: [libp11_common]) +endforeach |