diff options
author | Simon Warta <simon@kullo.net> | 2016-08-09 21:27:36 +0200 |
---|---|---|
committer | Daniel Stenberg <daniel@haxx.se> | 2016-08-09 21:27:36 +0200 |
commit | dec93464603aba0b28e6a1ee91d795e9cdc5acd3 (patch) | |
tree | 732f69f32efebad1a5336ec77df8c3cde2f20cd6 /winbuild | |
parent | 50cb384fd9967b0d658baf92db29ab4b8b7bab63 (diff) | |
download | curl-dec93464603aba0b28e6a1ee91d795e9cdc5acd3.tar.gz |
winbuild: Allow changing C compiler via environment variable CC (#952)
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
Diffstat (limited to 'winbuild')
-rw-r--r-- | winbuild/MakefileBuild.vc | 14 |
1 files changed, 10 insertions, 4 deletions
diff --git a/winbuild/MakefileBuild.vc b/winbuild/MakefileBuild.vc index f31d47a13..3b4fc109c 100644 --- a/winbuild/MakefileBuild.vc +++ b/winbuild/MakefileBuild.vc @@ -47,13 +47,19 @@ CFGSET=FALSE WINBUILD_DIR=`cd`
ZIP = zip.exe
+# Allow changing C compiler via environment variable CC (default cl.exe)
+# This command macro is not set by default: https://msdn.microsoft.com/en-us/library/ms933742.aspx
+!If "$(CC)" == ""
+CC = cl.exe
+!Endif
+
!IF "$(VC)"=="6"
-CC_NODEBUG = cl.exe /O2 /DNDEBUG
-CC_DEBUG = cl.exe /Od /Gm /Zi /D_DEBUG /GZ
+CC_NODEBUG = $(CC) /O2 /DNDEBUG
+CC_DEBUG = $(CC) /Od /Gm /Zi /D_DEBUG /GZ
CFLAGS = /I. /I../lib /I../include /nologo /W3 /GX /DWIN32 /YX /FD /c /DBUILDING_LIBCURL
!ELSE
-CC_NODEBUG = cl.exe /O2 /DNDEBUG
-CC_DEBUG = cl.exe /Od /D_DEBUG /RTC1 /Z7 /LDd /W3
+CC_NODEBUG = $(CC) /O2 /DNDEBUG
+CC_DEBUG = $(CC) /Od /D_DEBUG /RTC1 /Z7 /LDd /W3
CFLAGS = /I. /I ../lib /I../include /nologo /W3 /EHsc /DWIN32 /FD /c /DBUILDING_LIBCURL
!ENDIF
|