Add vc2017 target

This commit is contained in:
Sergey Lyubka 2022-03-21 14:38:42 +00:00
parent 1141ea7933
commit 7ef82f5caf
2 changed files with 16 additions and 3 deletions

View File

@ -1,6 +1,6 @@
PROG ?= example
CFLAGS ?= -DMG_ENABLE_LINES $(EXTRA)
ROOT ?= $(realpath $(CURDIR)/../..)
CFLAGS ?= -DMG_ENABLE_LINES $(EXTRA)
LIN = docker run -it --rm -v $(ROOT):$(ROOT) -w $(CURDIR) mdashnet/cc2
ifneq ($(MBEDTLS),)
@ -24,5 +24,18 @@ linux: CFLAGS += -O2 -g -fsanitize=address,undefined,shift,null,return,bounds,al
linux: CC = $(LIN) cc
linux: RUN = $(LIN)
ROOT ?= $(realpath $(CURDIR)/../..)
DOCKER = docker run -it --rm -e Tmp=. -e WINEDEBUG=-all -v $(ROOT):$(ROOT) -w $(CURDIR)
WDEFS = -DMG_ENABLE_MBEDTLS -DMG_ENABLE_LINES -Imbedtls/include -Imbedtls/library $(EXTRA)
WFLAGS = /nologo -O2 -I. -I../.. ws2_32.lib advapi32.lib /link /out:$(PROG).exe
WSRCS = ../../mongoose.c main.c mbedtls/library/*.c
$(PROG).exe: main.c mbedtls
$(DOCKER) mdashnet/vc2017 wine cl $(WSRCS) $(WDEFS) $(WFLAGS)
vc2017: $(PROG).exe
$(DOCKER) mdashnet/vc2017 wine $(PROG).exe $(ARGS)
mbedtls:
git clone --depth 1 -b v3.1.0 https://github.com/ARMmbed/mbedtls
clean:
rm -rf $(PROG) *.o *.dSYM *.gcov *.gcno *.gcda *.obj *.exe *.ilk *.pdb
rm -rf $(PROG) _CL* *.o *.dSYM *.gcov *.gcno *.gcda *.obj *.exe *.ilk *.pdb

View File

@ -62,7 +62,7 @@ int main(int argc, char *argv[]) {
struct mg_mgr mgr; // Event manager
bool done = false; // Event handler flips it to true
if (argc > 1) s_url = argv[1]; // Use URL provided in the command line
mg_log_set("3"); // Set to 0 to disable debug
mg_log_set("4"); // Set to 0 to disable debug
mg_mgr_init(&mgr); // Initialise event manager
mg_http_connect(&mgr, s_url, fn, &done); // Create client connection
while (!done) mg_mgr_poll(&mgr, 50); // Infinite event loop