From 8b267230c58efd1659cdb102d9049c9f91ecfbeb Mon Sep 17 00:00:00 2001 From: Alberto Fustinoni Date: Tue, 22 Aug 2017 12:23:32 +0900 Subject: [PATCH 1/5] build --- Makefile.libretro | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/Makefile.libretro b/Makefile.libretro index 322c13d..9e92522 100644 --- a/Makefile.libretro +++ b/Makefile.libretro @@ -293,8 +293,8 @@ else ifeq ($(platform), gcw0) PLATFORM_DEFINES += -ffast-math -march=mips32 -mtune=mips32r2 -mhard-float EXTERNAL_ZLIB = 1 -# Windows MSVC 2017 x64 -else ifeq ($(platform), windows_msvc2017_x64) +# Windows MSVC 2017 all architectures +else ifneq (,$(findstring windows_msvc2017,$(platform))) CC = cl.exe CXX = cl.exe @@ -339,16 +339,18 @@ else ifeq ($(platform), windows_msvc2017_x64) HostCPUArchDir := HostX86 endif + TargetArchMoniker = $(subst windows_msvc2017_,,$(platform)) + WindowsSDKUCRTIncludeDir := $(shell cygpath -w "$(WindowsSdkDir)\Include\$(WindowsSDKVersion)\ucrt") - WindowsSDKUCRTLibDir := $(shell cygpath -w "$(WindowsSdkDir)\Lib\$(WindowsSDKVersion)\ucrt\x64") - WindowsSDKUMLibDir := $(shell cygpath -w "$(WindowsSdkDir)\Lib\$(WindowsSDKVersion)\um\x64") + WindowsSDKUCRTLibDir := $(shell cygpath -w "$(WindowsSdkDir)\Lib\$(WindowsSDKVersion)\ucrt\$(TargetArchMoniker)") + WindowsSDKUMLibDir := $(shell cygpath -w "$(WindowsSdkDir)\Lib\$(WindowsSDKVersion)\um\$(TargetArchMoniker)") VCCompilerToolsBinDir := $(VcCompilerToolsDir)\bin\$(HostCPUArchDir) - - PATH := $(shell IFS=$$'\n'; cygpath "$(VCCompilerToolsBinDir)/x64"):$(PATH) + + PATH := $(shell IFS=$$'\n'; cygpath "$(VCCompilerToolsBinDir)/$(TargetArchMoniker)"):$(PATH) PATH := $(PATH):$(shell IFS=$$'\n'; cygpath "$(VsInstallRoot)/Common7/IDE") INCLUDE := $(shell IFS=$$'\n'; cygpath -w "$(VcCompilerToolsDir)/include") - LIB := $(shell IFS=$$'\n'; cygpath -w "$(VcCompilerToolsDir)/lib/x64") + LIB := $(shell IFS=$$'\n'; cygpath -w "$(VcCompilerToolsDir)/lib/$(TargetArchMoniker)") export INCLUDE := $(INCLUDE);$(WindowsSDKUCRTIncludeDir) export LIB := $(LIB);$(WindowsSDKUCRTLibDir);$(WindowsSDKUMLibDir) From 0952b54c69a86a78cab8b2bbb191d25ce2e05e5a Mon Sep 17 00:00:00 2001 From: Alberto Fustinoni Date: Tue, 22 Aug 2017 12:28:46 +0900 Subject: [PATCH 2/5] build --- Makefile.libretro | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/Makefile.libretro b/Makefile.libretro index 9e92522..3960139 100644 --- a/Makefile.libretro +++ b/Makefile.libretro @@ -342,17 +342,18 @@ else ifneq (,$(findstring windows_msvc2017,$(platform))) TargetArchMoniker = $(subst windows_msvc2017_,,$(platform)) WindowsSDKUCRTIncludeDir := $(shell cygpath -w "$(WindowsSdkDir)\Include\$(WindowsSDKVersion)\ucrt") + WindowsSDKUMIncludeDir := $(shell cygpath -w "$(WindowsSdkDir)\Include\$(WindowsSDKVersion)\um") WindowsSDKUCRTLibDir := $(shell cygpath -w "$(WindowsSdkDir)\Lib\$(WindowsSDKVersion)\ucrt\$(TargetArchMoniker)") WindowsSDKUMLibDir := $(shell cygpath -w "$(WindowsSdkDir)\Lib\$(WindowsSDKVersion)\um\$(TargetArchMoniker)") VCCompilerToolsBinDir := $(VcCompilerToolsDir)\bin\$(HostCPUArchDir) - + PATH := $(shell IFS=$$'\n'; cygpath "$(VCCompilerToolsBinDir)/$(TargetArchMoniker)"):$(PATH) PATH := $(PATH):$(shell IFS=$$'\n'; cygpath "$(VsInstallRoot)/Common7/IDE") INCLUDE := $(shell IFS=$$'\n'; cygpath -w "$(VcCompilerToolsDir)/include") LIB := $(shell IFS=$$'\n'; cygpath -w "$(VcCompilerToolsDir)/lib/$(TargetArchMoniker)") - export INCLUDE := $(INCLUDE);$(WindowsSDKUCRTIncludeDir) + export INCLUDE := $(INCLUDE);$(WindowsSDKUCRTIncludeDir);$(WindowsSDKUMIncludeDir) export LIB := $(LIB);$(WindowsSDKUCRTLibDir);$(WindowsSDKUMLibDir) TARGET := $(TARGET_NAME)_libretro.dll PSS_STYLE :=2 From eec2b73d3a3676e08611dc20cef2c50b591beeb4 Mon Sep 17 00:00:00 2001 From: Alberto Fustinoni Date: Tue, 22 Aug 2017 14:23:25 +0900 Subject: [PATCH 3/5] build fix --- Makefile.libretro | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/Makefile.libretro b/Makefile.libretro index 3960139..15d3e57 100644 --- a/Makefile.libretro +++ b/Makefile.libretro @@ -333,12 +333,6 @@ else ifneq (,$(findstring windows_msvc2017,$(platform))) 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 - TargetArchMoniker = $(subst windows_msvc2017_,,$(platform)) WindowsSDKUCRTIncludeDir := $(shell cygpath -w "$(WindowsSdkDir)\Include\$(WindowsSDKVersion)\ucrt") @@ -346,7 +340,8 @@ else ifneq (,$(findstring windows_msvc2017,$(platform))) WindowsSDKUCRTLibDir := $(shell cygpath -w "$(WindowsSdkDir)\Lib\$(WindowsSDKVersion)\ucrt\$(TargetArchMoniker)") WindowsSDKUMLibDir := $(shell cygpath -w "$(WindowsSdkDir)\Lib\$(WindowsSDKVersion)\um\$(TargetArchMoniker)") - VCCompilerToolsBinDir := $(VcCompilerToolsDir)\bin\$(HostCPUArchDir) + #Turns out only the x86 cl.exe can compile for everything, the x64 one only compiles x64 + VCCompilerToolsBinDir := $(VcCompilerToolsDir)\bin\HostX86 PATH := $(shell IFS=$$'\n'; cygpath "$(VCCompilerToolsBinDir)/$(TargetArchMoniker)"):$(PATH) PATH := $(PATH):$(shell IFS=$$'\n'; cygpath "$(VsInstallRoot)/Common7/IDE") From 62a4abac33e8d58b036221e038dd0b05267fffe8 Mon Sep 17 00:00:00 2001 From: Alberto Fustinoni Date: Tue, 22 Aug 2017 15:23:22 +0900 Subject: [PATCH 4/5] build --- Makefile.libretro | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/Makefile.libretro b/Makefile.libretro index 15d3e57..df6d820 100644 --- a/Makefile.libretro +++ b/Makefile.libretro @@ -295,6 +295,16 @@ else ifeq ($(platform), gcw0) # Windows MSVC 2017 all architectures else ifneq (,$(findstring windows_msvc2017,$(platform))) + + PlatformSuffix = $(subst windows_msvc2017_,,$(platform)) + ifneq (,$(findstring desktop,$(PlatformSuffix))) + WinPartition = desktop + else ifneq (,$(findstring uwp,$(PlatformSuffix))) + WinPartition = uwp + endif + + TargetArchMoniker = $(subst $(WinPartition)_,,$(PlatformSuffix)) + CC = cl.exe CXX = cl.exe @@ -333,8 +343,6 @@ else ifneq (,$(findstring windows_msvc2017,$(platform))) VcCompilerToolsVer := $(shell cat "$(VsInstallRoot)/VC/Auxiliary/Build/Microsoft.VCToolsVersion.default.txt" | grep -o '[0-9\.]*') VcCompilerToolsDir := $(VsInstallRoot)/VC/Tools/MSVC/$(VcCompilerToolsVer) - TargetArchMoniker = $(subst windows_msvc2017_,,$(platform)) - WindowsSDKUCRTIncludeDir := $(shell cygpath -w "$(WindowsSdkDir)\Include\$(WindowsSDKVersion)\ucrt") WindowsSDKUMIncludeDir := $(shell cygpath -w "$(WindowsSdkDir)\Include\$(WindowsSDKVersion)\um") WindowsSDKUCRTLibDir := $(shell cygpath -w "$(WindowsSdkDir)\Lib\$(WindowsSDKVersion)\ucrt\$(TargetArchMoniker)") From 22ff2703e303131ed67630d663c440ef437d9ec6 Mon Sep 17 00:00:00 2001 From: Alberto Fustinoni Date: Tue, 22 Aug 2017 15:39:32 +0900 Subject: [PATCH 5/5] build --- Makefile.libretro | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/Makefile.libretro b/Makefile.libretro index df6d820..33b3dae 100644 --- a/Makefile.libretro +++ b/Makefile.libretro @@ -299,8 +299,10 @@ else ifneq (,$(findstring windows_msvc2017,$(platform))) PlatformSuffix = $(subst windows_msvc2017_,,$(platform)) ifneq (,$(findstring desktop,$(PlatformSuffix))) WinPartition = desktop + CFLAGS += -DWINAPI_FAMILY=WINAPI_FAMILY_DESKTOP_APP else ifneq (,$(findstring uwp,$(PlatformSuffix))) WinPartition = uwp + CFLAGS += -DWINAPI_FAMILY=WINAPI_FAMILY_APP endif TargetArchMoniker = $(subst $(WinPartition)_,,$(PlatformSuffix)) @@ -343,6 +345,7 @@ else ifneq (,$(findstring windows_msvc2017,$(platform))) VcCompilerToolsVer := $(shell cat "$(VsInstallRoot)/VC/Auxiliary/Build/Microsoft.VCToolsVersion.default.txt" | grep -o '[0-9\.]*') VcCompilerToolsDir := $(VsInstallRoot)/VC/Tools/MSVC/$(VcCompilerToolsVer) + WindowsSDKSharedIncludeDir := $(shell cygpath -w "$(WindowsSdkDir)\Include\$(WindowsSDKVersion)\shared") WindowsSDKUCRTIncludeDir := $(shell cygpath -w "$(WindowsSdkDir)\Include\$(WindowsSDKVersion)\ucrt") WindowsSDKUMIncludeDir := $(shell cygpath -w "$(WindowsSdkDir)\Include\$(WindowsSDKVersion)\um") WindowsSDKUCRTLibDir := $(shell cygpath -w "$(WindowsSdkDir)\Lib\$(WindowsSDKVersion)\ucrt\$(TargetArchMoniker)") @@ -356,7 +359,7 @@ else ifneq (,$(findstring windows_msvc2017,$(platform))) INCLUDE := $(shell IFS=$$'\n'; cygpath -w "$(VcCompilerToolsDir)/include") LIB := $(shell IFS=$$'\n'; cygpath -w "$(VcCompilerToolsDir)/lib/$(TargetArchMoniker)") - export INCLUDE := $(INCLUDE);$(WindowsSDKUCRTIncludeDir);$(WindowsSDKUMIncludeDir) + export INCLUDE := $(INCLUDE);$(WindowsSDKSharedIncludeDir);$(WindowsSDKUCRTIncludeDir);$(WindowsSDKUMIncludeDir) export LIB := $(LIB);$(WindowsSDKUCRTLibDir);$(WindowsSDKUMLibDir) TARGET := $(TARGET_NAME)_libretro.dll PSS_STYLE :=2