summarylogtreecommitdiffstats
path: root/build-most-modules-statically-hack.diff
blob: c845e819777490d3c8abd40bc79f02384d304ae0 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
From: Michael Tokarev <mjt@tls.msk.ru>
Subject: build most modules statically (hack)

This hack makes the build procedure to build most modules statically,
except block and gui modules which goes into their own packages.
The rest are built into the executables directly in order to make
qemu-system-common package (where all other modules goes) to be
more-or-less version-independent.

There's little reason to build these as modules or to ship them in
separate packages.

diff --git a/meson.build b/meson.build
index e3386196ba..a28f7d10f1 100644
--- a/meson.build
+++ b/meson.build
@@ -1587,13 +1587,19 @@ softmmu_mods = []
 foreach d, list : modules
   foreach m, module_ss : list
     if enable_modules and targetos != 'windows'
-      module_ss = module_ss.apply(config_all, strict: false)
-      sl = static_library(d + '-' + m, [genh, module_ss.sources()],
-                          dependencies: [modulecommon, module_ss.dependencies()], pic: true)
+      module_dn = module_ss.apply(config_all, strict: false)
+      sl = static_library(d + '-' + m, [genh, module_dn.sources()],
+                          dependencies: [modulecommon, module_dn.dependencies()], pic: true)
       if d == 'block'
         block_mods += sl
       else
-        softmmu_mods += sl
+        # we only build 2 non-block modules as modules: it is the gui part
+        if d + '-' + m in [ 'ui-gtk', 'ui-sdl', 'audio-pa' ]
+          softmmu_mods += sl
+        else
+          warning('Compiling module statically: ' + d + '-' + m)
+          softmmu_ss.add_all(module_ss)
+        endif
       endif
     else
       if d == 'block'