summaryrefslogtreecommitdiff
path: root/test cases/windows
diff options
context:
space:
mode:
authorJon Turney <jon.turney@dronecode.org.uk>2017-04-14 13:58:21 +0100
committerJon Turney <jon.turney@dronecode.org.uk>2017-07-20 21:11:56 +0100
commit3fa3922cea27026d44aef1cdf3ca92d82adc7ced (patch)
tree512b4bed85b53dfd95add859b0724a1ed84d9754 /test cases/windows
parentb43f4841ba5de2e8bc956eb9fd1f578f90d7ae15 (diff)
downloadmeson-3fa3922cea27026d44aef1cdf3ca92d82adc7ced.tar.gz
Support implibs for executables on Windows
Add a boolean 'implib' kwarg to executable(). If true, it is permitted to use the returned build target object in link_with: On platforms where this makes sense (e.g. Windows), an implib is generated for the executable and used when linking. Otherwise, it has no effect. (Rather than checking if it is a StaticLibrary or SharedLibary, BuildTarget subclasses gain the is_linkable_target method to test if they can appear in link_with:) Also install any executable implib in a similar way to a shared library implib, i.e. placing the implib in the appropriate place Add tests of: - a shared_module containing a reference to a symbol which is known (at link time) to be provided by the executable - trying to link with non-implib executables (should fail) - installing the implib (This last one needs a little enhancement of the installed file checking as this is the first install test we have which needs to work with either MSVC-style or GCC-style implib filenames)
Diffstat (limited to 'test cases/windows')
-rw-r--r--test cases/windows/12 exe implib/installed_files.txt4
-rw-r--r--test cases/windows/12 exe implib/meson.build7
-rw-r--r--test cases/windows/12 exe implib/prog.c6
3 files changed, 17 insertions, 0 deletions
diff --git a/test cases/windows/12 exe implib/installed_files.txt b/test cases/windows/12 exe implib/installed_files.txt
new file mode 100644
index 000000000..d0ea8f6c4
--- /dev/null
+++ b/test cases/windows/12 exe implib/installed_files.txt
@@ -0,0 +1,4 @@
+usr/bin/prog.exe
+usr/bin/prog.pdb
+?gcc:usr/lib/libprog.exe.a
+?msvc:usr/lib/prog.lib
diff --git a/test cases/windows/12 exe implib/meson.build b/test cases/windows/12 exe implib/meson.build
new file mode 100644
index 000000000..2393e794c
--- /dev/null
+++ b/test cases/windows/12 exe implib/meson.build
@@ -0,0 +1,7 @@
+project('wintest', 'c')
+
+# Test that we can produce an implib for an executable on Windows, and that it
+# is installed along with the executable
+
+prog = executable('prog', 'prog.c', install: true, implib: true)
+test('wintest', prog)
diff --git a/test cases/windows/12 exe implib/prog.c b/test cases/windows/12 exe implib/prog.c
new file mode 100644
index 000000000..6d5a9f501
--- /dev/null
+++ b/test cases/windows/12 exe implib/prog.c
@@ -0,0 +1,6 @@
+#include <windows.h>
+
+int __declspec(dllexport)
+main(int argc, char **argv) {
+ return 0;
+}