]> git.ipfire.org Git - thirdparty/kmod.git/commitdiff
meson: Move symlinks up
authorLucas De Marchi <lucas.de.marchi@gmail.com>
Mon, 9 Sep 2024 07:08:54 +0000 (02:08 -0500)
committerLucas De Marchi <lucas.de.marchi@gmail.com>
Mon, 9 Sep 2024 13:53:48 +0000 (08:53 -0500)
Currently it's only possible to test the tools by using the symlink.
However, differently from autotools, the symlink is created inside the
testsuite dir, and only if build-tests=true. Move it to the same
directory that kmod is so it's possible to test without the testsuite.

Signed-off-by: Lucas De Marchi <lucas.de.marchi@gmail.com>
Reviewed-by: Emil Velikov <emil.l.velikov@gmail.com>
Link: https://github.com/kmod-project/kmod/pull/120
meson.build
testsuite/meson.build

index ac52d0db8df6d496f3e73def5d55554d8c50e1bf..dc0581aae91354a22b7d8c53ecebae94802b52b7 100644 (file)
@@ -401,6 +401,18 @@ foreach tool : _tools
   endif
 endforeach
 
+internal_kmod_symlinks = []
+
+foreach tool : _tools
+  internal_kmod_symlinks += custom_target(
+    tool,
+    command : ['ln', '-sf', kmod, '@OUTPUT@'],
+    output : tool,
+    depends : kmod,
+    build_by_default : true,
+  )
+endforeach
+
 # ------------------------------------------------------------------------------
 # TESTSUITE
 # ------------------------------------------------------------------------------
index 585646e280998eb043eaf3500b566411262613f4..9b69f3453a9e9e393be26e6509dab2eab21e8395 100644 (file)
@@ -2,18 +2,6 @@ if not get_option('tools')
   error('The test suite requires also building the tools')
 endif
 
-test_kmod_symlinks = []
-
-foreach tool : _tools
-  test_kmod_symlinks += custom_target(
-    tool,
-    command : ['ln', '-sf', kmod, '@OUTPUT@'],
-    output : tool,
-    depends : kmod,
-    build_by_default : false,
-  )
-endforeach
-
 build_module_playground = custom_target(
   'build-module-playground',
   command : [
@@ -73,7 +61,7 @@ endforeach
 
 testsuite_c_args = [
   '-DTESTSUITE_ROOTFS="@0@/testsuite/rootfs/"'.format(meson.project_build_root()),
-  '-DTOOLS_DIR="@0@/testsuite/"'.format(meson.project_build_root()),
+  '-DTOOLS_DIR="@0@/"'.format(meson.project_build_root()),
   '-DOVERRIDE_LIBDIR="@0@/testsuite/"'.format(meson.project_build_root()),
 ]
 
@@ -118,6 +106,6 @@ foreach input : _testsuite
       link_with : [libshared, libkmod_internal, libtestsuite],
       build_by_default : false,
     ),
-    depends : [test_kmod_symlinks, create_rootfs, test_override_mods],
+    depends : [internal_kmod_symlinks, create_rootfs, test_override_mods],
   )
 endforeach