From 902594ba47679d9c41e3acf0605822cf4fa7abfe Mon Sep 17 00:00:00 2001 From: Alberto Fustinoni Date: Tue, 8 Aug 2017 17:21:06 +0900 Subject: [PATCH 1/3] makefile --- Makefile.libretro | 35 +++++++++++++++++++++++++++++++++++ 1 file changed, 35 insertions(+) diff --git a/Makefile.libretro b/Makefile.libretro index 1a10add..4da72d1 100644 --- a/Makefile.libretro +++ b/Makefile.libretro @@ -285,6 +285,41 @@ else ifeq ($(platform), gcw0) SHARED := -shared -Wl,--version-script=src/drivers/libretro/link.T -Wl,-no-undefined PLATFORM_DEFINES += -ffast-math -march=mips32 -mtune=mips32r2 -mhard-float EXTERNAL_ZLIB = 1 + +# Windows MSVC 2017x64 +else ifeq ($(platform), windows_msvc2017_x64) + CC = cl.exe + CXX = cl.exe + +VSINSTALLROOT := $(shell "C:\Program Files (x86)\Microsoft Visual Studio\Installer\vswhere.exe" -latest -requires Microsoft.VisualStudio.Workload.NativeDesktop -property installationPath) +VCCOMPILERTOOLSVER := $(shell cat "$(VSINSTALLROOT)\VC\Auxiliary\Build\Microsoft.VCToolsVersion.default.txt" | grep -o '[0-9\.]*') +VCCOMPILERTOOLSDIR := $(VSINSTALLROOT)\VC\Tools\MSVC\$(VCCOMPILERTOOLSVER) + +ifeq ($(PROCESSOR_ARCHITECTURE),AMD64) +HOSTCPUARCHDIR := HostX64 +else +HOSTCPUARCHDIR := HostX86 +endif + +VCCOMPILERTOOLSBINDIR := $(VCCOMPILERTOOLSDIR)\bin\$(HOSTCPUARCHDIR) + +PATH := $(shell IFS=$$'\n'; cygpath "$(VCCOMPILERTOOLSBINDIR)/x64"):$(PATH) +PATH := $(PATH):$(shell IFS=$$'\n'; cygpath "$(VSINSTALLROOT)/Common7/IDE") +INCLUDE := $(shell IFS=$$'\n'; cygpath "$(VCCOMPILERTOOLSDIR)/include") +LIB := $(shell IFS=$$'\n'; cygpath "$(VCCOMPILERTOOLSDIR)/lib/x64") +BIN := $(shell IFS=$$'\n'; cygpath "$(VCCOMPILERTOOLSBINDIR)") + +WindowsSdkDir := $(shell reg query "HKLM\SOFTWARE\WOW6432Node\Microsoft\Microsoft SDKs\Windows\v10.0" -v "InstallationFolder" | grep -o '[A-Z]:\\.*')lib/x64 +WindowsSdkDir ?= $(shell reg query "HKLM\SOFTWARE\Microsoft\Microsoft SDKs\Windows\v10.0" -v "InstallationFolder" | grep -o '[A-Z]:\\.*')lib/x64 + +$(info sdkdir: $(WindowsSdkDir)) + +export INCLUDE := $(INCLUDE) +export LIB := $(LIB);$(WindowsSdkDir) +TARGET := $(TARGET_NAME)_libretro.dll +PSS_STYLE :=2 +LDFLAGS += -DLL + # Windows MSVC 2010 x64 else ifeq ($(platform), windows_msvc2010_x64) CC = cl.exe From a6f182062410f3287c39f26ea375e6d170fdee04 Mon Sep 17 00:00:00 2001 From: Alberto Fustinoni Date: Wed, 9 Aug 2017 11:40:53 +0900 Subject: [PATCH 2/3] makefile --- Makefile.libretro | 35 ++++++++++++++++++----------------- 1 file changed, 18 insertions(+), 17 deletions(-) diff --git a/Makefile.libretro b/Makefile.libretro index 4da72d1..6ab32f6 100644 --- a/Makefile.libretro +++ b/Makefile.libretro @@ -291,31 +291,32 @@ else ifeq ($(platform), windows_msvc2017_x64) CC = cl.exe CXX = cl.exe -VSINSTALLROOT := $(shell "C:\Program Files (x86)\Microsoft Visual Studio\Installer\vswhere.exe" -latest -requires Microsoft.VisualStudio.Workload.NativeDesktop -property installationPath) -VCCOMPILERTOOLSVER := $(shell cat "$(VSINSTALLROOT)\VC\Auxiliary\Build\Microsoft.VCToolsVersion.default.txt" | grep -o '[0-9\.]*') -VCCOMPILERTOOLSDIR := $(VSINSTALLROOT)\VC\Tools\MSVC\$(VCCOMPILERTOOLSVER) +VsInstallRoot := $(shell "C:\Program Files (x86)\Microsoft Visual Studio\Installer\vswhere.exe" -latest -requires Microsoft.VisualStudio.Workload.NativeDesktop -property installationPath) +VcCompilerToolsVer := $(shell cat "$(VsInstallRoot)\VC\Auxiliary\Build\Microsoft.VCToolsVersion.default.txt" | grep -o '[0-9\.]*') +VcCompilerToolsDir := $(VsInstallRoot)\VC\Tools\MSVC\$(VcCompilerToolsVer) ifeq ($(PROCESSOR_ARCHITECTURE),AMD64) -HOSTCPUARCHDIR := HostX64 +HostCPUArchDir := HostX64 +WindowsSDKRegKey := HKLM\SOFTWARE\WOW6432Node\Microsoft\Microsoft SDKs\Windows\v10.0 else -HOSTCPUARCHDIR := HostX86 +HostCPUArchDir := HostX86 +WindowsSDKRegKey := HKLM\SOFTWARE\Microsoft\Microsoft SDKs\Windows\v10.0 endif -VCCOMPILERTOOLSBINDIR := $(VCCOMPILERTOOLSDIR)\bin\$(HOSTCPUARCHDIR) +WindowsSDKRootDir := $(shell reg query "$(WindowsSDKRegKey)" -v "InstallationFolder" | grep -o '[A-Z]:\\.*') +WindowsSDKVer = $(shell reg query "$(WindowsSDKRegKey)" -v "ProductVersion" | grep -o '10\.[0-9]\.[0-9]*') +WindowsSDKUCRTIncludeDir := $(shell cygpath "$(WindowsSDKRootDir)\Include\$(WindowsSDKVer)\ucrt") +WindowsSDKUCRTLibDir := $(shell cygpath "$(WindowsSDKRootDir)\Lib\$(WindowsSDKVer)\ucrt\x64") -PATH := $(shell IFS=$$'\n'; cygpath "$(VCCOMPILERTOOLSBINDIR)/x64"):$(PATH) -PATH := $(PATH):$(shell IFS=$$'\n'; cygpath "$(VSINSTALLROOT)/Common7/IDE") -INCLUDE := $(shell IFS=$$'\n'; cygpath "$(VCCOMPILERTOOLSDIR)/include") -LIB := $(shell IFS=$$'\n'; cygpath "$(VCCOMPILERTOOLSDIR)/lib/x64") -BIN := $(shell IFS=$$'\n'; cygpath "$(VCCOMPILERTOOLSBINDIR)") +VCCompilerToolsBinDir := $(VcCompilerToolsDir)\bin\$(HostCPUArchDir) -WindowsSdkDir := $(shell reg query "HKLM\SOFTWARE\WOW6432Node\Microsoft\Microsoft SDKs\Windows\v10.0" -v "InstallationFolder" | grep -o '[A-Z]:\\.*')lib/x64 -WindowsSdkDir ?= $(shell reg query "HKLM\SOFTWARE\Microsoft\Microsoft SDKs\Windows\v10.0" -v "InstallationFolder" | grep -o '[A-Z]:\\.*')lib/x64 +PATH := $(shell IFS=$$'\n'; cygpath "$(VCCompilerToolsBinDir)/x64"):$(PATH) +PATH := $(PATH):$(shell IFS=$$'\n'; cygpath "$(VsInstallRoot)/Common7/IDE") +INCLUDE := $(shell IFS=$$'\n'; cygpath "$(VcCompilerToolsDir)/include") +LIB := $(shell IFS=$$'\n'; cygpath "$(VcCompilerToolsDir)/lib/x64") -$(info sdkdir: $(WindowsSdkDir)) - -export INCLUDE := $(INCLUDE) -export LIB := $(LIB);$(WindowsSdkDir) +export INCLUDE := $(INCLUDE);$(WindowsSDKUCRTIncludeDir) +export LIB := $(LIB);$(WindowsSDKUCRTLibDir) TARGET := $(TARGET_NAME)_libretro.dll PSS_STYLE :=2 LDFLAGS += -DLL From 315574d3d589ab8171a195d882b3fc0b57d3f294 Mon Sep 17 00:00:00 2001 From: Alberto Fustinoni Date: Wed, 9 Aug 2017 11:45:18 +0900 Subject: [PATCH 3/3] formatting --- Makefile.libretro | 48 +++++++++++++++++++++++------------------------ 1 file changed, 24 insertions(+), 24 deletions(-) diff --git a/Makefile.libretro b/Makefile.libretro index 6ab32f6..df5968f 100644 --- a/Makefile.libretro +++ b/Makefile.libretro @@ -291,35 +291,35 @@ else ifeq ($(platform), windows_msvc2017_x64) CC = cl.exe CXX = cl.exe -VsInstallRoot := $(shell "C:\Program Files (x86)\Microsoft Visual Studio\Installer\vswhere.exe" -latest -requires Microsoft.VisualStudio.Workload.NativeDesktop -property installationPath) -VcCompilerToolsVer := $(shell cat "$(VsInstallRoot)\VC\Auxiliary\Build\Microsoft.VCToolsVersion.default.txt" | grep -o '[0-9\.]*') -VcCompilerToolsDir := $(VsInstallRoot)\VC\Tools\MSVC\$(VcCompilerToolsVer) + VsInstallRoot := $(shell "C:\Program Files (x86)\Microsoft Visual Studio\Installer\vswhere.exe" -latest -requires Microsoft.VisualStudio.Workload.NativeDesktop -property installationPath) + VcCompilerToolsVer := $(shell cat "$(VsInstallRoot)\VC\Auxiliary\Build\Microsoft.VCToolsVersion.default.txt" | grep -o '[0-9\.]*') + VcCompilerToolsDir := $(VsInstallRoot)\VC\Tools\MSVC\$(VcCompilerToolsVer) -ifeq ($(PROCESSOR_ARCHITECTURE),AMD64) -HostCPUArchDir := HostX64 -WindowsSDKRegKey := HKLM\SOFTWARE\WOW6432Node\Microsoft\Microsoft SDKs\Windows\v10.0 -else -HostCPUArchDir := HostX86 -WindowsSDKRegKey := HKLM\SOFTWARE\Microsoft\Microsoft SDKs\Windows\v10.0 -endif + ifeq ($(PROCESSOR_ARCHITECTURE),AMD64) + HostCPUArchDir := HostX64 + WindowsSDKRegKey := HKLM\SOFTWARE\WOW6432Node\Microsoft\Microsoft SDKs\Windows\v10.0 + else + HostCPUArchDir := HostX86 + WindowsSDKRegKey := HKLM\SOFTWARE\Microsoft\Microsoft SDKs\Windows\v10.0 + endif -WindowsSDKRootDir := $(shell reg query "$(WindowsSDKRegKey)" -v "InstallationFolder" | grep -o '[A-Z]:\\.*') -WindowsSDKVer = $(shell reg query "$(WindowsSDKRegKey)" -v "ProductVersion" | grep -o '10\.[0-9]\.[0-9]*') -WindowsSDKUCRTIncludeDir := $(shell cygpath "$(WindowsSDKRootDir)\Include\$(WindowsSDKVer)\ucrt") -WindowsSDKUCRTLibDir := $(shell cygpath "$(WindowsSDKRootDir)\Lib\$(WindowsSDKVer)\ucrt\x64") + WindowsSDKRootDir := $(shell reg query "$(WindowsSDKRegKey)" -v "InstallationFolder" | grep -o '[A-Z]:\\.*') + WindowsSDKVer = $(shell reg query "$(WindowsSDKRegKey)" -v "ProductVersion" | grep -o '10\.[0-9]\.[0-9]*') + WindowsSDKUCRTIncludeDir := $(shell cygpath "$(WindowsSDKRootDir)\Include\$(WindowsSDKVer)\ucrt") + WindowsSDKUCRTLibDir := $(shell cygpath "$(WindowsSDKRootDir)\Lib\$(WindowsSDKVer)\ucrt\x64") -VCCompilerToolsBinDir := $(VcCompilerToolsDir)\bin\$(HostCPUArchDir) + VCCompilerToolsBinDir := $(VcCompilerToolsDir)\bin\$(HostCPUArchDir) -PATH := $(shell IFS=$$'\n'; cygpath "$(VCCompilerToolsBinDir)/x64"):$(PATH) -PATH := $(PATH):$(shell IFS=$$'\n'; cygpath "$(VsInstallRoot)/Common7/IDE") -INCLUDE := $(shell IFS=$$'\n'; cygpath "$(VcCompilerToolsDir)/include") -LIB := $(shell IFS=$$'\n'; cygpath "$(VcCompilerToolsDir)/lib/x64") + PATH := $(shell IFS=$$'\n'; cygpath "$(VCCompilerToolsBinDir)/x64"):$(PATH) + PATH := $(PATH):$(shell IFS=$$'\n'; cygpath "$(VsInstallRoot)/Common7/IDE") + INCLUDE := $(shell IFS=$$'\n'; cygpath "$(VcCompilerToolsDir)/include") + LIB := $(shell IFS=$$'\n'; cygpath "$(VcCompilerToolsDir)/lib/x64") -export INCLUDE := $(INCLUDE);$(WindowsSDKUCRTIncludeDir) -export LIB := $(LIB);$(WindowsSDKUCRTLibDir) -TARGET := $(TARGET_NAME)_libretro.dll -PSS_STYLE :=2 -LDFLAGS += -DLL + export INCLUDE := $(INCLUDE);$(WindowsSDKUCRTIncludeDir) + export LIB := $(LIB);$(WindowsSDKUCRTLibDir) + TARGET := $(TARGET_NAME)_libretro.dll + PSS_STYLE :=2 + LDFLAGS += -DLL # Windows MSVC 2010 x64 else ifeq ($(platform), windows_msvc2010_x64)