0

I want to use my script as cpp.compilerWrapper: ["../../script"]

I'm using relative path (from my .qbs file) to point the script. It works OK na linux. but on macOS doesn't.

Also when I'm using var path = Environment.getEnv("PWD") on linux return correct path. but on macOS just /.

Anyone haS idea why it doesn't work on macOS or maybe know to get this path in other way ?

AnDevi
  • 67
  • 7

1 Answers1

1

It works only by accident. You should not rely on relative paths in that context. Instead, say: cpp.compilerWrapper: [path + "/../../script"]

  • Yeah, ok, but how will I know what `path` is ? I don't want it to be hardcoded. Getting working dir doesn't work on macos. I also tried: `var process = new Process();` `var exitCode = process.exec("pwd", [], false);` `path = process.readLine();` `process.close();` `path` also is `/` on macos. – AnDevi Aug 18 '22 at 13:01
  • "path" is a predefined variable that corresponds to the directory the qbs file is in. – Christian Kandeler Aug 18 '22 at 18:41