summaryrefslogtreecommitdiff
path: root/Tests/BuildDepends/Project/generator.cxx
diff options
context:
space:
mode:
Diffstat (limited to 'Tests/BuildDepends/Project/generator.cxx')
-rw-r--r--Tests/BuildDepends/Project/generator.cxx24
1 files changed, 24 insertions, 0 deletions
diff --git a/Tests/BuildDepends/Project/generator.cxx b/Tests/BuildDepends/Project/generator.cxx
new file mode 100644
index 000000000..92a122de8
--- /dev/null
+++ b/Tests/BuildDepends/Project/generator.cxx
@@ -0,0 +1,24 @@
+#include <stdio.h>
+
+extern const char* foo();
+
+int main(int argc, const char* argv[])
+{
+ if(argc < 3)
+ {
+ fprintf(stderr, "Must specify output file and symbol prefix!");
+ return 1;
+ }
+ if(FILE* fout = fopen(argv[1], "w"))
+ {
+ fprintf(fout, "static const char* %s_string = \"%s\";\n", argv[2],
+ foo());
+ fclose(fout);
+ }
+ else
+ {
+ fprintf(stderr, "Could not open output file \"%s\"", argv[1]);
+ return 1;
+ }
+ return 0;
+}