summaryrefslogtreecommitdiff
path: root/plugingui/rcgen.cc
diff options
context:
space:
mode:
authorBent Bisballe Nyeng <deva@aasimon.org>2020-04-26 21:29:52 +0200
committerBent Bisballe Nyeng <deva@aasimon.org>2020-04-26 21:50:14 +0200
commit2cad525e2babac75395caf367449d9e9b31fcd42 (patch)
tree653e5d03f43414e3347be176f816d4f5a9015c5d /plugingui/rcgen.cc
parent20c5726e9442ebaf3711043cc0f317a600fb9c75 (diff)
Fix out-of-tree building.
Diffstat (limited to 'plugingui/rcgen.cc')
-rw-r--r--plugingui/rcgen.cc11
1 files changed, 11 insertions, 0 deletions
diff --git a/plugingui/rcgen.cc b/plugingui/rcgen.cc
index a30f7b4..f4d7fe6 100644
--- a/plugingui/rcgen.cc
+++ b/plugingui/rcgen.cc
@@ -26,6 +26,7 @@
*/
#include <stdio.h>
#include <string>
+#include <unistd.h>
int main(int argc, char *argv[])
{
@@ -36,6 +37,16 @@ int main(int argc, char *argv[])
printf("{\n");
int i = 1;
+
+ if(argc > 2 && std::string(argv[1]) == "-d")
+ {
+ if(chdir(argv[2]))
+ {
+ return 1;
+ }
+ i += 2;
+ }
+
while(i < argc)
{
printf(" {\n \":%s\", ", argv[i]);