We have a SConscript for a library which consists largely of autogenerated code.
This produces a lot of compiler warnings, so instead of including the header files via CPPPATH I tried to use -isystem
.
However, due to the VariantDir
, the include paths for the header files do not match
In the SConscript file of the library we had:
envGlobal.Append(CPPPATH=[Dir('./include')])
This correctly produced the compiler includes (despite VariantDir
): -I<library root>/include
.
When using isystem like this:
envGlobal.Append(CCFLAGS=['-isystem', Dir('./include')])
The result is: -isystem build/<library_root>/include
where the header files are not available and not copied to.
Is there any easy solution to that situation.
For example, can get the actual source path from inside the SConscript without the redirection from VariantDir
? Something like this:
source_dir = PathWithoutVariantDir('.')
envGlobal.Append(CCFLAGS=['-isystem', os.path.join(source_dir, './include')])