macospwdqbs

Qbs cannot get PWD file on MacOS


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 ?


Solution

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