summaryrefslogtreecommitdiff
path: root/lib/meson.build
diff options
context:
space:
mode:
authorEric Anholt <eric@anholt.net>2017-09-05 14:36:19 +0200
committerDaniel Vetter <daniel.vetter@ffwll.ch>2017-09-08 17:06:41 +0200
commit678f1d60e98cb76d2e59b3a6e31f26e353453a63 (patch)
treecdeb02f9e3c2d79efd08d188282d28a8ad3d0c75 /lib/meson.build
parent21088b301387bf3239fc8799176e2a51c392ebe8 (diff)
meson: Use static libs to handle IGT_LOG_DOMAIN.
It means that compiler errors in the .c files take you to the source place in your editor, not a preprocessed temporary. v2: Add the library deps, fails linking otherwise. Signed-off-by: Eric Anholt <eric@anholt.net> (v1) Acked-by: Jani Nikula <jani.nikula@intel.com> Acked-by: Arkadiusz Hiler <arkadiusz.hiler@intel.com> Acked-by: Petri Latvala <petri.latvala@intel.com> Acked-by: Daniel Stone <daniels@collabora.com> Acked-by: Radoslaw Szwichtenberg <radoslaw.szwichtenberg@intel.com> Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Diffstat (limited to 'lib/meson.build')
-rw-r--r--lib/meson.build36
1 files changed, 25 insertions, 11 deletions
diff --git a/lib/meson.build b/lib/meson.build
index 51d3f9e2..f0672edf 100644
--- a/lib/meson.build
+++ b/lib/meson.build
@@ -144,19 +144,33 @@ vcs_tag(input : 'version.h.in', output : 'version.h',
fallback : 'NO-GIT',
command : [ 'git', 'log', '-n1', '--pretty=format:g%h' ] )
-# FIXME we don't regenerate when the script changes
-prepend_log_domain = generator(find_program('prepend_log_domain.sh'),
- arguments : [ '@INPUT@', '@OUTPUT@' ],
- output : '@PLAINNAME@' + '.pre.c')
-
-processed_src_dep = prepend_log_domain.process(lib_sources)
+lib_intermediates = []
+foreach f: lib_sources
+ # No / in the target name
+ if f.contains('uwildmat')
+ name = 'uwildmat'
+ else
+ name = f
+ endif
+
+ lib = static_library('igt-' + name,
+ f,
+ include_directories: inc,
+ dependencies : lib_deps,
+ c_args : [
+ '-DIGT_DATADIR="@0@"'.format(pkgdatadir),
+ '-DIGT_SRCDIR="@0@"'.format(srcdir),
+ '-DIGT_LOG_DOMAIN="@0@"'.format(f.split('.')[0]),
+ ])
+
+ lib_intermediates += lib
+endforeach
lib_igt_build = shared_library('igt',
- processed_src_dep,
- include_directories : inc,
- dependencies : lib_deps,
- c_args : [ '-DIGT_DATADIR="@0@"'.format(pkgdatadir),
- '-DIGT_SRCDIR="@0@"'.format(srcdir), ])
+ ['dummy.c'],
+ link_whole: lib_intermediates,
+ dependencies: lib_deps,
+)
lib_igt = declare_dependency(link_with : lib_igt_build,
include_directories : inc)