summaryrefslogtreecommitdiff
path: root/Tests/BuildDepends/Project/generator.cxx
blob: 5a83a7f88224b178d0a07b7b607e4d145f3a238c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
#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;
}