griffin: add vc2015 Makefile target

This commit is contained in:
Brad Parker 2018-03-16 21:03:58 +00:00
parent 614521b238
commit 450fc90a15

View File

@ -11,6 +11,13 @@ PC_DEVELOPMENT_UDP_PORT = 3490
RARCH_CONSOLE = 0 RARCH_CONSOLE = 0
USBGECKO = 0 USBGECKO = 0
SPACE :=
SPACE := $(SPACE) $(SPACE)
BACKSLASH :=
BACKSLASH := \$(BACKSLASH)
filter_out1 = $(filter-out $(firstword $1),$1)
filter_out2 = $(call filter_out1,$(call filter_out1,$1))
UNAME_ARCH = $(shell uname -m) UNAME_ARCH = $(shell uname -m)
ifeq ($(UNAME_ARCH),x86_64) ifeq ($(UNAME_ARCH),x86_64)
@ -654,6 +661,95 @@ else ifneq (,$(findstring windows_msvc2013,$(platform)))
export INCLUDE := $(INCLUDE);$(WindowsSdkDir)\Include\um;$(WindowsSdkDir)\Include\shared;libretro-common\include;libretro-common\include\compat\msvc;gfx\include;deps;deps\stb export INCLUDE := $(INCLUDE);$(WindowsSdkDir)\Include\um;$(WindowsSdkDir)\Include\shared;libretro-common\include;libretro-common\include\compat\msvc;gfx\include;deps;deps\stb
export LIB := $(LIB);$(WindowsSdkDir)\$(PlatLib) export LIB := $(LIB);$(WindowsSdkDir)\$(PlatLib)
endif endif
else ifneq (,$(findstring windows_msvc2015,$(platform)))
HAVE_RPNG := 1
HAVE_RJPEG := 1
HAVE_RBMP := 1
HAVE_RTGA := 1
HAVE_ZLIB := 1
WANT_ZLIB := 1
HAVE_7ZIP := 1
HAVE_NETWORKING := 1
HAVE_NETWORK_CMD := 1
HAVE_OVERLAY := 1
HAVE_MATERIALUI := 1
HAVE_XMB := 1
HAVE_STB_FONT := 1
HAVE_THREADS := 1
HAVE_LIBRETRODB := 1
HAVE_COMMAND := 1
HAVE_STDIN_CMD := 1
HAVE_CMD := 1
HAVE_DYLIB := 1
HAVE_DYNAMIC := 1
HAVE_GRIFFIN_CPP := 1
HAVE_DIRECTX ?= 1
EXT_TARGET := $(TARGET_NAME).exe
EXT_INTER_TARGET := $(TARGET_NAME).exe
CC = cl.exe
CXX = cl.exe
LD = link.exe
PLATCFLAGS += -D_WIN32 -D__STDC_CONSTANT_MACROS -D_MBCS
PLATCFLAGS += -D__i686__ -D__SSE__ -D_CRT_NONSTDC_NO_WARNINGS -D_CRT_SECURE_NO_WARNINGS -D_WINDOWS -DHAVE_CC_RESAMPLER -DHAVE_GL_SYNC -DHAVE_GLSL -DHAVE_IMAGEVIEWER -DHAVE_LANGEXTRA -DHAVE_OPENGL -DHAVE_SHADERPIPELINE -DHAVE_UPDATE_ASSETS -DWIN32
LDFLAGS += shell32.lib user32.lib gdi32.lib comdlg32.lib winmm.lib ole32.lib iphlpapi.lib
PlatformSuffix = $(subst windows_msvc2015_,,$(platform))
ifneq (,$(findstring x64,$(PlatformSuffix)))
ifeq ($(HOST_ARCH),x86)
# cross-compile for x64 from x86 host
PATH := $(shell IFS=$$'\n'; cygpath "$(VS140COMNTOOLS)../../VC/bin/x86_amd64"):$(PATH)
else
PATH := $(shell IFS=$$'\n'; cygpath "$(VS140COMNTOOLS)../../VC/bin/amd64"):$(PATH)
endif
LIB := $(shell IFS=$$'\n'; cygpath -w "$(VS140COMNTOOLS)../../VC/lib/amd64")
WinArch = x64
PlatLib = um\x64
VCLib = amd64
else ifneq (,$(findstring arm,$(PlatformSuffix)))
PATH := $(shell IFS=$$'\n'; cygpath "$(VS140COMNTOOLS)../../VC/bin/x86_arm"):$(PATH)
LIB := $(shell IFS=$$'\n'; cygpath -w "$(VS140COMNTOOLS)../../VC/lib/arm")
HAVE_DIRECTX = 0
WinArch = arm
PlatLib = um\arm
VCLib = arm
else
PATH := $(shell IFS=$$'\n'; cygpath "$(VS140COMNTOOLS)../../VC/bin"):$(PATH)
LIB := $(shell IFS=$$'\n'; cygpath -w "$(VS140COMNTOOLS)../../VC/lib")
WinArch = x86
PlatLib = um\x86
VCLib =
endif
PATH := $(PATH):$(shell IFS=$$'\n'; cygpath "$(VS140COMNTOOLS)../IDE")
INCLUDE := $(shell IFS=$$'\n'; cygpath -w "$(VS140COMNTOOLS)../../VC/include")
reg_query = $(call filter_out2,$(subst $2,,$(shell reg query "$2" -v "$1" 2>nul)))
fix_path = $(subst $(SPACE),\ ,$(subst \,/,$1))
WindowsSdkDir ?= $(call reg_query,InstallationFolder,HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Microsoft\Microsoft SDKs\Windows\v10.0)
WindowsSdkDir ?= $(call reg_query,InstallationFolder,HKEY_CURRENT_USER\SOFTWARE\Wow6432Node\Microsoft\Microsoft SDKs\Windows\v10.0)
WindowsSdkDir ?= $(call reg_query,InstallationFolder,HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Microsoft SDKs\Windows\v10.0)
WindowsSdkDir ?= $(call reg_query,InstallationFolder,HKEY_CURRENT_USER\SOFTWARE\Microsoft\Microsoft SDKs\Windows\v10.0)
WindowsSdkDir := $(WindowsSdkDir)
WindowsSDKVersion ?= $(firstword $(foreach folder,$(subst $(subst \,/,$(WindowsSdkDir)Include/),,$(wildcard $(call fix_path,$(WindowsSdkDir)Include\*))),$(if $(wildcard $(call fix_path,$(WindowsSdkDir)Include/$(folder)/um/Windows.h)),$(folder),)))$(BACKSLASH)
WindowsSDKVersion := $(WindowsSDKVersion)
export INCLUDE := $(INCLUDE);$(VCINSTALLDIR)INCLUDE;$(VCINSTALLDIR)ATLMFC\INCLUDE;$(WindowsSdkDir)include\$(WindowsSDKVersion)ucrt;$(WindowsSdkDir)include\$(WindowsSDKVersion)shared;$(WindowsSdkDir)include\$(WindowsSDKVersion)um
export LIB := $(LIB);$(VCINSTALLDIR)LIB$(VCLib);$(VCINSTALLDIR)ATLMFC\LIB$(VCLib);$(WindowsSdkDir)lib\$(WindowsSDKVersion)ucrt\$(WinArch);$(WindowsSdkDir)lib\$(WindowsSDKVersion)$(PlatLib)
ifeq ($(HAVE_DIRECTX), 1)
PLATCFLAGS += -DHAVE_DINPUT -DHAVE_DSOUND -DHAVE_D3D -DHAVE_D3D9 -DHAVE_XAUDIO -DHAVE_XINPUT
DXSDK_DIR := $(DXSDK_DIR:\=)
export INCLUDE := $(INCLUDE);$(DXSDK_DIR)\Include;libretro-common\include;libretro-common\include\compat\msvc;gfx\include;deps;deps\stb
export LIB := $(LIB);$(DXSDK_DIR)\Lib\$(WinArch)
else
export INCLUDE := $(INCLUDE);libretro-common\include;libretro-common\include\compat\msvc;gfx\include;deps;deps\stb
export LIB := $(LIB)
endif
endif endif
ifneq (,$(findstring msvc,$(platform))) ifneq (,$(findstring msvc,$(platform)))