Merge pull request #85 from whot/wip/static-lib-sources meson.build: manually link all sources into the library
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 41 42 43 44 45 46 47 48
diff --git a/meson.build b/meson.build
index 4e22025..e10dd13 100644
--- a/meson.build
+++ b/meson.build
@@ -122,8 +122,7 @@ yacc_gen = generator(
output: ['@BASENAME@.c', '@BASENAME@.h'],
arguments: ['@INPUT@', '--defines=@OUTPUT1@', '--output=@OUTPUT0@', '-p _xkbcommon_'],
)
-libxkbcommon_internal = static_library(
- 'xkbcommon-internal',
+libxkbcommon_sources = [
'src/compose/parser.c',
'src/compose/parser.h',
'src/compose/paths.c',
@@ -177,8 +176,7 @@ libxkbcommon_internal = static_library(
'src/utf8.h',
'src/utils.c',
'src/utils.h',
- include_directories: include_directories('src'),
-)
+]
libxkbcommon_link_args = []
if have_version_script
libxkbcommon_link_args += '-Wl,--version-script=' + join_paths(meson.source_root(), 'xkbcommon.map')
@@ -186,11 +184,12 @@ endif
libxkbcommon = library(
'xkbcommon',
'xkbcommon/xkbcommon.h',
- link_whole: libxkbcommon_internal,
+ libxkbcommon_sources,
link_args: libxkbcommon_link_args,
link_depends: 'xkbcommon.map',
version: '0.0.0',
install: true,
+ include_directories: include_directories('src'),
)
install_headers(
'xkbcommon/xkbcommon.h',
@@ -281,8 +280,8 @@ libxkbcommon_test_internal = static_library(
'test/common.c',
'test/test.h',
'test/evdev-scancodes.h',
+ libxkbcommon_sources,
include_directories: include_directories('src'),
- link_with: libxkbcommon_internal,
)
test_dep = declare_dependency(
include_directories: include_directories('src'),