mcuee / libusb-win32

libusb-win32 project official github repo
172 stars 45 forks source link

Use cc instead gcc and remove unused variables #67

Open ikspress opened 5 months ago

ikspress commented 5 months ago

Now it can be built sucessfully on CLANG64 with remove -Werror manually.

mcuee commented 5 months ago

Have you tested this with cross GCC compiler under Linux?

ikspress commented 5 months ago

Have you tested this with cross GCC compiler under Linux?

Oops, I forgot. I will.

ikspress commented 5 months ago

Command: make host_prefix=x86_64-w64-mingw32

Output:

x86_64-w64-mingw32-cc -O2 -Wall -DWINVER=0x500  -Werror -Wno-unknown-pragmas -Wno-multichar -DLOG_APPNAME=\"libusb0-dll\" -DTARGETTYPE=DYNLINK -c ./src/usb.c -o usb.2.o  -I./src -I./src/driver -I. 
x86_64-w64-mingw32-cc -O2 -Wall -DWINVER=0x500  -Werror -Wno-unknown-pragmas -Wno-multichar -DLOG_APPNAME=\"libusb0-dll\" -DTARGETTYPE=DYNLINK -c ./src/error.c -o error.2.o  -I./src -I./src/driver -I. 
x86_64-w64-mingw32-cc -O2 -Wall -DWINVER=0x500  -Werror -Wno-unknown-pragmas -Wno-multichar -DLOG_APPNAME=\"libusb0-dll\" -DTARGETTYPE=DYNLINK -c ./src/descriptors.c -o descriptors.2.o  -I./src -I./src/driver -I. 
x86_64-w64-mingw32-cc -O2 -Wall -DWINVER=0x500  -Werror -Wno-unknown-pragmas -Wno-multichar -DLOG_APPNAME=\"libusb0-dll\" -DTARGETTYPE=DYNLINK -c ./src/windows.c -o windows.2.o  -I./src -I./src/driver -I. 
x86_64-w64-mingw32-cc -O2 -Wall -DWINVER=0x500  -Werror -Wno-unknown-pragmas -Wno-multichar -DLOG_APPNAME=\"libusb0-dll\" -DTARGETTYPE=DYNLINK -c ./src/install.c -o install.2.o  -I./src -I./src/driver -I. 
x86_64-w64-mingw32-cc -O2 -Wall -DWINVER=0x500  -Werror -Wno-unknown-pragmas -Wno-multichar -DLOG_APPNAME=\"libusb0-dll\" -DTARGETTYPE=DYNLINK -c ./src/registry.c -o registry.2.o  -I./src -I./src/driver -I. 
x86_64-w64-mingw32-windres  -I./src ./src/resource.rc -o resource.2.o
x86_64-w64-mingw32-cc -O2 -Wall -DWINVER=0x500  -Werror -Wno-unknown-pragmas -Wno-multichar -DLOG_APPNAME=\"libusb0-dll\" -DTARGETTYPE=DYNLINK -o libusb0.dll -I./src  usb.2.o error.2.o descriptors.2.o windows.2.o install.2.o registry.2.o resource.2.o libusb0.def -s -mdll -Wl,--kill-at -Wl,--out-implib,libusb.a -Wl,--enable-stdcall-fixup -L. -lcfgmgr32 -lsetupapi -lgdi32
x86_64-w64-mingw32-cc -O2 -Wall -DWINVER=0x500  -Werror -Wno-unknown-pragmas -Wno-multichar -DLOG_APPNAME=\"install-filter\" -DTARGETTYPE=PROGRAMconsole -DLOG_STYLE_SHORT -c ./src/install_filter.c -o install_filter.1.o  -I./src -I./src/driver -I.
x86_64-w64-mingw32-cc -O2 -Wall -DWINVER=0x500  -Werror -Wno-unknown-pragmas -Wno-multichar -DLOG_APPNAME=\"install-filter\" -DTARGETTYPE=PROGRAMconsole -DLOG_STYLE_SHORT -c ./src/error.c -o error.1.o  -I./src -I./src/driver -I.
x86_64-w64-mingw32-cc -O2 -Wall -DWINVER=0x500  -Werror -Wno-unknown-pragmas -Wno-multichar -DLOG_APPNAME=\"install-filter\" -DTARGETTYPE=PROGRAMconsole -DLOG_STYLE_SHORT -c ./src/install.c -o install.1.o  -I./src -I./src/driver -I.
x86_64-w64-mingw32-cc -O2 -Wall -DWINVER=0x500  -Werror -Wno-unknown-pragmas -Wno-multichar -DLOG_APPNAME=\"install-filter\" -DTARGETTYPE=PROGRAMconsole -DLOG_STYLE_SHORT -c ./src/registry.c -o registry.1.o  -I./src -I./src/driver -I.
x86_64-w64-mingw32-windres  -I./src ./src/install_filter_rc.rc -o install_filter_rc.1.o
x86_64-w64-mingw32-cc -O2 -Wall -DWINVER=0x500  -Werror -Wno-unknown-pragmas -Wno-multichar -DLOG_APPNAME=\"install-filter\" -DTARGETTYPE=PROGRAMconsole -DLOG_STYLE_SHORT -o install-filter.exe -I./src  install_filter.1.o error.1.o install.1.o registry.1.o install_filter_rc.1.o -s -L. -lgdi32 -luser32 -lcfgmgr32 -lsetupapi
x86_64-w64-mingw32-cc -c ./tests/testlibusb.c -o testlibusb.3.o -O2 -Wall -DWINVER=0x500  -Werror -Wno-unknown-pragmas -Wno-multichar -DLOG_APPNAME=\"testlibusb\" -DTARGETTYPE=PROGRAMconsole  -I./src -I./src/driver -I. 
x86_64-w64-mingw32-cc -O2 -Wall -DWINVER=0x500  -Werror -Wno-unknown-pragmas -Wno-multichar -DLOG_APPNAME=\"testlibusb\" -DTARGETTYPE=PROGRAMconsole -o testlibusb.exe -I./src  testlibusb.3.o -s -L. -lusb -lgdi32 -luser32 -lcfgmgr32 -lsetupapi -lcomctl32
x86_64-w64-mingw32-cc -c ./tests/testlibusb_win.c -o testlibusb_win.4.o -O2 -Wall -DWINVER=0x500  -Werror -Wno-unknown-pragmas -Wno-multichar -DLOG_APPNAME=\"testlibusb-win\" -DTARGETTYPE=PROGRAMwindows  -I./src -I./src/driver -I. 
x86_64-w64-mingw32-windres  -I./src ./tests/testlibusb_win_rc.rc -o testlibusb_win_rc.4.o
x86_64-w64-mingw32-cc -O2 -Wall -DWINVER=0x500  -Werror -Wno-unknown-pragmas -Wno-multichar -DLOG_APPNAME=\"testlibusb-win\" -DTARGETTYPE=PROGRAMwindows -o testlibusb-win.exe -I./src  testlibusb_win.4.o testlibusb_win_rc.4.o -s -L. -lusb -lkernel32 -lgdi32 -luser32 -lnewdev -lsetupapi -lcomctl32 -lole32 -mwindows

I built it successfully on Arch Linux with mingw-w64-toolchain