]> granicus.if.org Git - p11-kit/commitdiff
build: Declare dependency chain between static libs in common
authorDaiki Ueno <dueno@redhat.com>
Wed, 19 Jun 2019 13:36:18 +0000 (15:36 +0200)
committerDaiki Ueno <ueno@gnu.org>
Wed, 19 Jun 2019 13:59:01 +0000 (15:59 +0200)
In common/ there are sub-libraries namely libp11-common.a,
libp11-library.a, libp11-tool.a, and libp11-test.a.

All the latter 3 libs use the symbols from libp11-common.a, it would
make sense to declare a dependency against it.

common/meson.build
p11-kit/meson.build
trust/meson.build

index 656592a87abadc4e2a465d57a349e6b9339c9290..2f777a9026ce904d9b0ded5255f3467cc9fc6bc5 100644 (file)
@@ -29,10 +29,8 @@ 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,
-                                        dependencies: thread_deps)
+libp11_library_dep = declare_dependency(link_with: libp11_library,
+                                        dependencies: [libp11_common_dep] + thread_deps)
 
 libp11_test_sources = [
   'mock.c',
@@ -41,10 +39,8 @@ libp11_test_sources = [
 
 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,
-                                     dependencies: thread_deps)
+libp11_test_dep = declare_dependency(link_with: libp11_test,
+                                     dependencies: [libp11_common_dep] + thread_deps)
 
 libp11_tool_sources = [
   'tool.c'
@@ -56,9 +52,8 @@ 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)
+libp11_tool_dep = declare_dependency(link_with: libp11_tool,
+                                     dependencies: [libp11_common_dep])
 
 # Tests ----------------------------------------------------------------
 
index a78cf9eae07568fb9c7353e0b8011a9e29b900d8..f410ee70f04464ed85f2c1b3bcfe9fbb0d1494a4 100644 (file)
@@ -34,8 +34,7 @@ libp11_kit_internal_c_args = [
 
 libp11_kit_internal = static_library('p11-kit-internal',
                                      libp11_kit_internal_sources,
-                                     dependencies: [libp11_common_dep,
-                                                    libp11_library_dep] + libffi_deps,
+                                     dependencies: [libp11_library_dep] + libffi_deps,
                                      c_args: libp11_kit_internal_c_args,
                                      implicit_include_directories: false,
                                      gnu_symbol_visibility: 'hidden')
@@ -117,7 +116,7 @@ libp11_kit_testable = static_library('p11-kit-testable',
                                      libp11_kit_sources,
                                      c_args: libp11_kit_testable_c_args,
                                      implicit_include_directories: false,
-                                     dependencies: [libp11_common_dep, libp11_library_dep] + libffi_deps + dlopen_deps)
+                                     dependencies: [libp11_library_dep] + libffi_deps + dlopen_deps)
 
 p11_kit_sources = [
   'lists.c',
@@ -127,14 +126,14 @@ p11_kit_sources = [
 executable('p11-kit',
            p11_kit_sources,
            c_args: common_c_args,
-           dependencies: [libp11_tool_dep, libp11_common_dep] + libffi_deps + dlopen_deps,
+           dependencies: [libp11_tool_dep] + libffi_deps + dlopen_deps,
            link_with: libp11_kit,
            install: true)
 
 executable('p11-kit-remote',
            'remote.c',
            c_args: common_c_args,
-           dependencies: [libp11_tool_dep, libp11_common_dep] + libffi_deps + dlopen_deps,
+           dependencies: [libp11_tool_dep] + libffi_deps + dlopen_deps,
            link_with: libp11_kit,
            install: true,
            install_dir: prefix / privatedir)
@@ -142,7 +141,7 @@ executable('p11-kit-remote',
 executable('p11-kit-remote-testable',
            'remote.c',
            c_args: common_c_args,
-           dependencies: [libp11_tool_dep, libp11_common_dep] + libffi_deps + dlopen_deps,
+           dependencies: [libp11_tool_dep] + libffi_deps + dlopen_deps,
            link_with: libp11_kit_testable)
 
 executable('p11-kit-server',
@@ -150,7 +149,7 @@ executable('p11-kit-server',
            c_args: common_c_args + [
              '-DP11_KIT_REMOTE="p11-kit-remote"'
            ],
-           dependencies: [libp11_tool_dep, libp11_common_dep] + libsystemd_deps + libffi_deps + dlopen_deps,
+           dependencies: [libp11_tool_dep] + libsystemd_deps + libffi_deps + dlopen_deps,
            implicit_include_directories: false,
            link_with: libp11_kit,
            install: true,
@@ -162,7 +161,7 @@ executable('p11-kit-server-testable',
              '-DP11_KIT_REMOTE="p11-kit-remote-testable"'
            ],
            implicit_include_directories: false,
-           dependencies: [libp11_tool_dep, libp11_common_dep] + libsystemd_deps + libffi_deps + dlopen_deps,
+           dependencies: [libp11_tool_dep] + libsystemd_deps + libffi_deps + dlopen_deps,
            link_with: libp11_kit_testable)
 
 # Check if compilation succeeds with CRYPTOKI_GNU=1
@@ -213,7 +212,7 @@ foreach name : p11_kit_tests
   t = executable(name, '@0@.c'.format(name),
                  c_args: tests_c_args + libp11_kit_testable_c_args,
                  include_directories: [configinc, commoninc],
-                 dependencies: [libp11_test_dep, libp11_common_dep] + libffi_deps + dlopen_deps,
+                 dependencies: [libp11_test_dep] + libffi_deps + dlopen_deps,
                  link_with: libp11_kit_testable)
   test(name, t)
 endforeach
@@ -227,7 +226,7 @@ foreach name : p11_kit_progs
   t = executable(name, '@0@.c'.format(name),
                  c_args: tests_c_args,
                  include_directories: [configinc, commoninc],
-                 dependencies: [libp11_test_dep, libp11_common_dep] + libffi_deps + dlopen_deps,
+                 dependencies: [libp11_test_dep] + libffi_deps + dlopen_deps,
                  link_with: libp11_kit_testable)
 endforeach
 
@@ -264,8 +263,7 @@ foreach name, sources : mock_sources
   shared_module(name,
                 sources,
                 name_prefix: '',
-                include_directories: [configinc, commoninc],
-                dependencies: [libp11_test_dep, libp11_common_dep])
+                dependencies: [libp11_test_dep])
 endforeach
 
 p11_kit_pc_variables = [
index 70786fa65cec7b3cb946546fe7ac172961862bd0..b6cb260422d97e77c6a73f9fbf137cbb78273d9b 100644 (file)
@@ -49,8 +49,7 @@ shared_module('p11-kit-trust',
               'module-init.c',
               name_prefix: '',
              c_args: p11_kit_trust_c_args,
-              dependencies: [libp11_library_dep,
-                             libp11_common_dep] + libtasn1_deps,
+              dependencies: [libp11_library_dep] + libtasn1_deps,
               link_with: libtrust_data,
               install: true,
               install_dir: prefix / p11_module_path)
@@ -90,7 +89,6 @@ executable('trust',
            c_args: common_c_args,
            link_with: libtrust_data,
            dependencies: [libp11_kit_dep,
-                          libp11_common_dep,
                           libp11_tool_dep] + libffi_deps + dlopen_deps + libtasn1_deps,
            install: true)
 
@@ -133,8 +131,7 @@ foreach name : trust_tests
                  c_args: common_c_args + tests_c_args + libtrust_testable_c_args,
                  dependencies: [libp11_kit_dep,
                                 libp11_library_dep,
-                                libp11_test_dep,
-                                libp11_common_dep] + dlopen_deps,
+                                libp11_test_dep] + dlopen_deps,
                  link_with: [libtrust_testable, libtrust_data, libtrust_test])
   test(name, t)
 endforeach
@@ -156,7 +153,6 @@ foreach name : trust_progs
                  c_args: tests_c_args,
                  dependencies: [libp11_kit_dep,
                                 libp11_library_dep,
-                                libp11_test_dep,
-                                libp11_common_dep] + libffi_deps + dlopen_deps,
+                                libp11_test_dep] + libffi_deps + dlopen_deps,
                  link_with: [libtrust_testable, libtrust_data, libtrust_test])
 endforeach