[libglnx/wip/smcv/subproject: 1/4] tests: Build libglnx-testlib as a separate static library




commit 670a4be8a445d0080e5ec61b32dd6be1787d2195
Author: Simon McVittie <smcv collabora com>
Date:   Thu Apr 21 18:33:18 2022 +0100

    tests: Build libglnx-testlib as a separate static library
    
    One of Flatpak's unit tests uses this, for _GLNX_TEST_SCOPED_TEMP_DIR.
    Its API is not really stable, but libglnx is a "copylib" anyway, so
    none of it has (or needs) a strictly stable API.
    
    Signed-off-by: Simon McVittie <smcv collabora com>

 tests/meson.build | 17 +++++++++++++++--
 1 file changed, 15 insertions(+), 2 deletions(-)
---
diff --git a/tests/meson.build b/tests/meson.build
index 2ad8c44..d60563f 100644
--- a/tests/meson.build
+++ b/tests/meson.build
@@ -2,6 +2,21 @@
 # Copyright 2019 Collabora Ltd.
 # SPDX-License-Identifier: LGPL-2.1-or-later
 
+libglnx_testlib = static_library(
+  'glnx-testlib',
+  'libglnx-testlib.c',
+  'libglnx-testlib.h',
+  dependencies : [
+    libglnx_dep,
+    libglnx_deps,
+  ],
+  install : false,
+)
+libglnx_dep = declare_dependency(
+  include_directories : include_directories('.'),
+  link_with : libglnx_testlib,
+)
+
 test_names = [
   'errors',
   'fdio',
@@ -13,8 +28,6 @@ test_names = [
 foreach test_name : test_names
   exe = executable(test_name,
     [
-      'libglnx-testlib.c',
-      'libglnx-testlib.h',
       'test-libglnx-' + test_name + '.c',
     ],
     dependencies: [


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]