NMake Makefiles: Support up to VS2022 and ARM64 builds

Make VS2017, 2019 and 2022 builds distinct from Visual Studio 2015 builds, and
add proper configuration for ARM64 builds.
This commit is contained in:
Chun-wei Fan 2023-05-03 12:18:06 +08:00
parent 6ff19081c5
commit 529f8f2f82
2 changed files with 19 additions and 3 deletions

View file

@ -95,7 +95,7 @@ clean:
@-del /f /q $(CFG)\$(PLAT)\*.ilk
@-del /f /q $(CFG)\$(PLAT)\pkg-config\*.obj
@-rmdir /s /q $(CFG)\$(PLAT)
@-del vc$(VSVER)0.pdb
@-del vc$(PDBVER).pdb
@-del config.h
!else

View file

@ -16,6 +16,8 @@ _HASH=^#
&& ![echo PLAT=Win32 >> vercl.x] \
&& ![echo $(_HASH)elif defined(_M_AMD64) >> vercl.x] \
&& ![echo PLAT=x64 >> vercl.x] \
&& ![echo $(_HASH)elif defined(_M_ARM64) >> vercl.x] \
&& ![echo PLAT=arm64 >> vercl.x] \
&& ![echo $(_HASH)endif >> vercl.x] \
&& ![cl -nologo -TC -P vercl.x $(ERRNUL)]
!include vercl.i
@ -35,8 +37,14 @@ VSVER = 10
VSVER = 11
!elseif $(VCVERSION) > 1799 && $(VCVERSION) < 1900
VSVER = 12
!elseif $(VCVERSION) > 1899 && $(VCVERSION) < 2000
!elseif $(VCVERSION) > 1899 && $(VCVERSION) < 1910
VSVER = 14
!elseif $(VCVERSION) > 1909 && $(VCVERSION) < 1920
VSVER = 15
!elseif $(VCVERSION) > 1919 && $(VCVERSION) < 1930
VSVER = 16
!elseif $(VCVERSION) > 1929 && $(VCVERSION) < 2000
VSVER = 17
!else
VSVER = 0
!endif
@ -44,11 +52,17 @@ VSVER = 0
!if "$(VSVER)" == "0"
MSG = ^
This NMake Makefile set supports Visual Studio^
9 (2008) through 14 (2015). Your Visual Studio^
9 (2008) through 17 (2022). Your Visual Studio^
version is not supported.
!error $(MSG)
!endif
!if $(VSVER) < 15
PDBVER = $(VSVER)0
!else
PDBVER = 140
!endif
VALID_CFGSET = FALSE
!if "$(CFG)" == "release" || "$(CFG)" == "debug"
VALID_CFGSET = TRUE
@ -62,6 +76,8 @@ CFLAGS_ADD = /MDd /Od
!if "$(PLAT)" == "x64"
LDFLAGS_ARCH = /machine:x64
!elseif "$(PLAT)" == "arm64"
LDFLAGS_ARCH = /machine:arm64
!else
LDFLAGS_ARCH = /machine:x86
!endif