]> granicus.if.org Git - curl/commitdiff
winbuild: Allow changing C compiler via environment variable CC (#952)
authorSimon Warta <simon@kullo.net>
Tue, 9 Aug 2016 19:27:36 +0000 (21:27 +0200)
committerDaniel Stenberg <daniel@haxx.se>
Tue, 9 Aug 2016 19:27:36 +0000 (21:27 +0200)
This makes it possible to use specific compilers or a cache.

Sample use for clcache:
set CC=clcache.bat
nmake /f Makefile.vc DEBUG=no MODE=static VC=14 GEN_PDB=no

winbuild/MakefileBuild.vc

index f31d47a134dd0a5f63ae327ae3861720f5be1d73..3b4fc109ccccca6d48037354d1da261760505a90 100644 (file)
@@ -47,13 +47,19 @@ CFGSET=FALSE
 WINBUILD_DIR=`cd`\r
 ZIP        = zip.exe\r
 \r
+# Allow changing C compiler via environment variable CC (default cl.exe)\r
+# This command macro is not set by default: https://msdn.microsoft.com/en-us/library/ms933742.aspx\r
+!If "$(CC)" == ""\r
+CC = cl.exe\r
+!Endif\r
+\r
 !IF "$(VC)"=="6"\r
-CC_NODEBUG  = cl.exe /O2 /DNDEBUG\r
-CC_DEBUG    = cl.exe /Od /Gm /Zi /D_DEBUG /GZ\r
+CC_NODEBUG  = $(CC) /O2 /DNDEBUG\r
+CC_DEBUG    = $(CC) /Od /Gm /Zi /D_DEBUG /GZ\r
 CFLAGS     = /I. /I../lib /I../include /nologo /W3 /GX /DWIN32 /YX /FD /c /DBUILDING_LIBCURL\r
 !ELSE\r
-CC_NODEBUG  = cl.exe /O2 /DNDEBUG\r
-CC_DEBUG    = cl.exe /Od /D_DEBUG /RTC1 /Z7 /LDd /W3\r
+CC_NODEBUG  = $(CC) /O2 /DNDEBUG\r
+CC_DEBUG    = $(CC) /Od /D_DEBUG /RTC1 /Z7 /LDd /W3\r
 CFLAGS      = /I. /I ../lib /I../include /nologo /W3 /EHsc /DWIN32 /FD /c /DBUILDING_LIBCURL\r
 !ENDIF\r
 \r