aboutsummaryrefslogtreecommitdiffstats
path: root/meson/test cases/d/4 library versions
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/4 library versions
parente02cda008591317b1625707ff8e115a4841aa889 (diff)
Add submodule dependency filesHEADmaster
Change-Id: Iaf8d18082d3991dec7c0ebbea540f092188eb4ec
Diffstat (limited to 'meson/test cases/d/4 library versions')
-rw-r--r--meson/test cases/d/4 library versions/lib.d16
-rw-r--r--meson/test cases/d/4 library versions/meson.build25
-rw-r--r--meson/test cases/d/4 library versions/test.json25
3 files changed, 66 insertions, 0 deletions
diff --git a/meson/test cases/d/4 library versions/lib.d b/meson/test cases/d/4 library versions/lib.d
new file mode 100644
index 000000000..f1e177d99
--- /dev/null
+++ b/meson/test cases/d/4 library versions/lib.d
@@ -0,0 +1,16 @@
+
+import std.stdio;
+import std.string : format;
+
+@safe
+export int printLibraryString (string str)
+{
+ writeln ("Library says: %s".format (str));
+ return 4;
+}
+
+version (Windows)
+{
+ import core.sys.windows.dll;
+ mixin SimpleDllMain;
+}
diff --git a/meson/test cases/d/4 library versions/meson.build b/meson/test cases/d/4 library versions/meson.build
new file mode 100644
index 000000000..c745b9227
--- /dev/null
+++ b/meson/test cases/d/4 library versions/meson.build
@@ -0,0 +1,25 @@
+project('D library versions', '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
+
+shared_library('some', 'lib.d',
+ version : '1.2.3',
+ soversion : '0',
+ install : true)
+
+shared_library('noversion', 'lib.d',
+ install : true)
+
+shared_library('onlyversion', 'lib.d',
+ version : '1.4.5',
+ install : true)
+
+shared_library('onlysoversion', 'lib.d',
+ # Also test that int soversion is acceptable
+ soversion : 5,
+ install : true)
diff --git a/meson/test cases/d/4 library versions/test.json b/meson/test cases/d/4 library versions/test.json
new file mode 100644
index 000000000..23c95dd52
--- /dev/null
+++ b/meson/test cases/d/4 library versions/test.json
@@ -0,0 +1,25 @@
+{
+ "installed": [
+ {"type": "shared_lib", "platform": "gcc", "file": "usr/lib/some"},
+ {"type": "shared_lib", "platform": "gcc", "file": "usr/lib/some", "version": "0"},
+ {"type": "shared_lib", "platform": "gcc", "file": "usr/lib/some", "version": "1.2.3"},
+ {"type": "shared_lib", "platform": "gcc", "file": "usr/lib/noversion"},
+ {"type": "shared_lib", "platform": "gcc", "file": "usr/lib/onlyversion"},
+ {"type": "shared_lib", "platform": "gcc", "file": "usr/lib/onlyversion", "version": "1"},
+ {"type": "shared_lib", "platform": "gcc", "file": "usr/lib/onlyversion", "version": "1.4.5"},
+ {"type": "shared_lib", "platform": "gcc", "file": "usr/lib/onlysoversion"},
+ {"type": "shared_lib", "platform": "gcc", "file": "usr/lib/onlysoversion", "version": "5"},
+ {"type": "shared_lib", "platform": "msvc", "file": "usr/bin/noversion"},
+ {"type": "pdb", "file": "usr/bin/noversion", "language": "d"},
+ {"type": "shared_lib", "platform": "msvc", "file": "usr/bin/onlysoversion", "version": "5"},
+ {"type": "pdb", "file": "usr/bin/onlysoversion", "version": "5", "language": "d"},
+ {"type": "shared_lib", "platform": "msvc", "file": "usr/bin/onlyversion", "version": "1"},
+ {"type": "pdb", "file": "usr/bin/onlyversion", "version": "1", "language": "d"},
+ {"type": "shared_lib", "platform": "msvc", "file": "usr/bin/some", "version": "0"},
+ {"type": "pdb", "file": "usr/bin/some", "version": "0", "language": "d"},
+ {"type": "implib", "file": "usr/lib/noversion"},
+ {"type": "implib", "file": "usr/lib/onlysoversion"},
+ {"type": "implib", "file": "usr/lib/onlyversion"},
+ {"type": "implib", "file": "usr/lib/some"}
+ ]
+}