summaryrefslogtreecommitdiff
path: root/test cases/common/53 install script/src
diff options
context:
space:
mode:
authorJussi Pakkanen <jpakkane@gmail.com>2021-04-26 16:52:13 +0300
committerJussi Pakkanen <jpakkane@gmail.com>2021-04-26 23:39:15 +0100
commite75e3976facda7de244fbb9a02eebf0d043ea1c8 (patch)
treedab22f95b5c837a70b1b4164d97ff351a49ffd81 /test cases/common/53 install script/src
parent53fe7c2f0a51697cd57628753852dd3f8711becf (diff)
downloadmeson-e75e3976facda7de244fbb9a02eebf0d043ea1c8.tar.gz
Condense test directory names.
Diffstat (limited to 'test cases/common/53 install script/src')
-rw-r--r--test cases/common/53 install script/src/a file.txt0
-rw-r--r--test cases/common/53 install script/src/foo.c10
-rw-r--r--test cases/common/53 install script/src/meson.build5
-rw-r--r--test cases/common/53 install script/src/myinstall.py14
4 files changed, 29 insertions, 0 deletions
diff --git a/test cases/common/53 install script/src/a file.txt b/test cases/common/53 install script/src/a file.txt
new file mode 100644
index 000000000..e69de29bb
--- /dev/null
+++ b/test cases/common/53 install script/src/a file.txt
diff --git a/test cases/common/53 install script/src/foo.c b/test cases/common/53 install script/src/foo.c
new file mode 100644
index 000000000..46cb845f9
--- /dev/null
+++ b/test cases/common/53 install script/src/foo.c
@@ -0,0 +1,10 @@
+#ifdef _WIN32
+ #define DO_EXPORT __declspec(dllexport)
+#else
+ #define DO_EXPORT
+#endif
+
+DO_EXPORT int foo(void)
+{
+ return 0;
+}
diff --git a/test cases/common/53 install script/src/meson.build b/test cases/common/53 install script/src/meson.build
new file mode 100644
index 000000000..72de34609
--- /dev/null
+++ b/test cases/common/53 install script/src/meson.build
@@ -0,0 +1,5 @@
+meson.add_install_script('myinstall.py', 'this/does', 'something-different.dat')
+
+afile = files('a file.txt')
+
+mylib = shared_library('mylib', 'foo.c')
diff --git a/test cases/common/53 install script/src/myinstall.py b/test cases/common/53 install script/src/myinstall.py
new file mode 100644
index 000000000..3a9d89b50
--- /dev/null
+++ b/test cases/common/53 install script/src/myinstall.py
@@ -0,0 +1,14 @@
+#!/usr/bin/env python3
+
+import os
+import sys
+
+prefix = os.environ['MESON_INSTALL_DESTDIR_PREFIX']
+
+dirname = os.path.join(prefix, sys.argv[1])
+
+if not os.path.exists(dirname):
+ os.makedirs(dirname)
+
+with open(os.path.join(dirname, sys.argv[2] + '.in'), 'w') as f:
+ f.write('')