diff options
-rw-r--r-- | ddk_build.cmd | 10 | ||||
-rw-r--r-- | libusb/os/libusb_sources | 6 |
2 files changed, 12 insertions, 4 deletions
diff --git a/ddk_build.cmd b/ddk_build.cmd index 4ce38bd..23f2711 100644 --- a/ddk_build.cmd +++ b/ddk_build.cmd @@ -8,9 +8,17 @@ set version=1.0 cd libusb\os rem DLL or static lib selection (must use concatenation) +if Test%1==TestDLL goto libusb_dll +:libusb_static set TARGET=LIBRARY -if Test%1==TestDLL set TARGET=DYNLINK +set LIBDEF= +goto libusb_common +:libusb_dll +set TARGET=DYNLINK +set LIBDEF=/DLIBUSB_DLL_BUILD +:libusb_common echo TARGETTYPE=%TARGET% > target +echo LIBUSB_DEFINES=%LIBDEF% >> target copy target+libusb_sources sources >NUL 2>&1 del target @echo on diff --git a/libusb/os/libusb_sources b/libusb/os/libusb_sources index a660084..ab1a2a1 100644 --- a/libusb/os/libusb_sources +++ b/libusb/os/libusb_sources @@ -1,5 +1,7 @@ #TARGETTYPE is not defined, to allow selection between static lib or DLL with ddk_build TARGETNAME=libusb-1.0 +#Must be set, else DLL build will look for libusb-1.0.def +DLLDEF= !IFNDEF MSC_WARNING_LEVEL MSC_WARNING_LEVEL=/W3 @@ -8,8 +10,7 @@ MSC_WARNING_LEVEL=/W3 USE_MSVCRT=1 INCLUDES=..;..\..;..\..\msvc;$(DDK_INC_PATH) -C_DEFINES = $(C_DEFINES) /DDDKBUILD -#### NEED to conditionally (on DLL vs static) #define /DLIBUSB_DLL_BUILD +C_DEFINES = $(C_DEFINES) $(LIBUSB_DEFINES) /DDDKBUILD TARGETLIBS=$(SDK_LIB_PATH)\kernel32.lib \ $(SDK_LIB_PATH)\advapi32.lib \ @@ -24,4 +25,3 @@ SOURCES=..\core.c \ poll_windows.c \ windows_usb.c \ libusb-1.0.rc - |