aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--cmake/addons/CMakeLists.txt8
-rw-r--r--cmake/addons/depends/windowsstore/CMakeLists.txt52
-rw-r--r--cmake/addons/depends/windowsstore/Install.cmake24
-rw-r--r--cmake/addons/depends/windowsstore/README19
-rw-r--r--cmake/addons/depends/windowsstore/p8-platform/p8-platform.txt1
-rw-r--r--cmake/addons/depends/windowsstore/prebuilt/README21
-rw-r--r--cmake/scripts/common/HandleDepends.cmake13
-rw-r--r--cmake/scripts/windowsstore/Macros.cmake2
-rw-r--r--tools/buildsteps/windows/arm-uwp/make-addons.bat2
-rw-r--r--tools/buildsteps/windows/make-addons.bat19
-rw-r--r--tools/buildsteps/windows/win32-uwp/make-addons.bat16
-rw-r--r--tools/buildsteps/windows/x64-uwp/make-addons.bat2
-rw-r--r--xbmc/addons/AddonManager.cpp8
-rw-r--r--xbmc/addons/binary-addons/BinaryAddonType.cpp4
14 files changed, 172 insertions, 19 deletions
diff --git a/cmake/addons/CMakeLists.txt b/cmake/addons/CMakeLists.txt
index a6ea149e3f..fd1d44879b 100644
--- a/cmake/addons/CMakeLists.txt
+++ b/cmake/addons/CMakeLists.txt
@@ -75,6 +75,11 @@ if(CMAKE_INSTALL_PREFIX_INITIALIZED_TO_DEFAULT OR NOT CMAKE_INSTALL_PREFIX)
endif()
list(APPEND CMAKE_PREFIX_PATH ${CMAKE_INSTALL_PREFIX})
+if (CMAKE_SYSTEM_NAME STREQUAL WindowsStore)
+ set(BUILD_ARGS_ext -DCMAKE_SYSTEM_NAME=${CMAKE_SYSTEM_NAME}
+ -DCMAKE_SYSTEM_VERSION=${CMAKE_SYSTEM_VERSION})
+endif()
+
set(BUILD_ARGS -DCMAKE_PREFIX_PATH=${CMAKE_PREFIX_PATH}
-DCMAKE_INSTALL_PREFIX:PATH=<INSTALL_DIR>
-DPACKAGE_CONFIG_PATH=${ADDON_DEPENDS_PATH}/lib/pkgconfig
@@ -86,7 +91,8 @@ set(BUILD_ARGS -DCMAKE_PREFIX_PATH=${CMAKE_PREFIX_PATH}
-DCORE_SYSTEM_NAME=${CORE_SYSTEM_NAME}
-DBUILD_SHARED_LIBS=1
-DCMAKE_C_FLAGS=${CMAKE_C_FLAGS}
- -DCMAKE_CXX_FLAGS=${CMAKE_CXX_FLAGS})
+ -DCMAKE_CXX_FLAGS=${CMAKE_CXX_FLAGS}
+ ${BUILD_ARGS_ext})
if(MSVC)
# move cmake specific targets to a CMakePredefinedTargets folder in Visual Studio
diff --git a/cmake/addons/depends/windowsstore/CMakeLists.txt b/cmake/addons/depends/windowsstore/CMakeLists.txt
new file mode 100644
index 0000000000..c8739c08ec
--- /dev/null
+++ b/cmake/addons/depends/windowsstore/CMakeLists.txt
@@ -0,0 +1,52 @@
+cmake_minimum_required(VERSION 3.1)
+project(kodi-addons-depends-windows)
+
+list(APPEND CMAKE_MODULE_PATH ${PROJECT_SOURCE_DIR})
+
+if(NOT CMAKE_BUILD_TYPE)
+ set(CMAKE_BUILD_TYPE Release)
+endif()
+
+include(ExternalProject)
+
+if(NOT ADDON_DEPENDS_PATH)
+ message(FATAL_ERROR "ADDON_DEPENDS_PATH (${ADDON_DEPENDS_PATH}) is not a valid target directory.")
+else()
+ file(TO_CMAKE_PATH "${ADDON_DEPENDS_PATH}" ADDON_DEPENDS_PATH)
+endif()
+get_filename_component(ADDON_DEPENDS_PATH "${ADDON_DEPENDS_PATH}" ABSOLUTE)
+list(APPEND CMAKE_PREFIX_PATH ${ADDON_DEPENDS_PATH})
+
+if(NOT DEPENDS_TO_BUILD)
+ set(DEPENDS_TO_BUILD "all")
+endif()
+
+function(add_internal id url inputfile)
+ externalproject_add(${id}
+ URL ${url}
+ PREFIX build/${id}
+ CONFIGURE_COMMAND ""
+ BUILD_COMMAND ""
+ INSTALL_COMMAND ${CMAKE_COMMAND}
+ -DINPUTDIR=${PROJECT_BINARY_DIR}/build/${id}/src/${id}
+ -DINPUTFILE=${inputfile}
+ -DDESTDIR=${ADDON_DEPENDS_PATH}
+ -P ${PROJECT_SOURCE_DIR}/Install.cmake
+ )
+endfunction()
+
+file(GLOB_RECURSE download_input_files prebuilt/*.txt)
+foreach(file ${download_input_files})
+ if(NOT file MATCHES install.txt)
+ file(STRINGS ${file} def)
+ get_filename_component(dir ${file} DIRECTORY)
+ string(REPLACE " " ";" def ${def})
+ list(GET def 0 id)
+
+ list(FIND DEPENDS_TO_BUILD ${id} idx)
+ if(idx GREATER -1 OR DEPENDS_TO_BUILD STREQUAL "all")
+ list(GET def 1 url)
+ add_internal(${id} ${url} ${dir}/install.txt)
+ endif()
+ endif()
+endforeach()
diff --git a/cmake/addons/depends/windowsstore/Install.cmake b/cmake/addons/depends/windowsstore/Install.cmake
new file mode 100644
index 0000000000..9a3adbb7c3
--- /dev/null
+++ b/cmake/addons/depends/windowsstore/Install.cmake
@@ -0,0 +1,24 @@
+if(EXISTS "${INPUTFILE}")
+ # if there's an input file we use it to determine which files to copy where
+ file(STRINGS ${INPUTFILE} FILES)
+ string(REPLACE "\n" ";" FILES "${FILES}")
+ foreach(file ${FILES})
+ string(REPLACE " " ";" file "${file}")
+ list(GET file 0 dir)
+ list(GET file 1 dest)
+ list(LENGTH file deflength)
+ if(deflength GREATER 2)
+ list(GET file 2 copy)
+ endif()
+ file(GLOB files ${INPUTDIR}/${dir})
+ foreach(instfile ${files})
+ file(COPY ${instfile} DESTINATION ${DESTDIR}/${dest})
+ if(copy)
+ file(COPY ${instfile} DESTINATION ${DESTDIR}/${copy})
+ endif()
+ endforeach()
+ endforeach()
+else()
+ # otherwise we assume that the content of the extracted archive is already well-formed and can just be copied
+ file(COPY ${INPUTDIR}/${dir} DESTINATION ${DESTDIR})
+endif() \ No newline at end of file
diff --git a/cmake/addons/depends/windowsstore/README b/cmake/addons/depends/windowsstore/README
new file mode 100644
index 0000000000..67dc59451d
--- /dev/null
+++ b/cmake/addons/depends/windowsstore/README
@@ -0,0 +1,19 @@
+KODI WIN32 ADDON DEPENDENCIES
+=============================
+This directory contains the cmake-based buildsystem for dependencies (currently
+only prebuilt) used by one or multiple addons. The buildsystem looks into the
+"prebuilt" sub-directory, downloads all the specified dependencies, extracts
+them and places them into the "depends" sub-directory.
+
+To trigger the cmake-based buildsystem the following command must be executed
+with <path> being the path to this directory (absolute or relative, allowing for
+in-source and out-of-source builds).
+
+ cmake <path> [-G <generator>]
+
+cmake supports multiple generators, see
+http://www.cmake.org/cmake/help/v2.8.8/cmake.html#section_Generators for a list.
+For win32 builds one of the "Visual Studio XX" or the "NMake Makefiles"
+generators is preferred. For the "NMake Makefiles" generator to work the above
+command must be called from an environment prepared for VC++ builds (see
+http://msdn.microsoft.com/en-us/library/f2ccy3wt.aspx).
diff --git a/cmake/addons/depends/windowsstore/p8-platform/p8-platform.txt b/cmake/addons/depends/windowsstore/p8-platform/p8-platform.txt
new file mode 100644
index 0000000000..db6f782502
--- /dev/null
+++ b/cmake/addons/depends/windowsstore/p8-platform/p8-platform.txt
@@ -0,0 +1 @@
+p8-platform https://github.com/afedchin/platform.git win10
diff --git a/cmake/addons/depends/windowsstore/prebuilt/README b/cmake/addons/depends/windowsstore/prebuilt/README
new file mode 100644
index 0000000000..a0c70d6bde
--- /dev/null
+++ b/cmake/addons/depends/windowsstore/prebuilt/README
@@ -0,0 +1,21 @@
+KODI WIN32 PREBUILT ADDON DEPENDENCIES
+======================================
+This directory contains a file or sub-directory for every prebuilt dependency
+used by one of the addons being built. There are two different modes supported.
+Both include a file named <library-id>.txt which must follow the defined format
+ <library-id> <download-url>
+
+If the archive, which the <download-url> points at, contains
+ * only the necessary files and in the proper directory structure (i.e. an
+ "include" and a "lib" directory) then the file must be put into this
+ directory and nothing else is needed.
+ * unnecessary files and/or does not follow the defined directory structure
+ (i.e. an "include" and a "lib" directory) then the file must be put into a
+ sub-directory named <library-id>. Furthermore an additional file called
+ "install.txt" must be placed in that sub-directory. install.txt contains a
+ line for every path/directory/file with a destination where it must be copied
+ to. It must follow the defined format
+ <source> <destination> [<copy-destination>]
+ where <source> must be an existing file, directory or a path containing
+ wildcards, <destination> and the optional <copy-destination> must be existing
+ directories.
diff --git a/cmake/scripts/common/HandleDepends.cmake b/cmake/scripts/common/HandleDepends.cmake
index 85d2cf43e9..49e5ac8fcf 100644
--- a/cmake/scripts/common/HandleDepends.cmake
+++ b/cmake/scripts/common/HandleDepends.cmake
@@ -7,6 +7,10 @@ function(add_addon_depends addon searchpath)
set(OUTPUT_DIR ${ADDON_DEPENDS_PATH})
# look for platform-specific dependencies
file(GLOB_RECURSE cmake_input_files ${searchpath}/${CORE_SYSTEM_NAME}/*.txt)
+ # backward compatibility
+ if(NOT cmake_input_files AND CORE_SYSTEM_NAME STREQUAL windowsstore)
+ file(GLOB_RECURSE cmake_input_files ${searchpath}/windows/*.txt)
+ endif()
file(GLOB_RECURSE cmake_input_files2 ${searchpath}/common/*.txt)
list(APPEND cmake_input_files ${cmake_input_files2})
@@ -67,6 +71,11 @@ function(add_addon_depends addon searchpath)
-DCORE_SYSTEM_NAME=${CORE_SYSTEM_NAME}
-DENABLE_STATIC=1
-DBUILD_SHARED_LIBS=0)
+ # windows store args
+ if (CMAKE_SYSTEM_NAME STREQUAL WindowsStore)
+ list(APPEND BUILD_ARGS -DCMAKE_SYSTEM_NAME=${CMAKE_SYSTEM_NAME}
+ -DCMAKE_SYSTEM_VERSION=${CMAKE_SYSTEM_VERSION})
+ endif()
# if there are no make rules override files available take care of manually passing on ARCH_DEFINES
if(NOT CMAKE_USER_MAKE_RULES_OVERRIDE AND NOT CMAKE_USER_MAKE_RULES_OVERRIDE_CXX)
# make sure we create strings, not lists
@@ -147,6 +156,10 @@ function(add_addon_depends addon searchpath)
if(EXISTS ${dir}/${CORE_SYSTEM_NAME}-deps.txt)
file(STRINGS ${dir}/${CORE_SYSTEM_NAME}-deps.txt deps)
message(STATUS "${id} depends: ${deps}")
+ # backward compatibility
+ elseif(CORE_SYSTEM_NAME STREQUAL windowsstore AND EXISTS ${dir}/windows-deps.txt)
+ file(STRINGS ${dir}/windows-deps.txt deps)
+ message(STATUS "${id} depends: ${deps}")
elseif(EXISTS ${dir}/deps.txt)
set_property(DIRECTORY APPEND PROPERTY CMAKE_CONFIGURE_DEPENDS ${dir}/deps.txt)
file(STRINGS ${dir}/deps.txt deps)
diff --git a/cmake/scripts/windowsstore/Macros.cmake b/cmake/scripts/windowsstore/Macros.cmake
index abae11be2d..f261842111 100644
--- a/cmake/scripts/windowsstore/Macros.cmake
+++ b/cmake/scripts/windowsstore/Macros.cmake
@@ -140,6 +140,7 @@ macro(winstore_append_props target)
set(VCPROJECT_PROPS_FILE "${CMAKE_CURRENT_BINARY_DIR}/${target}.props")
file(TO_NATIVE_PATH ${DEPENDENCIES_DIR} DEPENDENCIES_DIR_NATIVE)
file(TO_NATIVE_PATH ${CMAKE_CURRENT_BINARY_DIR} CMAKE_CURRENT_BINARY_DIR_NATIVE)
+ file(TO_NATIVE_PATH ${CMAKE_SOURCE_DIR}/project/Win32BuildSetup/BUILD_WIN32/addons BINARY_ADDONS_DIR_NATIVE)
file(WRITE ${VCPROJECT_PROPS_FILE}
"<?xml version=\"1.0\" encoding=\"utf-8\"?>\n"
@@ -148,6 +149,7 @@ macro(winstore_append_props target)
" <PropertyGroup Label=\"APP_DLLS\">\n"
" <BinPath>${DEPENDENCIES_DIR_NATIVE}\\bin</BinPath>\n"
" <BuildRootPath>${CMAKE_CURRENT_BINARY_DIR_NATIVE}</BuildRootPath>\n"
+ " <BinaryAddonsPath>${BINARY_ADDONS_DIR_NATIVE}</BinaryAddonsPath>\n"
" </PropertyGroup>\n"
"${DEBUG_DLLS_LINKAGE_PROPS}"
"${XBT_FILE_PROPS}"
diff --git a/tools/buildsteps/windows/arm-uwp/make-addons.bat b/tools/buildsteps/windows/arm-uwp/make-addons.bat
index d19927825b..939538b6bd 100644
--- a/tools/buildsteps/windows/arm-uwp/make-addons.bat
+++ b/tools/buildsteps/windows/arm-uwp/make-addons.bat
@@ -4,5 +4,5 @@ rem set Visual C++ build environment
call "%VS140COMNTOOLS%..\..\VC\bin\amd64_arm\vcvarsamd64_arm.bat" store 10.0.14393.0 || call "%VS140COMNTOOLS%..\..\VC\vcvarsall.bat" arm store 10.0.14393.0
PUSHD %~dp0\..
-CALL make-addons.bat %*
+CALL make-addons.bat win10 %*
POPD
diff --git a/tools/buildsteps/windows/make-addons.bat b/tools/buildsteps/windows/make-addons.bat
index cc1e128b42..922b2e4f8e 100644
--- a/tools/buildsteps/windows/make-addons.bat
+++ b/tools/buildsteps/windows/make-addons.bat
@@ -8,6 +8,7 @@ SET install=false
SET clean=false
SET package=false
SET addon=
+SET store=
SETLOCAL EnableDelayedExpansion
FOR %%b IN (%*) DO (
@@ -17,9 +18,11 @@ FOR %%b IN (%*) DO (
SET clean=true
) ELSE ( IF %%b == package (
SET package=true
+ ) ELSE ( IF %%b == win10 (
+ SET store=store
) ELSE (
SET addon=!addon! %%b
- )))
+ ))))
)
SETLOCAL DisableDelayedExpansion
@@ -30,7 +33,7 @@ POPD
rem setup some paths that we need later
SET CUR_PATH=%CD%
SET BASE_PATH=%WORKDIR%\cmake
-SET SCRIPTS_PATH=%BASE_PATH%\scripts\windows
+SET SCRIPTS_PATH=%BASE_PATH%\scripts\windows%store%
SET ADDONS_PATH=%BASE_PATH%\addons
SET ADDON_DEPENDS_PATH=%ADDONS_PATH%\output
SET ADDONS_BUILD_PATH=%ADDONS_PATH%\build
@@ -92,6 +95,10 @@ IF "%addon%" NEQ "" (
SETLOCAL DisableDelayedExpansion
)
+IF "%store%" NEQ "" (
+SET STORE_ARGS=-DCMAKE_SYSTEM_NAME=WindowsStore -DCMAKE_SYSTEM_VERSION=%UCRTVersion%
+)
+
rem execute cmake to generate makefiles processable by nmake
cmake "%ADDONS_PATH%" -G "NMake Makefiles" ^
-DCMAKE_BUILD_TYPE=Release ^
@@ -102,7 +109,9 @@ cmake "%ADDONS_PATH%" -G "NMake Makefiles" ^
-DBUILD_DIR=%ADDONS_BUILD_PATH% ^
-DADDON_DEPENDS_PATH=%ADDON_DEPENDS_PATH% ^
-DPACKAGE_ZIP=ON ^
+ %STORE_ARGS% ^
-DADDONS_TO_BUILD="%ADDONS_TO_BUILD%"
+
IF ERRORLEVEL 1 (
ECHO cmake error level: %ERRORLEVEL% > %ERRORFILE%
GOTO ERROR
@@ -111,7 +120,7 @@ IF ERRORLEVEL 1 (
rem get the list of addons that can actually be built
SET ADDONS_TO_MAKE=
SETLOCAL EnableDelayedExpansion
-FOR /f "delims=" %%i IN ('nmake supported_addons') DO (
+FOR /f "delims=" %%i IN ('cmake --build . --target supported_addons') DO (
SET line="%%i"
SET addons=!line:ALL_ADDONS_BUILDING=!
IF NOT "!addons!" == "!line!" (
@@ -123,8 +132,8 @@ SETLOCAL DisableDelayedExpansion
rem loop over all addons to build
FOR %%a IN (%ADDONS_TO_MAKE%) DO (
ECHO Building %%a...
- rem execute nmake to build the addons
- nmake %%a
+ rem execute cmake to build the addons
+ cmake --build . --target %%a
IF ERRORLEVEL 1 (
ECHO nmake %%a error level: %ERRORLEVEL% > %ERRORFILE%
ECHO %%a >> %ADDONS_FAILURE_FILE%
diff --git a/tools/buildsteps/windows/win32-uwp/make-addons.bat b/tools/buildsteps/windows/win32-uwp/make-addons.bat
index 937f7f76e1..68f080ed4a 100644
--- a/tools/buildsteps/windows/win32-uwp/make-addons.bat
+++ b/tools/buildsteps/windows/win32-uwp/make-addons.bat
@@ -1,8 +1,8 @@
-@ECHO OFF
-
-rem set Visual C++ build environment
-call "%VS140COMNTOOLS%..\..\VC\bin\amd64_x86\vcvarsamd64_x86.bat" store 10.0.14393.0 || call "%VS140COMNTOOLS%..\..\VC\vcvarsall.bat" x86 store 10.0.14393.0
-
-PUSHD %~dp0\..
-CALL make-addons.bat %*
-POPD
+@ECHO OFF
+
+rem set Visual C++ build environment
+call "%VS140COMNTOOLS%..\..\VC\bin\amd64_x86\vcvarsamd64_x86.bat" store 10.0.14393.0 || call "%VS140COMNTOOLS%..\..\VC\vcvarsall.bat" x86 store 10.0.14393.0
+
+PUSHD %~dp0\..
+CALL make-addons.bat win10 %*
+POPD
diff --git a/tools/buildsteps/windows/x64-uwp/make-addons.bat b/tools/buildsteps/windows/x64-uwp/make-addons.bat
index fca4771f64..9c2758f9db 100644
--- a/tools/buildsteps/windows/x64-uwp/make-addons.bat
+++ b/tools/buildsteps/windows/x64-uwp/make-addons.bat
@@ -4,5 +4,5 @@ rem set Visual C++ build environment
call "%VS140COMNTOOLS%..\..\VC\vcvarsall.bat" amd64 store 10.0.14393.0
PUSHD %~dp0\..
-CALL make-addons.bat %*
+CALL make-addons.bat win10 %*
POPD
diff --git a/xbmc/addons/AddonManager.cpp b/xbmc/addons/AddonManager.cpp
index e015f0755e..0203b2b50d 100644
--- a/xbmc/addons/AddonManager.cpp
+++ b/xbmc/addons/AddonManager.cpp
@@ -1012,9 +1012,11 @@ bool CAddonMgr::PlatformSupportsAddon(const cp_plugin_info_t *plugin)
"linux",
#elif defined(TARGET_LINUX)
"linux",
-#elif defined(TARGET_WINDOWS)
+#elif defined(TARGET_WINDOWS_DESKTOP)
"windx",
"windows",
+#elif defined(TARGET_WINDOWS_STORE)
+ "windowsstore",
#elif defined(TARGET_DARWIN_IOS)
"ios",
#elif defined(TARGET_DARWIN_OSX)
@@ -1098,10 +1100,12 @@ std::string CAddonMgr::GetPlatformLibraryName(cp_cfg_element_t *base) const
if (libraryName.empty())
#endif
libraryName = GetExtValue(base, "@library_linux");
-#elif defined(TARGET_WINDOWS)
+#elif defined(TARGET_WINDOWS_DESKTOP)
libraryName = GetExtValue(base, "@library_windx");
if (libraryName.empty())
libraryName = GetExtValue(base, "@library_windows");
+#elif defined(TARGET_WINDOWS_STORE)
+ libraryName = GetExtValue(base, "@library_windowsstore");
#elif defined(TARGET_DARWIN)
#if defined(TARGET_DARWIN_IOS)
libraryName = GetExtValue(base, "@library_ios");
diff --git a/xbmc/addons/binary-addons/BinaryAddonType.cpp b/xbmc/addons/binary-addons/BinaryAddonType.cpp
index 9516a589d1..b3f5dd8264 100644
--- a/xbmc/addons/binary-addons/BinaryAddonType.cpp
+++ b/xbmc/addons/binary-addons/BinaryAddonType.cpp
@@ -72,10 +72,12 @@ const char* CBinaryAddonType::GetPlatformLibraryName(const TiXmlElement* element
if (libraryName == nullptr)
#endif
libraryName = element->Attribute("library_linux");
-#elif defined(TARGET_WINDOWS)
+#elif defined(TARGET_WINDOWS_DESKTOP)
libraryName = element->Attribute("library_windx");
if (libraryName == nullptr)
libraryName = element->Attribute("library_windows");
+#elif defined(TARGET_WINDOWS_STORE)
+ libraryName = element->Attribute("library_windowsstore");
#elif defined(TARGET_DARWIN)
#if defined(TARGET_DARWIN_IOS)
libraryName = element->Attribute("library_ios");