aboutsummaryrefslogtreecommitdiff
path: root/test cases
diff options
context:
space:
mode:
authorJussi Pakkanen <jpakkane@gmail.com>2015-03-26 18:01:14 +0200
committerJussi Pakkanen <jpakkane@gmail.com>2015-03-26 18:01:14 +0200
commit94bc5f40334a1339d611812fbd853bde45942135 (patch)
tree38e4be21b0b53e494d2742f4661e52eb87788572 /test cases
parent4e097ec7026886f09a97b26e3c7fb619fae120f9 (diff)
downloadmeson-94bc5f40334a1339d611812fbd853bde45942135.zip
meson-94bc5f40334a1339d611812fbd853bde45942135.tar.gz
meson-94bc5f40334a1339d611812fbd853bde45942135.tar.bz2
Shameful hack to get configure files working with custom targets. Needs to be fixed properly during file object refactoring.
Diffstat (limited to 'test cases')
-rw-r--r--test cases/common/76 configure file in custom target/inc/confdata.in1
-rw-r--r--test cases/common/76 configure file in custom target/inc/meson.build6
-rw-r--r--test cases/common/76 configure file in custom target/meson.build4
-rw-r--r--test cases/common/76 configure file in custom target/src/meson.build4
-rw-r--r--test cases/common/76 configure file in custom target/src/mycompiler.py8
5 files changed, 23 insertions, 0 deletions
diff --git a/test cases/common/76 configure file in custom target/inc/confdata.in b/test cases/common/76 configure file in custom target/inc/confdata.in
new file mode 100644
index 0000000..e44cdea
--- /dev/null
+++ b/test cases/common/76 configure file in custom target/inc/confdata.in
@@ -0,0 +1 @@
+@VALUE@
diff --git a/test cases/common/76 configure file in custom target/inc/meson.build b/test cases/common/76 configure file in custom target/inc/meson.build
new file mode 100644
index 0000000..05d2dcb
--- /dev/null
+++ b/test cases/common/76 configure file in custom target/inc/meson.build
@@ -0,0 +1,6 @@
+cdata = configuration_data()
+cdata.set('VALUE', '42')
+
+cfile = configure_file(input : 'confdata.in',
+output : 'confdata',
+configuration : cdata)
diff --git a/test cases/common/76 configure file in custom target/meson.build b/test cases/common/76 configure file in custom target/meson.build
new file mode 100644
index 0000000..0a850a1
--- /dev/null
+++ b/test cases/common/76 configure file in custom target/meson.build
@@ -0,0 +1,4 @@
+project('conf file in custom target', 'c')
+
+subdir('inc')
+subdir('src')
diff --git a/test cases/common/76 configure file in custom target/src/meson.build b/test cases/common/76 configure file in custom target/src/meson.build
new file mode 100644
index 0000000..b049e95
--- /dev/null
+++ b/test cases/common/76 configure file in custom target/src/meson.build
@@ -0,0 +1,4 @@
+custom_target('thing',
+output : 'final.dat',
+input : cfile,
+command : [find_program('mycompiler.py'), '@INPUT@', '@OUTPUT@'])
diff --git a/test cases/common/76 configure file in custom target/src/mycompiler.py b/test cases/common/76 configure file in custom target/src/mycompiler.py
new file mode 100644
index 0000000..d5dcab5
--- /dev/null
+++ b/test cases/common/76 configure file in custom target/src/mycompiler.py
@@ -0,0 +1,8 @@
+#!/usr/bin/env python3
+
+import sys
+
+ifile = open(sys.argv[1])
+if ifile.readline().strip() != '42':
+ print('Incorrect input')
+open(sys.argv[2], 'w').write('Success\n')