Adding source files more than one directory away (e.g. ../../source.cpp or ../../../somewhere_else/source.cpp, vs. just source.cpp or ../source.cpp) to the SOURCES= declaration in a WDK/DDK build yields the following error:
Ignoring invalid directory prefix in SOURCES= entry
Is it possible to include remote source files in a build?
It is not possible to do this directly.
buildis explicitly designed only to deal with source code in the same or parent directory of thesourcesfile. It cannot use source files from arbitrary locations. In particular, its dependency-tracking system seems unable to parse and track remote files, and therefore it explicitly checks and enforces that all files be local.There are two common solutions:
Build remote code as a separate lib (either via another subproject/directory in the same
buildproject, or using an independent build step).Place a local stub for each remote source file which does
#include '../../remote_source.cpp, and add this local stub to theSOURCES=list, instead. This will work, butbuild/nmakewill not track dependencies in theremote_source.cpp. Ifremote_source.cppchanges, you will have to eithertouchthe local proxy source, or otherwise force a rebuild (delete the local proxy obj, runbuildwith-cZ, or otherwise).