aboutsummaryrefslogtreecommitdiff
path: root/test cases/windows
diff options
context:
space:
mode:
authorJesse Natalie <jenatali@microsoft.com>2021-09-08 18:39:59 -0700
committerAndres Freund <andres@anarazel.de>2021-09-20 15:34:58 -0700
commit01ddf3ac13930ce077603db9e4823339cc4dc4d3 (patch)
tree3d2f306be6315612fc972c87810bfc2c7e60787c /test cases/windows
parenta8370e6d3f17e34f2303ecb5679efae2d0fa18c8 (diff)
downloadmeson-01ddf3ac13930ce077603db9e4823339cc4dc4d3.zip
meson-01ddf3ac13930ce077603db9e4823339cc4dc4d3.tar.gz
meson-01ddf3ac13930ce077603db9e4823339cc4dc4d3.tar.bz2
Add test for https://github.com/mesonbuild/meson/issues/9235
Diffstat (limited to 'test cases/windows')
-rw-r--r--test cases/windows/19 vs install static lib with generated obj deps/both_lib_source.c7
-rw-r--r--test cases/windows/19 vs install static lib with generated obj deps/copyfile.py4
-rw-r--r--test cases/windows/19 vs install static lib with generated obj deps/generated_source.c4
-rw-r--r--test cases/windows/19 vs install static lib with generated obj deps/meson.build20
-rw-r--r--test cases/windows/19 vs install static lib with generated obj deps/static_lib_source.c6
-rw-r--r--test cases/windows/19 vs install static lib with generated obj deps/test.json13
6 files changed, 54 insertions, 0 deletions
diff --git a/test cases/windows/19 vs install static lib with generated obj deps/both_lib_source.c b/test cases/windows/19 vs install static lib with generated obj deps/both_lib_source.c
new file mode 100644
index 0000000..aa926b1
--- /dev/null
+++ b/test cases/windows/19 vs install static lib with generated obj deps/both_lib_source.c
@@ -0,0 +1,7 @@
+extern int static_lib_function(void);
+extern __declspec(dllexport) int both_lib_function(void);
+
+int both_lib_function(void)
+{
+ return static_lib_function();
+}
diff --git a/test cases/windows/19 vs install static lib with generated obj deps/copyfile.py b/test cases/windows/19 vs install static lib with generated obj deps/copyfile.py
new file mode 100644
index 0000000..738e894
--- /dev/null
+++ b/test cases/windows/19 vs install static lib with generated obj deps/copyfile.py
@@ -0,0 +1,4 @@
+from shutil import copyfile
+import sys
+
+copyfile(sys.argv[1], sys.argv[2])
diff --git a/test cases/windows/19 vs install static lib with generated obj deps/generated_source.c b/test cases/windows/19 vs install static lib with generated obj deps/generated_source.c
new file mode 100644
index 0000000..8671cbf
--- /dev/null
+++ b/test cases/windows/19 vs install static lib with generated obj deps/generated_source.c
@@ -0,0 +1,4 @@
+int generated_function(void)
+{
+ return 42;
+}
diff --git a/test cases/windows/19 vs install static lib with generated obj deps/meson.build b/test cases/windows/19 vs install static lib with generated obj deps/meson.build
new file mode 100644
index 0000000..bc61772
--- /dev/null
+++ b/test cases/windows/19 vs install static lib with generated obj deps/meson.build
@@ -0,0 +1,20 @@
+project('test', 'c')
+
+generated_c = custom_target(
+ 'generated.c',
+ input : files('generated_source.c', 'copyfile.py'),
+ output : 'generated.c',
+ command : ['python', '@INPUT1@', '@INPUT0@', '@OUTPUT@'],
+)
+
+static_lib = static_library(
+ 'static_lib',
+ [files('static_lib_source.c'), generated_c],
+)
+
+both_lib = both_libraries(
+ 'both_lib',
+ [files('both_lib_source.c')],
+ link_with : [static_lib],
+ install : true,
+)
diff --git a/test cases/windows/19 vs install static lib with generated obj deps/static_lib_source.c b/test cases/windows/19 vs install static lib with generated obj deps/static_lib_source.c
new file mode 100644
index 0000000..e86153a
--- /dev/null
+++ b/test cases/windows/19 vs install static lib with generated obj deps/static_lib_source.c
@@ -0,0 +1,6 @@
+extern int generated_function(void);
+
+int static_lib_function(void)
+{
+ return generated_function();
+}
diff --git a/test cases/windows/19 vs install static lib with generated obj deps/test.json b/test cases/windows/19 vs install static lib with generated obj deps/test.json
new file mode 100644
index 0000000..451da1e
--- /dev/null
+++ b/test cases/windows/19 vs install static lib with generated obj deps/test.json
@@ -0,0 +1,13 @@
+{
+ "installed": [
+ {"type": "file", "file": "usr/lib/libboth_lib.a"},
+
+ {"type": "shared_lib", "platform": "msvc", "file": "usr/bin/both_lib"},
+ {"type": "implib", "platform": "msvc", "file": "usr/lib/both_lib"},
+ {"type": "pdb", "platform": "msvc", "file": "usr/bin/both_lib"},
+
+ {"type": "expr", "platform": "gcc", "file": "usr/lib/?libboth_lib.dll"},
+ {"type": "implib", "platform": "gcc", "file": "usr/lib/libboth_lib"},
+ {"type": "pdb", "platform": "gcc", "file": "usr/bin/libboth_lib"}
+ ]
+}