[libsoup/wip/meson] meson: Build test utility library as static on MSVC builds
- From: Chun-wei Fan <fanchunwei src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [libsoup/wip/meson] meson: Build test utility library as static on MSVC builds
- Date: Mon, 4 Dec 2017 09:21:48 +0000 (UTC)
commit c1cf2081e470290015d313c7ea23d21665a8da2b
Author: Chun-wei Fan <fanchunwei src gnome org>
Date: Mon Dec 4 17:13:20 2017 +0800
meson: Build test utility library as static on MSVC builds
Visual Studio builds need __declspec(dllexport) directives to export
symbols and (more importantly) public variables. Since this is a
library that is private to the test programs, build it as a static
library so that we don't have to go through decorating the function
prototypes and the extern variables in the headers.
tests/meson.build | 14 ++++++++++----
1 files changed, 10 insertions(+), 4 deletions(-)
---
diff --git a/tests/meson.build b/tests/meson.build
index c7060cd..91d42a9 100644
--- a/tests/meson.build
+++ b/tests/meson.build
@@ -1,6 +1,12 @@
-test_utils = library('test-utils', 'test-utils.c', 'test-utils.h',
- install : false,
- dependencies : [glib_dep, libsoup_dep])
+if cc.get_id() == 'msvc'
+ test_utils = static_library('test-utils', 'test-utils.c', 'test-utils.h',
+ install : false,
+ dependencies : [glib_dep, libsoup_dep])
+else
+ test_utils = library('test-utils', 'test-utils.c', 'test-utils.h',
+ install : false,
+ dependencies : [glib_dep, libsoup_dep])
+endif
if apache_httpd2.found()
add_project_arguments('-DAPACHE_HTTPD=' + cdata.get('APACHE_HTTPD'), language : 'c')
@@ -59,7 +65,7 @@ foreach test: tests
test_name = '@0@-test'.format(test[0])
test_target = executable(test_name, test_name + '.c',
link_with: test_utils,
- dependencies : [glib_dep, libsoup_dep])
+ dependencies : [glib_dep, libsoup_dep, platform_deps])
test(test_name, test_target, env : env, is_parallel : test[1])
endforeach
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]