Different library paths for different build environments

877 views Asked by At

I'm developing a UMDF-driver. The driver needs a different (build of a) library for 32 bit and 64 bit builds. The TARGETLIBS property in my sources file looks like

TARGETLIBS=\
        $(SDK_LIB_PATH)\strsafe.lib     \
        $(SDK_LIB_PATH)\kernel32.lib    \
        $(SDK_LIB_PATH)\ole32.lib       \
        $(SDK_LIB_PATH)\oleaut32.lib    \
        $(SDK_LIB_PATH)\uuid.lib        \
...
        ..\otherlib\amd64\foo.lib \

but for a x86 build the path for foo.lib must be ..\otherlib\i386\foo.lib.
Obviously there is some mechanism for this in the ddk build system, since $(SDK_LIB_PATH) also points to different locations depending on the build architecture. But I'm unable to find documentation on this subject.
How do I set different library paths in one source file for different build types?

1

There are 1 answers

0
chendral On

http://technet.microsoft.com/en-us/query/ff552910

Because of this convention, TARGETLIBS entries should specify library names in the following form:
<targetpath>\*\<library_name>
where targetpath is identical to the value assigned to TARGETPATH in the Sources file, and library_name is the full file name of the library to be linked to the executable file. The Build utility replaces the asterisk ( * ) with the target platform type.

That's definitely ok for my current problem. But if someone can offer more general solution i'm all ears...