msvc2017: UWP buildfixes

This commit is contained in:
Brad Parker
2017-08-22 18:38:37 -07:00
parent e1e969ab3f
commit 5ee47ddb27

View File

@@ -50,6 +50,7 @@ ifneq ($(GIT_VERSION)," unknown")
CFLAGS += -DGIT_VERSION=\"$(GIT_VERSION)\"
endif
LIBM := -lm
LIBS :=
# Unix
ifeq ($(platform), unix)
@@ -302,7 +303,9 @@ else ifneq (,$(findstring windows_msvc2017,$(platform)))
CFLAGS += -DWINAPI_FAMILY=WINAPI_FAMILY_DESKTOP_APP
else ifneq (,$(findstring uwp,$(PlatformSuffix)))
WinPartition = uwp
CFLAGS += -DWINAPI_FAMILY=WINAPI_FAMILY_APP
CFLAGS += -DWINAPI_FAMILY=WINAPI_FAMILY_APP -DWINDLL -D_UNICODE -DUNICODE -DWRL_NO_DEFAULT_LIB
LDFLAGS += -APPCONTAINER -NXCOMPAT -DYNAMICBASE
LIBS += WindowsApp.lib
endif
TargetArchMoniker = $(subst $(WinPartition)_,,$(PlatformSuffix))
@@ -351,8 +354,15 @@ else ifneq (,$(findstring windows_msvc2017,$(platform)))
WindowsSDKUCRTLibDir := $(shell cygpath -w "$(WindowsSdkDir)\Lib\$(WindowsSDKVersion)\ucrt\$(TargetArchMoniker)")
WindowsSDKUMLibDir := $(shell cygpath -w "$(WindowsSdkDir)\Lib\$(WindowsSDKVersion)\um\$(TargetArchMoniker)")
#Turns out only the x86 cl.exe can compile for everything, the x64 one only compiles x64
VCCompilerToolsBinDir := $(VcCompilerToolsDir)\bin\HostX86
# For some reason the HostX86 compiler doesn't like compiling for x64
# ("no such file" opening a shared library), and vice-versa.
# Work around it for now by using the strictly x86 compiler for x86, and x64 for x64.
# NOTE: What about ARM?
ifneq (,$(findstring x64,$(TargetArchMoniker)))
VCCompilerToolsBinDir := $(VcCompilerToolsDir)\bin\HostX64
else
VCCompilerToolsBinDir := $(VcCompilerToolsDir)\bin\HostX86
endif
PATH := $(shell IFS=$$'\n'; cygpath "$(VCCompilerToolsBinDir)/$(TargetArchMoniker)"):$(PATH)
PATH := $(PATH):$(shell IFS=$$'\n'; cygpath "$(VsInstallRoot)/Common7/IDE")
@@ -466,8 +476,6 @@ endif
CFLAGS += $(COREDEFINES) $(fpic) $(WARNING_DEFINES) $(DEFINES) $(ENDIANNESS_DEFINES)
LDFLAGS += $(LIBM)
LIBS :=
ifeq ($(platform), psp1)
INCFLAGS += -I$(shell psp-config --pspsdk-path)/include
endif