meson.build: link the sources directly into libxkbcommon-x11
authorPeter Hutterer <peter.hutterer@who-t.net>
Sun, 10 Feb 2019 23:19:28 +0000 (09:19 +1000)
committerRan Benita <ran234@gmail.com>
Mon, 11 Feb 2019 09:35:34 +0000 (11:35 +0200)
Similar to 75ce741ab97e3d17a0c9b06dd4bdf57c00d5538e, just for the -x11
sublibrary.

This works around meson bug 3937, 'link_whole' arguments don't get added into
the final static library and we end up with a virtually empty 8-byte
libxkbcommon-x11.a file, see https://github.com/mesonbuild/meson/issues/3937

The internal lib is still built for the one test case that requires it.

Fixes #86

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
meson.build

index a631ae9..e5bec7d 100644 (file)
@@ -217,8 +217,7 @@ if get_option('enable-x11')
 You can disable X11 support with -Denable-x11=false.''')
     endif
 
-    libxkbcommon_x11_internal = static_library(
-        'xkbcommon-x11-internal',
+    libxkbcommon_x11_sources = [
         'src/x11/keymap.c',
         'src/x11/state.c',
         'src/x11/util.c',
@@ -229,6 +228,10 @@ You can disable X11 support with -Denable-x11=false.''')
         'src/keymap-priv.c',
         'src/atom.h',
         'src/atom.c',
+    ]
+    libxkbcommon_x11_internal = static_library(
+        'xkbcommon-x11-internal',
+        libxkbcommon_x11_sources,
         include_directories: include_directories('src'),
         link_with: libxkbcommon,
         dependencies: [
@@ -243,11 +246,17 @@ You can disable X11 support with -Denable-x11=false.''')
     libxkbcommon_x11 = library(
         'xkbcommon-x11',
         'xkbcommon/xkbcommon-x11.h',
-        link_whole: libxkbcommon_x11_internal,
+        libxkbcommon_x11_sources,
         link_args: libxkbcommon_x11_link_args,
         link_depends: 'xkbcommon-x11.map',
         version: '0.0.0',
         install: true,
+        include_directories: include_directories('src'),
+        link_with: libxkbcommon,
+        dependencies: [
+            xcb_dep,
+            xcb_xkb_dep,
+        ],
     )
     install_headers(
         'xkbcommon/xkbcommon-x11.h',