aboutsummaryrefslogtreecommitdiffstats
path: root/meson/test cases/d/7 multilib
diff options
context:
space:
mode:
authorAngelos Mouzakitis <a.mouzakitis@virtualopensystems.com>2023-10-10 14:33:42 +0000
committerAngelos Mouzakitis <a.mouzakitis@virtualopensystems.com>2023-10-10 14:33:42 +0000
commitaf1a266670d040d2f4083ff309d732d648afba2a (patch)
tree2fc46203448ddcc6f81546d379abfaeb323575e9 /meson/test cases/d/7 multilib
parente02cda008591317b1625707ff8e115a4841aa889 (diff)
Add submodule dependency filesHEADmaster
Change-Id: Iaf8d18082d3991dec7c0ebbea540f092188eb4ec
Diffstat (limited to 'meson/test cases/d/7 multilib')
-rw-r--r--meson/test cases/d/7 multilib/app.d9
-rw-r--r--meson/test cases/d/7 multilib/meson.build24
-rw-r--r--meson/test cases/d/7 multilib/say1.d15
-rw-r--r--meson/test cases/d/7 multilib/say1.di1
-rw-r--r--meson/test cases/d/7 multilib/say2.d15
-rw-r--r--meson/test cases/d/7 multilib/say2.di1
-rw-r--r--meson/test cases/d/7 multilib/test.json18
7 files changed, 83 insertions, 0 deletions
diff --git a/meson/test cases/d/7 multilib/app.d b/meson/test cases/d/7 multilib/app.d
new file mode 100644
index 000000000..892596ad9
--- /dev/null
+++ b/meson/test cases/d/7 multilib/app.d
@@ -0,0 +1,9 @@
+
+import say1;
+import say2;
+
+void main ()
+{
+ assert (sayHello1 ("Dave") == 4);
+ assert (sayHello2 ("HAL 9000") == 8);
+}
diff --git a/meson/test cases/d/7 multilib/meson.build b/meson/test cases/d/7 multilib/meson.build
new file mode 100644
index 000000000..1879c083f
--- /dev/null
+++ b/meson/test cases/d/7 multilib/meson.build
@@ -0,0 +1,24 @@
+project('D Multiple Versioned Shared Libraries', 'd')
+
+dc = meson.get_compiler('d')
+if dc.get_id() == 'gcc'
+ if dc.version().version_compare('< 8')
+ error('MESON_SKIP_TEST: GDC < 8.0 can not build shared libraries')
+ endif
+endif
+
+ldyn1 = shared_library('say1',
+ 'say1.d',
+ install: true,
+ version : '1.2.3',
+ soversion : '0'
+)
+ldyn2 = shared_library('say2',
+ 'say2.d',
+ install: true,
+ version : '1.2.4',
+ soversion : '1'
+)
+
+ed = executable('app_d', 'app.d', link_with: [ldyn1, ldyn2], install: true)
+test('multilink_test', ed)
diff --git a/meson/test cases/d/7 multilib/say1.d b/meson/test cases/d/7 multilib/say1.d
new file mode 100644
index 000000000..605fd2355
--- /dev/null
+++ b/meson/test cases/d/7 multilib/say1.d
@@ -0,0 +1,15 @@
+
+import std.stdio;
+import std.string : format;
+
+export int sayHello1 (string str)
+{
+ writeln ("Hello %s from library 1.".format (str));
+ return 4;
+}
+
+version (Windows)
+{
+ import core.sys.windows.dll;
+ mixin SimpleDllMain;
+}
diff --git a/meson/test cases/d/7 multilib/say1.di b/meson/test cases/d/7 multilib/say1.di
new file mode 100644
index 000000000..8a9ff02da
--- /dev/null
+++ b/meson/test cases/d/7 multilib/say1.di
@@ -0,0 +1 @@
+int sayHello1 (string str);
diff --git a/meson/test cases/d/7 multilib/say2.d b/meson/test cases/d/7 multilib/say2.d
new file mode 100644
index 000000000..7270ebd22
--- /dev/null
+++ b/meson/test cases/d/7 multilib/say2.d
@@ -0,0 +1,15 @@
+
+import std.stdio;
+import std.string : format;
+
+export int sayHello2 (string str)
+{
+ writeln ("Hello %s from library 2.".format (str));
+ return 8;
+}
+
+version (Windows)
+{
+ import core.sys.windows.dll;
+ mixin SimpleDllMain;
+}
diff --git a/meson/test cases/d/7 multilib/say2.di b/meson/test cases/d/7 multilib/say2.di
new file mode 100644
index 000000000..da712f0de
--- /dev/null
+++ b/meson/test cases/d/7 multilib/say2.di
@@ -0,0 +1 @@
+int sayHello2 (string str);
diff --git a/meson/test cases/d/7 multilib/test.json b/meson/test cases/d/7 multilib/test.json
new file mode 100644
index 000000000..5944ae0e1
--- /dev/null
+++ b/meson/test cases/d/7 multilib/test.json
@@ -0,0 +1,18 @@
+{
+ "installed": [
+ {"type": "exe", "file": "usr/bin/app_d"},
+ {"type": "pdb", "file": "usr/bin/app_d", "language": "d"},
+ {"type": "shared_lib", "platform": "gcc", "file": "usr/lib/say1"},
+ {"type": "shared_lib", "platform": "gcc", "file": "usr/lib/say1", "version": "0"},
+ {"type": "shared_lib", "platform": "gcc", "file": "usr/lib/say1", "version": "1.2.3"},
+ {"type": "shared_lib", "platform": "gcc", "file": "usr/lib/say2"},
+ {"type": "shared_lib", "platform": "gcc", "file": "usr/lib/say2", "version": "1"},
+ {"type": "shared_lib", "platform": "gcc", "file": "usr/lib/say2", "version": "1.2.4"},
+ {"type": "shared_lib", "platform": "msvc", "file": "usr/bin/say1", "version": "0"},
+ {"type": "pdb", "file": "usr/bin/say1", "version": "0", "language": "d"},
+ {"type": "shared_lib", "platform": "msvc", "file": "usr/bin/say2", "version": "1"},
+ {"type": "pdb", "file": "usr/bin/say2", "version": "1", "language": "d"},
+ {"type": "implib", "file": "usr/lib/say1"},
+ {"type": "implib", "file": "usr/lib/say2"}
+ ]
+}