Hello,
I would like to build clang on Windows so that It knows where my QNX standard headers are. I don’t intend to create usable binaries, but ultimately I would like to be able to use clang to run static analysis on my code base. I planned on using cmake to create the visual studio projects or mingw make files. What if anything would I need to modify in order for Clang to know where all the QNX stuff lives?
Thanks,
Josh
The simplest way is to simply use Clang’s command-line options to turn off all of the normal system header includes (-nostdinc) and then add -isystem and -I options that point to your QNX standard headers.
Now, if you don’t want to do that, you can modify lib/Frontend/InitHeaderSearch.cpp to teach Clang about QNX system header paths.
Thanks Doug. I will try both methods when I have a chance… If I modify InitHeaderSearch is it worthwhile to provide the patch back to Clang?
Thanks Doug. I will try both methods when I have a chance… If I modify InitHeaderSearch is it worthwhile to provide the patch back to Clang?
Yes, although looking at it more closely… it looks like you’ll need some changes both in LLVM (to support the QNX OS in its Triple type) and in Clang.
Or, if the QNX headers are already in path/to/QNX/sdk/include then you can just use --sysroot and provide the path to the root of the SDK install...
David
Thanks David,
I will attempt that as well as Doug's suggestions.
Josh