diff options
Diffstat (limited to 'svg-flatten/src/util.cpp')
-rw-r--r-- | svg-flatten/src/util.cpp | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/svg-flatten/src/util.cpp b/svg-flatten/src/util.cpp index e88f4e9..d9a5a09 100644 --- a/svg-flatten/src/util.cpp +++ b/svg-flatten/src/util.cpp @@ -1,16 +1,19 @@ -#include <pwd.h> #include <sys/types.h> #include <string> #include <iostream> +#ifndef NOFORK +#include <pwd.h> #include <subprocess.h> +#endif #include <filesystem> #include "util.h" using namespace std; +#ifndef NOFORK int gerbolyze::run_cargo_command(const char *cmd_name, const char *cmdline[], const char *envvar) { const char *homedir; if ((homedir = getenv("HOME")) == NULL) { @@ -81,4 +84,11 @@ int gerbolyze::run_cargo_command(const char *cmd_name, const char *cmdline[], co return 0; } +#else +int gerbolyze::run_cargo_command(const char *cmd_name, const char *cmdline[], const char *envvar) { + (void) cmd_name, (void) cmdline, (void) envvar; + cerr << "Error: Cannot spawn " << cmd_name << " subprocess since binary was built with fork/exec disabled (-DNOFORK=1)" << endl; + return EXIT_FAILURE; +} +#endif |