Browse Source

Make 32 bit Windows build work

(Might contain some changes to make CoD work on 64 bit Windows too, like
changing ARCHSTR to "windows-x86_64".)
Vincent Lang 8 years ago
parent
commit
7b3da572ee

+ 2 - 1
CMakeModules/CPackConfiguration.cmake

@@ -8,7 +8,8 @@ set(CPACK_PACKAGE_VERSION_PATCH ${VERSION_NANO})
 if(APPLE)
   set(CPACK_SYSTEM_NAME "macosx-x86_64")
 elseif(WIN32)
-  set(CPACK_SYSTEM_NAME "windows-x64")
+  include(FetchDependencies)
+  set(CPACK_SYSTEM_NAME ${ARCHSTR})
 else()
   set(CPACK_SYSTEM_NAME linux-${CMAKE_HOST_SYSTEM_PROCESSOR})
 endif()

+ 7 - 7
CMakeModules/DependencyConfiguration.cmake

@@ -16,14 +16,14 @@ if((APPLE OR WIN32) AND NOT DISABLE_BUNDLED_DEPS)
 endif(APPLE AND NOT DISABLE_BUNDLED_DEPS)
 
 if(WIN32)
-  download_deps(
-    "plexmediaplayer-windows-dependencies"
-    DIRECTORY dir
-    ARTIFACTNAME konvergo-depends-windows
-    ARCHSTR mingw32-x86_64
-    DEPHASH_VAR DEPS_HASH
-  )
   if(NOT EXISTS ${dir}/lib/mpv.lib)
+    if(ARCHSTR STREQUAL "windows-x86_64")
+      set(ENV{PMP_VC_ARCH} "amd64")
+      set(ENV{PMP_LIB_ARCH} "X64")
+    else()
+      set(ENV{PMP_VC_ARCH} "x86")
+      set(ENV{PMP_LIB_ARCH} "x86")
+    endif()
     execute_process(
       COMMAND ${PROJECT_SOURCE_DIR}/scripts/make_mpv_lib.bat
       WORKING_DIRECTORY ${dir}

+ 5 - 1
CMakeModules/FetchDependencies.cmake

@@ -7,7 +7,11 @@ if(APPLE)
   set(ARCHSTR "darwin-x86_64")
 elseif(WIN32)
   set(OS "windows-i386")
-  set(ARCHSTR "windows-i386")
+  if (CMAKE_SIZEOF_VOID_P MATCHES 8)
+    set(ARCHSTR "windows-x86_64")
+  else()
+    set(ARCHSTR "windows-i386")
+  endif()
 elseif(UNIX)
   set(ARCHSTR ${PLEX_BUILD_TARGET})
 endif(APPLE)

+ 0 - 5
CMakeModules/QtConfiguration.cmake

@@ -1,17 +1,12 @@
 
 include(FetchDependencies)
 
-if(WIN32)
-  set(WINARCHSTR ARCHSTR windows-x86_64)
-endif(WIN32)
-
 if(NOT IS_DIRECTORY ${QTROOT})
   download_deps(
 		"plexmediaplayer-qt"
 		DIRECTORY dir
 		DEPHASH_VAR QT_DEPS_HASH
     ARTIFACTNAME konvergo-qt
-    ${WINARCHSTR}
     DYLIB_SCRIPT_PATH ${PROJECT_SOURCE_DIR}/scripts/fix-install-names.py
 	)
   set(QTROOT ${dir})

+ 7 - 1
CMakeModules/WindowsInstaller.cmake

@@ -143,7 +143,13 @@ wix_create_installer(PMP.msi
                      BASEDIR "${PROJECT_SOURCE_DIR}/bundle/win"
 )
 
-wix_create_installer(PlexMediaPlayer-${VERSION_STRING}-windows-x64.exe
+if (CMAKE_SIZEOF_VOID_P MATCHES 8)
+  set(INSTALLER_ARCH_STR windows-x64)
+else()
+  set(INSTALLER_ARCH_STR windows-x86)
+endif()
+
+wix_create_installer(PlexMediaPlayer-${VERSION_STRING}-${INSTALLER_ARCH_STR}.exe
                      TARGET PlexMediaPlayerInstaller
                      WXS_FILES "${PROJECT_SOURCE_DIR}/bundle/win/Bundle.wxs"
                      EXTENSIONS WixUtilExtension WixBalExtension

+ 3 - 3
scripts/make_mpv_lib.bat

@@ -1,3 +1,3 @@
-@echo off
-call "C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\vcvarsall.bat" amd64
-lib /def:bin\mpv-1.def /out:lib\mpv.lib /MACHINE:X64
+call "C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\vcvarsall.bat" %PMP_VC_ARCH%
+c:\msys32\mingw64\bin\gendef.exe - bin\mpv*.dll > bin\mpv-1.def
+lib /def:bin\mpv-1.def /out:lib\mpv.lib /MACHINE:%PMP_LIB_ARCH%

+ 4 - 3
src/system/SystemComponent.cpp

@@ -30,8 +30,9 @@ QMap<SystemComponent::PlatformType, QString> g_platformTypeNames = { \
 };
 
 // platform Archictecture map
-QMap<SystemComponent::PlatformArch, QString> g_platformArchNames = { \
-  { SystemComponent::platformArchX86_64, "x86_64" }, \
+QMap<SystemComponent::PlatformArch, QString> g_platformArchNames = {
+  { SystemComponent::platformArchX86_32, "i386" },
+  { SystemComponent::platformArchX86_64, "x86_64" },
   { SystemComponent::platformArchRpi2, "rpi2" },
   { SystemComponent::platformArchUnknown, "unknown" }
 };
@@ -115,7 +116,7 @@ QVariantMap SystemComponent::systemInformation() const
   int productid = KONVERGO_PRODUCTID_DEFAULT;
 
 #ifdef Q_OS_WIN
-  arch = "x86_64";
+  arch = (sizeof(void *) == 8) ? "x86_64" : "i386";
 #else
   arch = QSysInfo::currentCpuArchitecture();
 #endif