From 5f8335c1e49ce108ef3481863833c98efa00411b Mon Sep 17 00:00:00 2001 From: manuel Date: Thu, 2 Jul 2020 23:09:26 +0200 Subject: sync with upstream --- cmake/KodiConfig.cmake.in | 4 +- cmake/README.md | 2 +- cmake/addons/CMakeLists.txt | 27 +++- cmake/addons/README.md | 2 +- cmake/addons/bootstrap/README.md | 1 + cmake/addons/depends/common/kodi-platform/deps.txt | 2 - .../depends/common/kodi-platform/kodi-platform.txt | 1 - .../depends/common/p8-platform/p8-platform.txt | 1 - cmake/addons/depends/common/tinyxml/CMakeLists.txt | 22 ---- cmake/addons/depends/common/tinyxml/tinyxml.sha256 | 1 - cmake/addons/depends/common/tinyxml/tinyxml.txt | 1 - cmake/addons/depends/windowsstore/CMakeLists.txt | 52 -------- cmake/addons/depends/windowsstore/Install.cmake | 24 ---- cmake/addons/depends/windowsstore/README | 19 --- .../windowsstore/p8-platform/p8-platform.txt | 1 - cmake/addons/depends/windowsstore/prebuilt/README | 21 ---- cmake/cpack/deb/copyright | 137 +++++++++++++++++++++ cmake/cpack/deb/packages/kodi.txt.in | 2 +- cmake/installdata/common/certificates.txt | 2 +- cmake/installdata/darwin_embedded/fontconfig.txt | 1 + cmake/installdata/darwin_embedded/packaging.txt | 3 + cmake/installdata/darwin_embedded/runtime.txt | 2 + cmake/installdata/ios/fontconfig.txt | 1 - cmake/installdata/ios/packaging.txt | 3 - cmake/installdata/ios/runtime.txt | 2 - cmake/installdata/test-reference-data.txt | 8 ++ cmake/modules/FindAML.cmake | 49 -------- cmake/modules/FindBluray.cmake | 4 + cmake/modules/FindCdio.cmake | 38 ++---- cmake/modules/FindClangFormat.cmake | 11 ++ cmake/modules/FindCpluff.cmake | 51 -------- cmake/modules/FindCrossGUID.cmake | 9 +- cmake/modules/FindDav1d.cmake | 82 ++++++++++++ cmake/modules/FindEpollShim.cmake | 27 ++++ cmake/modules/FindFFMPEG.cmake | 29 +++-- cmake/modules/FindFlatBuffers.cmake | 3 +- cmake/modules/FindFmt.cmake | 9 +- cmake/modules/FindFriBidi.cmake | 3 +- cmake/modules/FindGIF.cmake | 12 +- cmake/modules/FindGtest.cmake | 84 +++++++++++++ cmake/modules/FindIso9660pp.cmake | 43 +++++++ cmake/modules/FindLibDRM.cmake | 15 +++ cmake/modules/FindLibDvd.cmake | 3 + cmake/modules/FindLibUSB.cmake | 2 +- cmake/modules/FindMariaDBClient.cmake | 4 +- cmake/modules/FindNFS.cmake | 38 ++++++ cmake/modules/FindOpenGLES.cmake | 2 +- cmake/modules/FindPlist.cmake | 19 +-- cmake/modules/FindPython.cmake | 10 +- cmake/modules/FindSSE.cmake | 2 + cmake/modules/FindSWIG.cmake | 2 +- cmake/modules/FindShairplay.cmake | 42 +++---- cmake/modules/FindSmbClient.cmake | 3 + cmake/modules/FindSpdlog.cmake | 107 ++++++++++++++++ cmake/modules/FindUdfread.cmake | 78 ++++++++++++ cmake/platform/android/defines.txt | 2 +- cmake/platform/darwin_embedded/defines.txt | 1 + cmake/platform/darwin_embedded/ios.cmake | 3 + cmake/platform/darwin_embedded/tvos.cmake | 3 + cmake/platform/freebsd/defines.txt | 2 +- cmake/platform/freebsd/gbm.cmake | 1 + cmake/platform/ios/defines.txt | 1 - cmake/platform/ios/ios.cmake | 2 - cmake/platform/linux/aml.cmake | 3 - cmake/platform/linux/defines.txt | 2 +- cmake/platform/linux/gbm.cmake | 2 +- cmake/platform/linux/x11.cmake | 19 ++- cmake/platform/osx/defines.txt | 2 +- cmake/scripts/android/ArchSetup.cmake | 9 +- cmake/scripts/android/Install.cmake | 6 +- cmake/scripts/common/AddonHelpers.cmake | 53 ++++++-- cmake/scripts/common/AddonHelpers.dox | 59 +++++++++ cmake/scripts/common/ArchSetup.cmake | 26 +--- cmake/scripts/common/CheckTargetPlatform.cmake | 5 +- cmake/scripts/common/CompilerSettings.cmake | 7 ++ cmake/scripts/common/GenerateVersionedFiles.cmake | 3 - cmake/scripts/common/HandleDepends.cmake | 20 ++- cmake/scripts/common/Macros.cmake | 72 ----------- cmake/scripts/common/PrepareEnv.cmake | 17 ++- cmake/scripts/darwin/Macros.cmake | 8 ++ cmake/scripts/darwin_embedded/ArchSetup.cmake | 65 ++++++++++ cmake/scripts/darwin_embedded/ExtraTargets.cmake | 25 ++++ cmake/scripts/darwin_embedded/Install.cmake | 135 ++++++++++++++++++++ cmake/scripts/darwin_embedded/Macros.cmake | 118 ++++++++++++++++++ cmake/scripts/darwin_embedded/PathSetup.cmake | 7 ++ cmake/scripts/freebsd/ArchSetup.cmake | 7 +- cmake/scripts/ios/ArchSetup.cmake | 61 --------- cmake/scripts/ios/Install.cmake | 99 --------------- cmake/scripts/ios/Macros.cmake | 1 - cmake/scripts/ios/PathSetup.cmake | 1 - cmake/scripts/linux/ArchSetup.cmake | 40 ++++-- cmake/scripts/osx/ArchSetup.cmake | 14 ++- cmake/scripts/osx/Install.cmake | 1 + cmake/scripts/osx/Macros.cmake | 2 +- cmake/scripts/windows/ArchSetup.cmake | 11 +- cmake/scripts/windowsstore/ArchSetup.cmake | 13 +- cmake/scripts/windowsstore/Macros.cmake | 2 +- cmake/treedata/android/subdirs.txt | 3 +- cmake/treedata/common/gbm/gbm.txt | 3 + cmake/treedata/common/pvr.txt | 20 +-- cmake/treedata/common/rbpi/rbpi.txt | 2 + cmake/treedata/common/subdirs.txt | 13 +- cmake/treedata/common/tests.txt | 1 + cmake/treedata/common/videoplayer.txt | 1 + cmake/treedata/common/wayland/wayland.txt | 3 + cmake/treedata/common/x11/X.txt | 3 + cmake/treedata/darwin_embedded/ios/ios.txt | 2 + cmake/treedata/darwin_embedded/subdirs.txt | 14 +++ cmake/treedata/darwin_embedded/tvos/tvos.txt | 5 + cmake/treedata/freebsd/subdirs.txt | 5 +- cmake/treedata/ios/subdirs.txt | 15 --- cmake/treedata/linux/subdirs.txt | 2 + cmake/treedata/linux/tests.txt | 1 + cmake/treedata/optional/common/X.txt | 3 - cmake/treedata/optional/common/aml.txt | 2 - cmake/treedata/optional/common/avahi.txt | 1 + cmake/treedata/optional/common/gbm.txt | 2 - cmake/treedata/optional/common/wayland.txt | 3 - cmake/treedata/osx/subdirs.txt | 7 +- cmake/treedata/windows/subdirs.txt | 1 + cmake/treedata/windowsstore/subdirs.txt | 1 + 121 files changed, 1421 insertions(+), 745 deletions(-) delete mode 100644 cmake/addons/depends/common/kodi-platform/deps.txt delete mode 100644 cmake/addons/depends/common/kodi-platform/kodi-platform.txt delete mode 100644 cmake/addons/depends/common/p8-platform/p8-platform.txt delete mode 100644 cmake/addons/depends/common/tinyxml/CMakeLists.txt delete mode 100644 cmake/addons/depends/common/tinyxml/tinyxml.sha256 delete mode 100644 cmake/addons/depends/common/tinyxml/tinyxml.txt delete mode 100644 cmake/addons/depends/windowsstore/CMakeLists.txt delete mode 100644 cmake/addons/depends/windowsstore/Install.cmake delete mode 100644 cmake/addons/depends/windowsstore/README delete mode 100644 cmake/addons/depends/windowsstore/p8-platform/p8-platform.txt delete mode 100644 cmake/addons/depends/windowsstore/prebuilt/README create mode 100644 cmake/installdata/darwin_embedded/fontconfig.txt create mode 100644 cmake/installdata/darwin_embedded/packaging.txt create mode 100644 cmake/installdata/darwin_embedded/runtime.txt delete mode 100644 cmake/installdata/ios/fontconfig.txt delete mode 100644 cmake/installdata/ios/packaging.txt delete mode 100644 cmake/installdata/ios/runtime.txt delete mode 100644 cmake/modules/FindAML.cmake create mode 100644 cmake/modules/FindClangFormat.cmake delete mode 100644 cmake/modules/FindCpluff.cmake create mode 100644 cmake/modules/FindDav1d.cmake create mode 100644 cmake/modules/FindEpollShim.cmake create mode 100644 cmake/modules/FindGtest.cmake create mode 100644 cmake/modules/FindIso9660pp.cmake create mode 100644 cmake/modules/FindSpdlog.cmake create mode 100644 cmake/modules/FindUdfread.cmake create mode 100644 cmake/platform/darwin_embedded/defines.txt create mode 100644 cmake/platform/darwin_embedded/ios.cmake create mode 100644 cmake/platform/darwin_embedded/tvos.cmake delete mode 100644 cmake/platform/ios/defines.txt delete mode 100644 cmake/platform/ios/ios.cmake delete mode 100644 cmake/platform/linux/aml.cmake create mode 100644 cmake/scripts/common/AddonHelpers.dox create mode 100644 cmake/scripts/common/CompilerSettings.cmake create mode 100644 cmake/scripts/darwin/Macros.cmake create mode 100644 cmake/scripts/darwin_embedded/ArchSetup.cmake create mode 100644 cmake/scripts/darwin_embedded/ExtraTargets.cmake create mode 100644 cmake/scripts/darwin_embedded/Install.cmake create mode 100644 cmake/scripts/darwin_embedded/Macros.cmake create mode 100644 cmake/scripts/darwin_embedded/PathSetup.cmake delete mode 100644 cmake/scripts/ios/ArchSetup.cmake delete mode 100644 cmake/scripts/ios/Install.cmake delete mode 120000 cmake/scripts/ios/Macros.cmake delete mode 120000 cmake/scripts/ios/PathSetup.cmake create mode 100644 cmake/treedata/common/gbm/gbm.txt create mode 100644 cmake/treedata/common/rbpi/rbpi.txt create mode 100644 cmake/treedata/common/wayland/wayland.txt create mode 100644 cmake/treedata/common/x11/X.txt create mode 100644 cmake/treedata/darwin_embedded/ios/ios.txt create mode 100644 cmake/treedata/darwin_embedded/subdirs.txt create mode 100755 cmake/treedata/darwin_embedded/tvos/tvos.txt delete mode 100644 cmake/treedata/ios/subdirs.txt create mode 100644 cmake/treedata/linux/tests.txt delete mode 100644 cmake/treedata/optional/common/X.txt delete mode 100644 cmake/treedata/optional/common/aml.txt create mode 100644 cmake/treedata/optional/common/avahi.txt delete mode 100644 cmake/treedata/optional/common/gbm.txt delete mode 100644 cmake/treedata/optional/common/wayland.txt (limited to 'cmake') diff --git a/cmake/KodiConfig.cmake.in b/cmake/KodiConfig.cmake.in index 9ec1215..a06d889 100644 --- a/cmake/KodiConfig.cmake.in +++ b/cmake/KodiConfig.cmake.in @@ -4,6 +4,7 @@ set(APP_NAME_UC @APP_NAME_UC@) set(APP_PACKAGE @APP_PACKAGE@) set(APP_VERSION_MAJOR @APP_VERSION_MAJOR@) set(APP_VERSION_MINOR @APP_VERSION_MINOR@) +set(APP_VERSION_CODE @APP_VERSION_CODE@) if(NOT @APP_NAME_UC@_PREFIX) set(@APP_NAME_UC@_PREFIX @APP_PREFIX@) endif() @@ -17,9 +18,6 @@ if(NOT @APP_NAME_UC@_DATA_DIR) set(@APP_NAME_UC@_DATA_DIR @APP_DATA_DIR@) endif() set(APP_RENDER_SYSTEM @APP_RENDER_SYSTEM@) -if(NOT WIN32) - set(CMAKE_CXX_FLAGS "$ENV{CXXFLAGS} @CXX11_SWITCH@") -endif() list(APPEND CMAKE_MODULE_PATH @APP_LIB_DIR@ @APP_DATA_DIR@/cmake) string(REPLACE ";" " " ARCH_DEFINES "@ARCH_DEFINES@") diff --git a/cmake/README.md b/cmake/README.md index 2febe48..9fd5d1b 100644 --- a/cmake/README.md +++ b/cmake/README.md @@ -5,7 +5,7 @@ Welcome to Kodi's CMake Based Build System. CMake is a cross-platform tool for g * Linux (several distros) * Windows -* macOS and iOS +* macOS, iOS and tvOS * Android * FreeBSD diff --git a/cmake/addons/CMakeLists.txt b/cmake/addons/CMakeLists.txt index 5fc798b..3dccc01 100644 --- a/cmake/addons/CMakeLists.txt +++ b/cmake/addons/CMakeLists.txt @@ -80,6 +80,8 @@ if (CMAKE_SYSTEM_NAME STREQUAL WindowsStore) -DCMAKE_SYSTEM_VERSION=${CMAKE_SYSTEM_VERSION}) endif() +include(${CORE_SOURCE_DIR}/cmake/scripts/common/CompilerSettings.cmake) + set(BUILD_ARGS -DCMAKE_PREFIX_PATH=${CMAKE_PREFIX_PATH} -DCMAKE_INSTALL_PREFIX:PATH= -DPACKAGE_CONFIG_PATH=${ADDON_DEPENDS_PATH}/lib/pkgconfig @@ -121,6 +123,17 @@ if(CMAKE_TOOLCHAIN_FILE) message(STATUS ${BUILD_ARGS}) endif() +# used for addons where need special folders to store there content (if +# not set the addon define it byself). +# e.g. Google Chromium addon where his git bring: +# - "unable to create file" ... "Filename too long" +# see also WARNING by Windows on: https://bitbucket.org/chromiumembedded/cef/wiki/MasterBuildQuickStart +if(THIRD_PARTY_PATH) + message(STATUS "Third party lib path specified") + message(STATUS ${THIRD_PARTY_PATH}) + list(APPEND BUILD_ARGS -DTHIRD_PARTY_PATH=${THIRD_PARTY_PATH}) +endif() + if(NOT ADDONS_TO_BUILD) set(ADDONS_TO_BUILD "all") else() @@ -243,9 +256,14 @@ foreach(addon ${addons}) if(idx GREATER -1 OR "${ADDONS_TO_BUILD}" STREQUAL "all") set(ADDON_FOUND TRUE) # Maybe we have a regex - elseif(id MATCHES "${ADDONS_TO_BUILD}") - message(STATUS "Pattern ${ADDONS_TO_BUILD} matches ${id}, building addon") - set(ADDON_FOUND TRUE) + else() + foreach(ADDONLISTITEM ${ADDONS_TO_BUILD}) + if(id MATCHES "${ADDONLISTITEM}") + message(STATUS "Pattern ${ADDONLISTITEM} matches ${id}, building addon") + set(ADDON_FOUND TRUE) + break() + endif() + endforeach() endif() if(ADDON_FOUND) @@ -376,9 +394,6 @@ foreach(addon ${addons}) DEPENDERS build ALWAYS 1) - # add "kodi-platform" as a dependency to every addon - add_dependencies(${id} kodi-platform) - set(${id}_DEPENDS_DIR ${SOURCE_DIR}/depends) if(EXISTS ${${id}_DEPENDS_DIR}) diff --git a/cmake/addons/README.md b/cmake/addons/README.md index dd222f5..17e6460 100644 --- a/cmake/addons/README.md +++ b/cmake/addons/README.md @@ -1,4 +1,4 @@ -![Kodi logo](https://raw.githubusercontent.com/xbmc/xbmc-forum/master/xbmc/images/logo-sbs-black.png) +![Kodi logo](https://github.com/xbmc/xbmc/raw/master/docs/resources/banner_slim.png) # Kodi add-ons CMake based buildsystem This directory contains the cmake-based buildsystem for Kodi add-ons. It looks into the directory pointed to by the *ADDONS_DEFINITION_DIR* option (which defaults to the *addons* sub-directory) and parses all *.txt files recursively. Each add-on must have its own `.txt` file in a separate sub-directory that must follow one of the defined formats: diff --git a/cmake/addons/bootstrap/README.md b/cmake/addons/bootstrap/README.md index b886b5b..52ded74 100644 --- a/cmake/addons/bootstrap/README.md +++ b/cmake/addons/bootstrap/README.md @@ -1,3 +1,4 @@ +![Kodi logo](https://github.com/xbmc/xbmc/raw/master/docs/resources/banner_slim.png) # KODI ADDON DEFINITIONS BOOTSTRAPPING This directory contains the cmake-based buildsystem for addon definitions bootstrapping which downloads the addon definitions from one or more addon diff --git a/cmake/addons/depends/common/kodi-platform/deps.txt b/cmake/addons/depends/common/kodi-platform/deps.txt deleted file mode 100644 index b953815..0000000 --- a/cmake/addons/depends/common/kodi-platform/deps.txt +++ /dev/null @@ -1,2 +0,0 @@ -tinyxml -p8-platform diff --git a/cmake/addons/depends/common/kodi-platform/kodi-platform.txt b/cmake/addons/depends/common/kodi-platform/kodi-platform.txt deleted file mode 100644 index c553769..0000000 --- a/cmake/addons/depends/common/kodi-platform/kodi-platform.txt +++ /dev/null @@ -1 +0,0 @@ -kodi-platform https://github.com/xbmc/kodi-platform e8574b883ffa2131f2eeb96ff3724d60b21130f7 diff --git a/cmake/addons/depends/common/p8-platform/p8-platform.txt b/cmake/addons/depends/common/p8-platform/p8-platform.txt deleted file mode 100644 index ae7a370..0000000 --- a/cmake/addons/depends/common/p8-platform/p8-platform.txt +++ /dev/null @@ -1 +0,0 @@ -p8-platform https://github.com/xbmc/platform.git 32190045c7eb6883c0662db2f91b4ceeab904fc2 diff --git a/cmake/addons/depends/common/tinyxml/CMakeLists.txt b/cmake/addons/depends/common/tinyxml/CMakeLists.txt deleted file mode 100644 index ec396ee..0000000 --- a/cmake/addons/depends/common/tinyxml/CMakeLists.txt +++ /dev/null @@ -1,22 +0,0 @@ -cmake_minimum_required(VERSION 3.1) -project(tinyxml) - -set(SOURCES src/tinystr.cpp - src/tinyxml.cpp - src/tinyxmlerror.cpp - src/tinyxmlparser.cpp) - -if(WIN32) - add_definitions(-DWIN32 -D_LIB) -endif() -add_definitions(-DTIXML_USE_STL) - -add_library(tinyxml ${SOURCES}) - -include_directories(${PROJECT_SOURCE_DIR}/include) - -set(HEADERS ${PROJECT_SOURCE_DIR}/include/tinystr.h - ${PROJECT_SOURCE_DIR}/include/tinyxml.h) - -install(FILES ${HEADERS} DESTINATION ${CMAKE_INSTALL_PREFIX}/include) -install(TARGETS tinyxml DESTINATION ${CMAKE_INSTALL_PREFIX}/lib) diff --git a/cmake/addons/depends/common/tinyxml/tinyxml.sha256 b/cmake/addons/depends/common/tinyxml/tinyxml.sha256 deleted file mode 100644 index 78c07c8..0000000 --- a/cmake/addons/depends/common/tinyxml/tinyxml.sha256 +++ /dev/null @@ -1 +0,0 @@ -8164c9ad48b9028667768a584d62f7760cfbfb90d0dd6214ad174403058da10c diff --git a/cmake/addons/depends/common/tinyxml/tinyxml.txt b/cmake/addons/depends/common/tinyxml/tinyxml.txt deleted file mode 100644 index f8e05e8..0000000 --- a/cmake/addons/depends/common/tinyxml/tinyxml.txt +++ /dev/null @@ -1 +0,0 @@ -tinyxml http://mirrors.kodi.tv/build-deps/sources/tinyxml-2.6.2_2.tar.gz diff --git a/cmake/addons/depends/windowsstore/CMakeLists.txt b/cmake/addons/depends/windowsstore/CMakeLists.txt deleted file mode 100644 index c8739c0..0000000 --- a/cmake/addons/depends/windowsstore/CMakeLists.txt +++ /dev/null @@ -1,52 +0,0 @@ -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 deleted file mode 100644 index 9a3adbb..0000000 --- a/cmake/addons/depends/windowsstore/Install.cmake +++ /dev/null @@ -1,24 +0,0 @@ -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 deleted file mode 100644 index 67dc594..0000000 --- a/cmake/addons/depends/windowsstore/README +++ /dev/null @@ -1,19 +0,0 @@ -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 being the path to this directory (absolute or relative, allowing for -in-source and out-of-source builds). - - cmake [-G ] - -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 deleted file mode 100644 index db6f782..0000000 --- a/cmake/addons/depends/windowsstore/p8-platform/p8-platform.txt +++ /dev/null @@ -1 +0,0 @@ -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 deleted file mode 100644 index a0c70d6..0000000 --- a/cmake/addons/depends/windowsstore/prebuilt/README +++ /dev/null @@ -1,21 +0,0 @@ -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 .txt which must follow the defined format - - -If the archive, which the 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 . 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 - [] - where must be an existing file, directory or a path containing - wildcards, and the optional must be existing - directories. diff --git a/cmake/cpack/deb/copyright b/cmake/cpack/deb/copyright index 3033afd..3a3916c 100644 --- a/cmake/cpack/deb/copyright +++ b/cmake/cpack/deb/copyright @@ -2362,6 +2362,33 @@ LZO Library - LZO real-time data compression library You should have received a copy of the GNU General Public License along with this program. If not, see . +dav1d - AV1 cross-platform decoder + + + Copyright © 2018-2019, VideoLAN and dav1d authors + All rights reserved. + + Redistribution and use in source and binary forms, with or without + modification, are permitted provided that the following conditions are met: + + 1. Redistributions of source code must retain the above copyright notice, this + list of conditions and the following disclaimer. + + 2. Redistributions in binary form must reproduce the above copyright notice, + this list of conditions and the following disclaimer in the documentation + and/or other materials provided with the distribution. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND + ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED + WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR + ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES + (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND + ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS + SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + Licenses: License: GPL @@ -2908,3 +2935,113 @@ We are required to state that CompuServe Incorporated." -- End of IJG License -- + +License: Alliance for Open Media Patent License 1.0 + +1. License Terms. + +1.1. Patent License. Subject to the terms and conditions of this License, each + Licensor, on behalf of itself and successors in interest and assigns, + grants Licensee a non-sublicensable, perpetual, worldwide, non-exclusive, + no-charge, royalty-free, irrevocable (except as expressly stated in this + License) patent license to its Necessary Claims to make, use, sell, offer + for sale, import or distribute any Implementation. + +1.2. Conditions. + +1.2.1. Availability. As a condition to the grant of rights to Licensee to make, + sell, offer for sale, import or distribute an Implementation under + Section 1.1, Licensee must make its Necessary Claims available under + this License, and must reproduce this License with any Implementation + as follows: + + a. For distribution in source code, by including this License in the + root directory of the source code with its Implementation. + + b. For distribution in any other form (including binary, object form, + and/or hardware description code (e.g., HDL, RTL, Gate Level Netlist, + GDSII, etc.)), by including this License in the documentation, legal + notices, and/or other written materials provided with the + Implementation. + +1.2.2. Additional Conditions. This license is directly from Licensor to + Licensee. Licensee acknowledges as a condition of benefiting from it + that no rights from Licensor are received from suppliers, distributors, + or otherwise in connection with this License. + +1.3. Defensive Termination. If any Licensee, its Affiliates, or its agents + initiates patent litigation or files, maintains, or voluntarily + participates in a lawsuit against another entity or any person asserting + that any Implementation infringes Necessary Claims, any patent licenses + granted under this License directly to the Licensee are immediately + terminated as of the date of the initiation of action unless 1) that suit + was in response to a corresponding suit regarding an Implementation first + brought against an initiating entity, or 2) that suit was brought to + enforce the terms of this License (including intervention in a third-party + action by a Licensee). + +1.4. Disclaimers. The Reference Implementation and Specification are provided + "AS IS" and without warranty. The entire risk as to implementing or + otherwise using the Reference Implementation or Specification is assumed + by the implementer and user. Licensor expressly disclaims any warranties + (express, implied, or otherwise), including implied warranties of + merchantability, non-infringement, fitness for a particular purpose, or + title, related to the material. IN NO EVENT WILL LICENSOR BE LIABLE TO + ANY OTHER PARTY FOR LOST PROFITS OR ANY FORM OF INDIRECT, SPECIAL, + INCIDENTAL, OR CONSEQUENTIAL DAMAGES OF ANY CHARACTER FROM ANY CAUSES OF + ACTION OF ANY KIND WITH RESPECT TO THIS LICENSE, WHETHER BASED ON BREACH + OF CONTRACT, TORT (INCLUDING NEGLIGENCE), OR OTHERWISE, AND WHETHER OR + NOT THE OTHER PARTRY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +2. Definitions. + +2.1. Affiliate. “Affiliate” means an entity that directly or indirectly + Controls, is Controlled by, or is under common Control of that party. + +2.2. Control. “Control” means direct or indirect control of more than 50% of + the voting power to elect directors of that corporation, or for any other + entity, the power to direct management of such entity. + +2.3. Decoder. "Decoder" means any decoder that conforms fully with all + non-optional portions of the Specification. + +2.4. Encoder. "Encoder" means any encoder that produces a bitstream that can + be decoded by a Decoder only to the extent it produces such a bitstream. + +2.5. Final Deliverable. “Final Deliverable” means the final version of a + deliverable approved by the Alliance for Open Media as a Final + Deliverable. + +2.6. Implementation. "Implementation" means any implementation, including the + Reference Implementation, that is an Encoder and/or a Decoder. An + Implementation also includes components of an Implementation only to the + extent they are used as part of an Implementation. + +2.7. License. “License” means this license. + +2.8. Licensee. “Licensee” means any person or entity who exercises patent + rights granted under this License. + +2.9. Licensor. "Licensor" means (i) any Licensee that makes, sells, offers + for sale, imports or distributes any Implementation, or (ii) a person + or entity that has a licensing obligation to the Implementation as a + result of its membership and/or participation in the Alliance for Open + Media working group that developed the Specification. + +2.10. Necessary Claims. "Necessary Claims" means all claims of patents or + patent applications, (a) that currently or at any time in the future, + are owned or controlled by the Licensor, and (b) (i) would be an + Essential Claim as defined by the W3C Policy as of February 5, 2004 + (https://www.w3.org/Consortium/Patent-Policy-20040205/#def-essential) + as if the Specification was a W3C Recommendation; or (ii) are infringed + by the Reference Implementation. + +2.11. Reference Implementation. “Reference Implementation” means an Encoder + and/or Decoder released by the Alliance for Open Media as a Final + Deliverable. + +2.12. Specification. “Specification” means the specification designated by + the Alliance for Open Media as a Final Deliverable for which this + License was issued. + +-- End of Alliance for Open Media Patent License 1.0 License -- \ No newline at end of file diff --git a/cmake/cpack/deb/packages/kodi.txt.in b/cmake/cpack/deb/packages/kodi.txt.in index 4776622..78df46a 100644 --- a/cmake/cpack/deb/packages/kodi.txt.in +++ b/cmake/cpack/deb/packages/kodi.txt.in @@ -15,7 +15,7 @@ PACKAGE_ARCHITECTURE all PACKAGE_SECTION video PACKAGE_PRIORITY optional PACKAGE_SHLIBDEPS -PACKAGE_DEPENDS @APP_NAME_LC@-bin (>= @CPACK_DEBIAN_PACKAGE_VERSION@), @APP_NAME_LC@-bin (<< @CPACK_DEBIAN_PACKAGE_VERSION@.1~), curl, libcurl4 | libcurl3, mesa-utils, x11-utils, fonts-liberation | ttf-liberation, fonts-dejavu-core | ttf-dejavu-core, python-bluez | python-lightblue, python-imaging | python-pil, python-simplejson, libass9 | libass5 | libass4, libgif5 | libgif7, libnfs8 | libnfs4 | libnfs1, libbluray1 | libbluray2, libshairplay0, libvorbisfile3, libaacs0, libcec4, libgnutls30 | libgnutls-deb0-28 | libgnutls28 | libgnutls26, libxslt1.1 +PACKAGE_DEPENDS @APP_NAME_LC@-bin (>= @CPACK_DEBIAN_PACKAGE_VERSION@), @APP_NAME_LC@-bin (<< @CPACK_DEBIAN_PACKAGE_VERSION@.1~), curl, libcurl4 | libcurl3, mesa-utils, x11-utils, fonts-liberation | ttf-liberation, fonts-dejavu-core | ttf-dejavu-core, python3-pil, python3-simplejson, libass9 | libass5 | libass4, libgif5 | libgif7, libnfs8 | libnfs4 | libnfs1, libbluray1 | libbluray2, libshairplay0, libvorbisfile3, libaacs0, libcec4, libgnutls30 | libgnutls-deb0-28 | libgnutls28 | libgnutls26, libxslt1.1 PACKAGE_RECOMMENDS libvdpau1, libva-intel-vaapi-driver, libva1 PACKAGE_SUGGESTS @APP_NAME_LC@-pvr-mythtv, @APP_NAME_LC@-pvr-vuplus, @APP_NAME_LC@-pvr-vdr-vnsi, @APP_NAME_LC@-pvr-njoy, @APP_NAME_LC@-pvr-nextpvr, @APP_NAME_LC@-pvr-mediaportal-tvserver, @APP_NAME_LC@-pvr-tvheadend-hts, @APP_NAME_LC@-pvr-dvbviewer, @APP_NAME_LC@-pvr-argustv, @APP_NAME_LC@-pvr-iptvsimple, @APP_NAME_LC@-audioencoder-vorbis, @APP_NAME_LC@-audioencoder-flac, @APP_NAME_LC@-audioencoder-lame PACKAGE_BREAKS xbmc (<< 2:14.0~git20141019), xbmc-data, xbmc-standalone diff --git a/cmake/installdata/common/certificates.txt b/cmake/installdata/common/certificates.txt index 14e74a7..e802c04 100644 --- a/cmake/installdata/common/certificates.txt +++ b/cmake/installdata/common/certificates.txt @@ -1 +1 @@ -tools/depends/target/openssl/cacert.pem system/certs \ No newline at end of file +system/certs/* diff --git a/cmake/installdata/darwin_embedded/fontconfig.txt b/cmake/installdata/darwin_embedded/fontconfig.txt new file mode 100644 index 0000000..1f1bd9d --- /dev/null +++ b/cmake/installdata/darwin_embedded/fontconfig.txt @@ -0,0 +1 @@ +system/players/VideoPlayer/etc/* diff --git a/cmake/installdata/darwin_embedded/packaging.txt b/cmake/installdata/darwin_embedded/packaging.txt new file mode 100644 index 0000000..3d5ae4a --- /dev/null +++ b/cmake/installdata/darwin_embedded/packaging.txt @@ -0,0 +1,3 @@ +LICENSE.md +privacy-policy.txt +xbmc/platform/darwin/Credits.html diff --git a/cmake/installdata/darwin_embedded/runtime.txt b/cmake/installdata/darwin_embedded/runtime.txt new file mode 100644 index 0000000..3bb5467 --- /dev/null +++ b/cmake/installdata/darwin_embedded/runtime.txt @@ -0,0 +1,2 @@ +tools/darwin/runtime/preflight +tools/darwin/runtime/org.xbmc.helper.plist diff --git a/cmake/installdata/ios/fontconfig.txt b/cmake/installdata/ios/fontconfig.txt deleted file mode 100644 index 1f1bd9d..0000000 --- a/cmake/installdata/ios/fontconfig.txt +++ /dev/null @@ -1 +0,0 @@ -system/players/VideoPlayer/etc/* diff --git a/cmake/installdata/ios/packaging.txt b/cmake/installdata/ios/packaging.txt deleted file mode 100644 index 3d5ae4a..0000000 --- a/cmake/installdata/ios/packaging.txt +++ /dev/null @@ -1,3 +0,0 @@ -LICENSE.md -privacy-policy.txt -xbmc/platform/darwin/Credits.html diff --git a/cmake/installdata/ios/runtime.txt b/cmake/installdata/ios/runtime.txt deleted file mode 100644 index 3bb5467..0000000 --- a/cmake/installdata/ios/runtime.txt +++ /dev/null @@ -1,2 +0,0 @@ -tools/darwin/runtime/preflight -tools/darwin/runtime/org.xbmc.helper.plist diff --git a/cmake/installdata/test-reference-data.txt b/cmake/installdata/test-reference-data.txt index b6c94a7..91738ba 100644 --- a/cmake/installdata/test-reference-data.txt +++ b/cmake/installdata/test-reference-data.txt @@ -1,10 +1,18 @@ xbmc/utils/test/CXBMCTinyXML-test.xml xbmc/utils/test/data/language/Spanish/strings.po +xbmc/filesystem/test/extendedlocalheader.zip xbmc/filesystem/test/reffile.txt xbmc/filesystem/test/reffile.txt.rar xbmc/filesystem/test/reffile.txt.zip xbmc/filesystem/test/refRARnormal.rar xbmc/filesystem/test/refRARstored.rar +xbmc/filesystem/test/data/httpdirectory/apache-default.html +xbmc/filesystem/test/data/httpdirectory/apache-fancy.html +xbmc/filesystem/test/data/httpdirectory/apache-html.html +xbmc/filesystem/test/data/httpdirectory/basic.html +xbmc/filesystem/test/data/httpdirectory/basic-multiline.html +xbmc/filesystem/test/data/httpdirectory/lighttp-default.html +xbmc/filesystem/test/data/httpdirectory/nginx-default.html xbmc/network/test/data/test.html xbmc/network/test/data/test.png xbmc/network/test/data/test-ranges.txt diff --git a/cmake/modules/FindAML.cmake b/cmake/modules/FindAML.cmake deleted file mode 100644 index 89d1fd9..0000000 --- a/cmake/modules/FindAML.cmake +++ /dev/null @@ -1,49 +0,0 @@ -#.rst: -# FindAML -# ------- -# Finds the AML codec -# -# This will define the following variables:: -# -# AML_FOUND - system has AML -# AML_INCLUDE_DIRS - the AML include directory -# AML_DEFINITIONS - the AML definitions -# -# and the following imported targets:: -# -# AML::AML - The AML codec - -find_path(AML_INCLUDE_DIR codec_error.h - PATH_SUFFIXES amcodec) - -include(FindPackageHandleStandardArgs) -find_package_handle_standard_args(AML - REQUIRED_VARS AML_INCLUDE_DIR) - -include(CheckCSourceCompiles) -set(CMAKE_REQUIRED_INCLUDES ${AML_INCLUDE_DIR}) -check_c_source_compiles("#include - - int main() - { - int i = VIDEO_DEC_FORMAT_VP9; - return 0; - } - " AML_HAS_VP9) - -if(AML_FOUND) - set(AML_INCLUDE_DIRS ${AML_INCLUDE_DIR}) - set(AML_DEFINITIONS -DHAS_LIBAMCODEC=1) - if(AML_HAS_VP9) - list(APPEND AML_DEFINITIONS -DHAS_LIBAMCODEC_VP9=1) - endif() - - if(NOT TARGET AML::AML) - add_library(AML::AML UNKNOWN IMPORTED) - set_target_properties(AML::AML PROPERTIES - INTERFACE_INCLUDE_DIRECTORIES "${AML_INCLUDE_DIR}" - INTERFACE_COMPILE_DEFINITIONS HAS_LIBAMCODEC=1) - endif() -endif() - -mark_as_advanced(AMLCODEC_INCLUDE_DIR) diff --git a/cmake/modules/FindBluray.cmake b/cmake/modules/FindBluray.cmake index 58a9a91..34bc50e 100644 --- a/cmake/modules/FindBluray.cmake +++ b/cmake/modules/FindBluray.cmake @@ -48,6 +48,10 @@ if(BLURAY_FOUND) list(APPEND BLURAY_DEFINITIONS -DHAVE_LIBBLURAY_BDJ=1) endif() + if(${BLURAY_LIBRARY} MATCHES ".+\.a$" AND PC_BLURAY_STATIC_LIBRARIES) + list(APPEND BLURAY_LIBRARIES ${PC_BLURAY_STATIC_LIBRARIES}) + endif() + if(NOT TARGET Bluray::Bluray) add_library(Bluray::Bluray UNKNOWN IMPORTED) if(BLURAY_LIBRARY) diff --git a/cmake/modules/FindCdio.cmake b/cmake/modules/FindCdio.cmake index 91ba7bc..465ecc6 100644 --- a/cmake/modules/FindCdio.cmake +++ b/cmake/modules/FindCdio.cmake @@ -8,47 +8,27 @@ # CDIO_FOUND - system has cdio # CDIO_INCLUDE_DIRS - the cdio include directory # CDIO_LIBRARIES - the cdio libraries -# -# and the following imported targets:: -# -# CDIO::CDIO - The cdio library if(PKG_CONFIG_FOUND) - pkg_check_modules(PC_CDIO libcdio>=0.78 libiso9660 QUIET) + pkg_check_modules(PC_CDIO libcdio>=0.80 QUIET) endif() find_path(CDIO_INCLUDE_DIR NAMES cdio/cdio.h - PATHS ${PC_CDIO_libcdio_INCLUDEDIR} - ${PC_CDIO_libiso9660_INCLUDEDIR}) -find_library(CDIO_LIBRARY NAMES cdio libcdio - PATHS ${CDIO_libcdio_LIBDIR} ${CDIO_libiso9660_LIBDIR}) + PATHS ${PC_CDIO_INCLUDEDIR}) -if(NOT WIN32) - find_path(ISO9660_INCLUDE_DIR NAMES cdio/iso9660.h - PATHS ${PC_CDIO_libcdio_INCLUDEDIR} - ${PC_CDIO_libiso9660_INCLUDEDIR}) - find_library(ISO9660_LIBRARY NAMES iso9660 - PATHS ${CDIO_libcdio_LIBDIR} ${CDIO_libiso9660_LIBDIR}) - list(APPEND ISO9660_VARS ISO9660_INCLUDE_DIR ISO9660_LIBRARY) -endif() +find_library(CDIO_LIBRARY NAMES cdio libcdio + PATHS ${PC_CDIO_LIBDIR}) -set(CDIO_VERSION ${PC_CDIO_libcdio_VERSION}) +set(CDIO_VERSION ${PC_CDIO_VERSION}) include(FindPackageHandleStandardArgs) find_package_handle_standard_args(Cdio - REQUIRED_VARS CDIO_LIBRARY CDIO_INCLUDE_DIR ${ISO9660_VARS} + REQUIRED_VARS CDIO_LIBRARY CDIO_INCLUDE_DIR VERSION_VAR CDIO_VERSION) if(CDIO_FOUND) - set(CDIO_LIBRARIES ${CDIO_LIBRARY} ${ISO9660_LIBRARY}) - set(CDIO_INCLUDE_DIRS ${CDIO_INCLUDE_DIR} ${ISO9660_INCLUDE_DIR}) - - if(NOT TARGET CDIO::CDIO) - add_library(CDIO::CDIO UNKNOWN IMPORTED) - set_target_properties(CDIO::CDIO PROPERTIES - IMPORTED_LOCATION "${CDIO_LIBRARY}" - INTERFACE_INCLUDE_DIRECTORIES "${CDIO_INCLUDE_DIR}") - endif() + set(CDIO_LIBRARIES ${CDIO_LIBRARY}) + set(CDIO_INCLUDE_DIRS ${CDIO_INCLUDE_DIR}) endif() -mark_as_advanced(CDIO_INCLUDE_DIR CDIO_LIBRARY ISO9660_INCLUDE_DIR ISO9660_LIBRARY) +mark_as_advanced(CDIO_INCLUDE_DIR CDIO_LIBRARY) diff --git a/cmake/modules/FindClangFormat.cmake b/cmake/modules/FindClangFormat.cmake new file mode 100644 index 0000000..7220d31 --- /dev/null +++ b/cmake/modules/FindClangFormat.cmake @@ -0,0 +1,11 @@ +#.rst: +# FindClangFormat +# ---------- +# Finds clang-format + +find_program(CLANG_FORMAT_EXECUTABLE clang-format) + +include(FindPackageHandleStandardArgs) +find_package_handle_standard_args(ClangFormat REQUIRED_VARS CLANG_FORMAT_EXECUTABLE) + +mark_as_advanced(CLANG_FORMAT_EXECUTABLE) diff --git a/cmake/modules/FindCpluff.cmake b/cmake/modules/FindCpluff.cmake deleted file mode 100644 index 9e29e17..0000000 --- a/cmake/modules/FindCpluff.cmake +++ /dev/null @@ -1,51 +0,0 @@ -# - Builds Cpluff as external project -# Once done this will define -# -# CPLUFF_FOUND - system has cpluff -# CPLUFF_INCLUDE_DIRS - the cpluff include directories -# -# and link Kodi against the cpluff libraries. - -find_package(EXPAT REQUIRED) -if(CORE_SYSTEM_NAME MATCHES windows) - add_subdirectory(${CMAKE_SOURCE_DIR}/lib/cpluff) - set(CPLUFF_LIBRARIES $ ${EXPAT_LIBRARIES}) -else() - string(REPLACE ";" " " defines "${CMAKE_C_FLAGS} ${SYSTEM_DEFINES} -I${EXPAT_INCLUDE_DIR}") - get_filename_component(expat_dir ${EXPAT_LIBRARY} DIRECTORY) - set(ldflags "-L${expat_dir}") - - # iOS: Without specifying -arch, configure tries to use /bin/cpp as C-preprocessor - # http://stackoverflow.com/questions/38836754/cant-cross-compile-c-library-for-arm-ios - if(CORE_SYSTEM_NAME STREQUAL ios) - set(cppflags "-arch ${CPU}") - endif() - - ExternalProject_Add(libcpluff SOURCE_DIR ${CMAKE_SOURCE_DIR}/lib/cpluff - BUILD_IN_SOURCE 1 - PREFIX ${CORE_BUILD_DIR}/cpluff - CONFIGURE_COMMAND AR=${CMAKE_AR} RANLIB=${CMAKE_RANLIB} CC=${CMAKE_C_COMPILER} ${CMAKE_SOURCE_DIR}/lib/cpluff/configure - --disable-nls - --enable-static - --disable-shared - --with-pic - --prefix= - --libdir=/lib - --host=${ARCH} - CFLAGS=${defines} - CPPFLAGS=${cppflags} - LDFLAGS=${ldflags} - BUILD_BYPRODUCTS /lib/libcpluff.a) - ExternalProject_Add_Step(libcpluff autoreconf - DEPENDEES download update patch - DEPENDERS configure - COMMAND rm -f config.status - COMMAND PATH=${NATIVEPREFIX}/bin:$ENV{PATH} autoreconf -vif - WORKING_DIRECTORY ) - - set(CPLUFF_LIBRARIES ${CMAKE_BINARY_DIR}/${CORE_BUILD_DIR}/cpluff/lib/libcpluff.a ${EXPAT_LIBRARIES}) -endif() -set(CPLUFF_INCLUDE_DIRS ${CMAKE_BINARY_DIR}/${CORE_BUILD_DIR}/cpluff/include) -set(CPLUFF_FOUND 1) -mark_as_advanced(CPLUFF_INCLUDE_DIRS CPLUFF_LIBRARIES) -set_target_properties(libcpluff PROPERTIES FOLDER "External Projects") diff --git a/cmake/modules/FindCrossGUID.cmake b/cmake/modules/FindCrossGUID.cmake index 7384747..613c2a4 100644 --- a/cmake/modules/FindCrossGUID.cmake +++ b/cmake/modules/FindCrossGUID.cmake @@ -34,9 +34,6 @@ if(ENABLE_INTERNAL_CROSSGUID) && ${CMAKE_COMMAND} -E copy ${CMAKE_SOURCE_DIR}/tools/depends/target/crossguid/FindUUID.cmake - && - ${CMAKE_COMMAND} -E copy - ${CMAKE_SOURCE_DIR}/tools/depends/target/crossguid/FindCXX11.cmake BUILD_BYPRODUCTS ${CROSSGUID_LIBRARY}) set_target_properties(crossguid PROPERTIES FOLDER "External Projects") @@ -49,7 +46,7 @@ if(ENABLE_INTERNAL_CROSSGUID) set(CROSSGUID_LIBRARIES ${CROSSGUID_LIBRARY}) set(CROSSGUID_INCLUDE_DIRS ${CROSSGUID_INCLUDE_DIR}) else() - find_path(CROSSGUID_INCLUDE_DIR NAMES guid.h) + find_path(CROSSGUID_INCLUDE_DIR NAMES guid.hpp guid.h) find_library(CROSSGUID_LIBRARY_RELEASE NAMES crossguid) find_library(CROSSGUID_LIBRARY_DEBUG NAMES crossguidd) @@ -65,6 +62,10 @@ else() set(CROSSGUID_LIBRARIES ${CROSSGUID_LIBRARY}) set(CROSSGUID_INCLUDE_DIRS ${CROSSGUID_INCLUDE_DIR}) + if(EXISTS "${CROSSGUID_INCLUDE_DIR}/guid.hpp") + set(CROSSGUID_DEFINITIONS -DHAVE_NEW_CROSSGUID) + endif() + add_custom_target(crossguid) set_target_properties(crossguid PROPERTIES FOLDER "External Projects") endif() diff --git a/cmake/modules/FindDav1d.cmake b/cmake/modules/FindDav1d.cmake new file mode 100644 index 0000000..7625afa --- /dev/null +++ b/cmake/modules/FindDav1d.cmake @@ -0,0 +1,82 @@ +#.rst: +# FindDav1d +# -------- +# Finds the dav1d library +# +# This will define the following variables:: +# +# DAV1D_FOUND - system has dav1d +# DAV1D_INCLUDE_DIRS - the dav1d include directories +# DAV1D_LIBRARIES - the dav1d libraries + +if(PKG_CONFIG_FOUND) + pkg_check_modules(PC_DAV1D dav1d QUIET) +endif() + +find_library(DAV1D_LIBRARY NAMES dav1d libdav1d + PATHS ${PC_DAV1D_LIBDIR}) + +find_path(DAV1D_INCLUDE_DIR NAMES dav1d/dav1d.h + PATHS ${PC_DAV1D_INCLUDEDIR}) + +set(DAV1D_VERSION ${PC_DAV1D_VERSION}) + +if(ENABLE_INTERNAL_DAV1D) + include(ExternalProject) + + # Extract version + file(STRINGS ${CMAKE_SOURCE_DIR}/tools/depends/target/dav1d/DAV1D-VERSION VER) + + string(REGEX MATCH "VERSION=[^ ]*$.*" DAV1D_VER "${VER}") + list(GET DAV1D_VER 0 DAV1D_VER) + string(SUBSTRING "${DAV1D_VER}" 8 -1 DAV1D_VER) + + # allow user to override the download URL with a local tarball + # needed for offline build envs + if(DAV1D_URL) + get_filename_component(DAV1D_URL "${DAV1D_URL}" ABSOLUTE) + else() + set(DAV1D_URL http://mirrors.kodi.tv/build-deps/sources/dav1d-${DAV1D_VER}.tar.gz) + endif() + + if(VERBOSE) + message(STATUS "DAV1D_URL: ${DAV1D_URL}") + endif() + + set(DAV1D_LIBRARY ${CMAKE_BINARY_DIR}/${CORE_BUILD_DIR}/lib/libdav1d.a) + set(DAV1D_INCLUDE_DIR ${CMAKE_BINARY_DIR}/${CORE_BUILD_DIR}/include) + set(DAV1D_VERSION ${DAV1D_VER}) + + externalproject_add(dav1d + URL ${DAV1D_URL} + DOWNLOAD_NAME dav1d-${DAV1D_VER}.tar.gz + DOWNLOAD_DIR ${CMAKE_BINARY_DIR}/${CORE_BUILD_DIR}/download + PREFIX ${CORE_BUILD_DIR}/dav1d + CONFIGURE_COMMAND meson + --buildtype=release + --default-library=static + --prefix=${CMAKE_BINARY_DIR}/${CORE_BUILD_DIR} + --libdir=lib + -Denable_asm=true + -Denable_tools=false + -Denable_examples=false + -Denable_tests=false + ../dav1d + BUILD_COMMAND ninja + INSTALL_COMMAND ninja install + BUILD_BYPRODUCTS ${DAV1D_LIBRARY}) + + set_target_properties(dav1d PROPERTIES FOLDER "External Projects") +endif() + +include(FindPackageHandleStandardArgs) +find_package_handle_standard_args(Dav1d + REQUIRED_VARS DAV1D_LIBRARY DAV1D_INCLUDE_DIR + VERSION_VAR DAV1D_VERSION) + +if(DAV1D_FOUND) + set(DAV1D_INCLUDE_DIRS ${DAV1D_INCLUDE_DIR}) + set(DAV1D_LIBRARIES ${DAV1D_LIBRARY}) +endif() + +mark_as_advanced(DAV1D_INCLUDE_DIR DAV1D_LIBRARY) diff --git a/cmake/modules/FindEpollShim.cmake b/cmake/modules/FindEpollShim.cmake new file mode 100644 index 0000000..61366d8 --- /dev/null +++ b/cmake/modules/FindEpollShim.cmake @@ -0,0 +1,27 @@ +# FindEpollShim +# ------------- +# Finds the epoll-shim library +# +# This will define the following variables:: +# +# EPOLLSHIM_FOUND - the system has epoll-shim +# EPOLLSHIM_INCLUDE_DIR - the epoll-shim include directory +# EPOLLSHIM_LIBRARY - the epoll-shim library + +if(PKG_CONFIG_FOUND) + pkg_check_modules(PC_EPOLLSHIM epoll-shim QUIET) +endif() + +find_path(EPOLLSHIM_INCLUDE_DIR NAMES sys/epoll.h PATHS ${PC_EPOLLSHIM_INCLUDE_DIRS}) +find_library(EPOLLSHIM_LIBRARY NAMES epoll-shim PATHS ${PC_EPOLLSHIM_LIBDIR}) + +include(FindPackageHandleStandardArgs) +find_package_handle_standard_args(EpollShim + REQUIRED_VARS EPOLLSHIM_LIBRARY EPOLLSHIM_INCLUDE_DIR) + +if(EPOLLSHIM_FOUND) + set(EPOLLSHIM_INCLUDE_DIRS ${EPOLLSHIM_INCLUDE_DIR}) + set(EPOLLSHIM_LIBRARIES ${EPOLLSHIM_LIBRARY}) +endif() + +mark_as_advanced(EPOLLSHIM_INCLUDE_DIR EPOLLSHIM_LIBRARY) diff --git a/cmake/modules/FindFFMPEG.cmake b/cmake/modules/FindFFMPEG.cmake index ef74671..81d2697 100644 --- a/cmake/modules/FindFFMPEG.cmake +++ b/cmake/modules/FindFFMPEG.cmake @@ -33,14 +33,14 @@ # # required ffmpeg library versions -set(REQUIRED_FFMPEG_VERSION 4.0) -set(_avcodec_ver ">=58.18.100") -set(_avfilter_ver ">=7.16.100") -set(_avformat_ver ">=58.12.100") -set(_avutil_ver ">=56.14.100") -set(_swscale_ver ">=5.1.100") -set(_swresample_ver ">=3.1.100") -set(_postproc_ver ">=55.1.100") +set(REQUIRED_FFMPEG_VERSION 4.3) +set(_avcodec_ver ">=58.91.100") +set(_avfilter_ver ">=7.85.100") +set(_avformat_ver ">=58.45.100") +set(_avutil_ver ">=56.51.100") +set(_swscale_ver ">=5.7.100") +set(_swresample_ver ">=3.7.100") +set(_postproc_ver ">=55.7.100") # Allows building with external ffmpeg not found in system paths, @@ -229,10 +229,16 @@ if(NOT FFMPEG_FOUND) message(STATUS "FFMPEG_URL: ${FFMPEG_URL}") endif() + if (NOT DAV1D_FOUND) + message(STATUS "dav1d not found, internal ffmpeg build will be missing AV1 support!") + endif() + set(FFMPEG_OPTIONS -DENABLE_CCACHE=${ENABLE_CCACHE} -DCCACHE_PROGRAM=${CCACHE_PROGRAM} -DENABLE_VAAPI=${ENABLE_VAAPI} - -DENABLE_VDPAU=${ENABLE_VDPAU}) + -DENABLE_VDPAU=${ENABLE_VDPAU} + -DENABLE_DAV1D=${DAV1D_FOUND} + -DEXTRA_FLAGS=${FFMPEG_EXTRA_FLAGS}) if(KODI_DEPENDSBUILD) set(CROSS_ARGS -DDEPENDS_PATH=${DEPENDS_PATH} @@ -265,6 +271,7 @@ if(NOT FFMPEG_FOUND) -DCMAKE_EXE_LINKER_FLAGS=${LINKER_FLAGS} ${CROSS_ARGS} ${FFMPEG_OPTIONS} + -DPKG_CONFIG_PATH=${CMAKE_BINARY_DIR}/${CORE_BUILD_DIR}/lib/pkgconfig PATCH_COMMAND ${CMAKE_COMMAND} -E copy ${CMAKE_SOURCE_DIR}/tools/depends/target/ffmpeg/CMakeLists.txt && @@ -272,6 +279,10 @@ if(NOT FFMPEG_FOUND) ${CMAKE_SOURCE_DIR}/tools/depends/target/ffmpeg/FindGnuTls.cmake ) + if (ENABLE_INTERNAL_DAV1D) + add_dependencies(ffmpeg dav1d) + endif() + find_program(BASH_COMMAND bash) if(NOT BASH_COMMAND) message(FATAL_ERROR "Internal FFmpeg requires bash.") diff --git a/cmake/modules/FindFlatBuffers.cmake b/cmake/modules/FindFlatBuffers.cmake index 6f7e6a2..5ca67c5 100644 --- a/cmake/modules/FindFlatBuffers.cmake +++ b/cmake/modules/FindFlatBuffers.cmake @@ -11,7 +11,7 @@ if(ENABLE_INTERNAL_FLATBUFFERS) include(ExternalProject) - file(STRINGS ${CMAKE_SOURCE_DIR}/tools/depends/native/flatbuffers-native/Makefile VER REGEX "^[ ]*VERSION[ ]*=.+$") + file(STRINGS ${CMAKE_SOURCE_DIR}/tools/depends/native/flatbuffers/Makefile VER REGEX "^[ ]*VERSION[ ]*=.+$") string(REGEX REPLACE "^[ ]*VERSION[ ]*=[ ]*" "" FLATBUFFERS_VER "${VER}") # Allow user to override the download URL with a local tarball @@ -43,7 +43,6 @@ if(ENABLE_INTERNAL_FLATBUFFERS) -DFLATBUFFERS_BUILD_GRPCTEST=OFF -DFLATBUFFERS_BUILD_SHAREDLIB=OFF "${EXTRA_ARGS}" - PATCH_COMMAND patch -p1 < ${CORE_SOURCE_DIR}/tools/depends/native/flatbuffers-native/0001-Fix-compiler-warning.patch BUILD_BYPRODUCTS ${FLATBUFFERS_FLATC_EXECUTABLE}) set_target_properties(flatbuffers PROPERTIES FOLDER "External Projects" INTERFACE_INCLUDE_DIRECTORIES ${FLATBUFFERS_INCLUDE_DIR}) diff --git a/cmake/modules/FindFmt.cmake b/cmake/modules/FindFmt.cmake index 47cf8be..b426d8c 100644 --- a/cmake/modules/FindFmt.cmake +++ b/cmake/modules/FindFmt.cmake @@ -39,6 +39,8 @@ if(ENABLE_INTERNAL_FMT) DOWNLOAD_DIR ${CMAKE_BINARY_DIR}/${CORE_BUILD_DIR}/download PREFIX ${CORE_BUILD_DIR}/fmt CMAKE_ARGS -DCMAKE_INSTALL_PREFIX=${CMAKE_BINARY_DIR}/${CORE_BUILD_DIR} + -DCMAKE_CXX_EXTENSIONS=${CMAKE_CXX_EXTENSIONS} + -DCMAKE_CXX_STANDARD=${CMAKE_CXX_STANDARD} -DCMAKE_TOOLCHAIN_FILE=${CMAKE_TOOLCHAIN_FILE} -DCMAKE_INSTALL_LIBDIR=lib -DFMT_DOC=OFF @@ -57,12 +59,7 @@ if(ENABLE_INTERNAL_FMT) else() -if(CORE_SYSTEM_NAME STREQUAL windows OR CORE_SYSTEM_NAME STREQUAL windowsstore) - # TODO: fix windows fmt package to include fmt-config.cmake and fmt-config-version.cmake - set(FMT_VERSION 3.0.1) -else() - find_package(FMT 3.0.1 CONFIG REQUIRED QUIET) -endif() +find_package(FMT 6.1.2 CONFIG REQUIRED QUIET) if(PKG_CONFIG_FOUND) pkg_check_modules(PC_FMT libfmt QUIET) diff --git a/cmake/modules/FindFriBidi.cmake b/cmake/modules/FindFriBidi.cmake index 91f3994..7a135e7 100644 --- a/cmake/modules/FindFriBidi.cmake +++ b/cmake/modules/FindFriBidi.cmake @@ -17,7 +17,8 @@ if(PKG_CONFIG_FOUND) pkg_check_modules(PC_FRIBIDI fribidi QUIET) endif() -find_path(FRIBIDI_INCLUDE_DIR NAMES fribidi/fribidi.h +find_path(FRIBIDI_INCLUDE_DIR NAMES fribidi.h + PATH_SUFFIXES fribidi PATHS ${PC_FRIBIDI_INCLUDEDIR}) find_library(FRIBIDI_LIBRARY NAMES fribidi libfribidi PATHS ${PC_FRIBIDI_LIBDIR}) diff --git a/cmake/modules/FindGIF.cmake b/cmake/modules/FindGIF.cmake index 1c616e0..7564a58 100644 --- a/cmake/modules/FindGIF.cmake +++ b/cmake/modules/FindGIF.cmake @@ -16,15 +16,9 @@ find_path(GIF_INCLUDE_DIR gif_lib.h) include(FindPackageHandleStandardArgs) -if(NOT WIN32) - find_library(GIF_LIBRARY NAMES gif) - find_package_handle_standard_args(GIF - REQUIRED_VARS GIF_LIBRARY GIF_INCLUDE_DIR) -else() - # Dynamically loaded DLL - find_package_handle_standard_args(GIF - REQUIRED_VARS GIF_INCLUDE_DIR) -endif() +find_library(GIF_LIBRARY NAMES gif) +find_package_handle_standard_args(GIF + REQUIRED_VARS GIF_LIBRARY GIF_INCLUDE_DIR) if(GIF_FOUND) set(GIF_LIBRARIES ${GIF_LIBRARY}) diff --git a/cmake/modules/FindGtest.cmake b/cmake/modules/FindGtest.cmake new file mode 100644 index 0000000..b59554b --- /dev/null +++ b/cmake/modules/FindGtest.cmake @@ -0,0 +1,84 @@ +#.rst: +# FindGtest +# -------- +# Finds the gtest library +# +# This will define the following variables:: +# +# GTEST_FOUND - system has gtest +# GTEST_INCLUDE_DIRS - the gtest include directories +# GTEST_LIBRARIES - the gtest libraries +# +# and the following imported targets: +# +# Gtest::Gtest - The gtest library + +if(ENABLE_INTERNAL_GTEST) + include(ExternalProject) + + file(STRINGS ${CMAKE_SOURCE_DIR}/tools/depends/target/googletest/Makefile VER) + string(REGEX MATCH "VERSION=[^ ]*" GTEST_VERSION "${VER}") + list(GET GTEST_VERSION 0 GTEST_VERSION) + string(SUBSTRING "${GTEST_VERSION}" 8 -1 GTEST_VERSION) + + # allow user to override the download URL with a local tarball + # needed for offline build envs + if(GTEST_URL) + get_filename_component(GTEST_URL "${GTEST_URL}" ABSOLUTE) + else() + set(GTEST_URL http://mirrors.kodi.tv/build-deps/sources/googletest-${GTEST_VERSION}.tar.gz) + endif() + + if(VERBOSE) + message(STATUS "GTEST_URL: ${GTEST_URL}") + endif() + + set(GTEST_LIBRARY ${CMAKE_BINARY_DIR}/${CORE_BUILD_DIR}/lib/libgtest.a) + set(GTEST_INCLUDE_DIR ${CMAKE_BINARY_DIR}/${CORE_BUILD_DIR}/include) + + externalproject_add(gtest + URL ${GTEST_URL} + DOWNLOAD_DIR ${CMAKE_BINARY_DIR}/${CORE_BUILD_DIR}/download + PREFIX ${CORE_BUILD_DIR}/gtest + INSTALL_DIR ${CMAKE_BINARY_DIR}/${CORE_BUILD_DIR} + CMAKE_ARGS -DCMAKE_TOOLCHAIN_FILE=${CMAKE_TOOLCHAIN_FILE} -DBUILD_GMOCK=OFF -DINSTALL_GTEST=ON -DBUILD_SHARED_LIBS=OFF -DCMAKE_INSTALL_PREFIX= -DCMAKE_INSTALL_LIBDIR=lib + BUILD_BYPRODUCTS ${GTEST_LIBRARY}) + set_target_properties(gtest PROPERTIES FOLDER "External Projects") +else() + if(PKG_CONFIG_FOUND) + pkg_check_modules(PC_GTEST gtest>=1.10.0 QUIET) + set(GTEST_VERSION ${PC_GTEST_VERSION}) + elseif(WIN32) + set(GTEST_VERSION 1.10.0) + endif() + + find_path(GTEST_INCLUDE_DIR NAMES gtest/gtest.h + PATHS ${PC_GTEST_INCLUDEDIR}) + + find_library(GTEST_LIBRARY_RELEASE NAMES gtest + PATHS ${PC_GTEST_LIBDIR}) + find_library(GTEST_LIBRARY_DEBUG NAMES gtestd + PATHS ${PC_GTEST_LIBDIR}) + + include(SelectLibraryConfigurations) + select_library_configurations(GTEST) +endif() + +include(FindPackageHandleStandardArgs) +find_package_handle_standard_args(Gtest + REQUIRED_VARS GTEST_LIBRARY GTEST_INCLUDE_DIR + VERSION_VAR GTEST_VERSION) + +if(GTEST_FOUND) + set(GTEST_LIBRARIES ${GTEST_LIBRARY}) + set(GTEST_INCLUDE_DIRS ${GTEST_INCLUDE_DIR}) +endif() + +if(NOT TARGET Gtest::Gtest) + add_library(Gtest::Gtest UNKNOWN IMPORTED) + set_target_properties(Gtest::Gtest PROPERTIES + IMPORTED_LOCATION "${GTEST_LIBRARY}" + INTERFACE_INCLUDE_DIRECTORIES "${GTEST_INCLUDE_DIR}") +endif() + +mark_as_advanced(GTEST_INCLUDE_DIR GTEST_LIBRARY) diff --git a/cmake/modules/FindIso9660pp.cmake b/cmake/modules/FindIso9660pp.cmake new file mode 100644 index 0000000..5f84b55 --- /dev/null +++ b/cmake/modules/FindIso9660pp.cmake @@ -0,0 +1,43 @@ +#.rst: +# FindIso9660pp +# -------- +# Finds the iso9660++ library +# +# This will define the following variables:: +# +# ISO9660PP_FOUND - system has iso9660++ +# ISO9660PP_INCLUDE_DIRS - the iso9660++ include directory +# ISO9660PP_LIBRARIES - the iso9660++ libraries +# ISO9660PP_DEFINITIONS - the iso9660++ definitions + +if(PKG_CONFIG_FOUND) + pkg_check_modules(PC_ISO9660PP libiso9660++>=2.1.0 QUIET) + pkg_check_modules(PC_ISO9660 libiso9660>=2.1.0 QUIET) +endif() + +find_path(ISO9660PP_INCLUDE_DIR NAMES cdio++/iso9660.hpp + PATHS ${PC_ISO9660PP_INCLUDEDIR}) + +find_library(ISO9660PP_LIBRARY NAMES libiso9660++ iso9660++ + PATHS ${PC_ISO9660PP_LIBDIR}) + +find_path(ISO9660_INCLUDE_DIR NAMES cdio/iso9660.h + PATHS ${PC_ISO9660_INCLUDEDIR}) + +find_library(ISO9660_LIBRARY NAMES libiso9660 iso9660 + PATHS ${PC_ISO9660_LIBDIR}) + +set(ISO9660PP_VERSION ${PC_ISO9660PP_VERSION}) + +include(FindPackageHandleStandardArgs) +find_package_handle_standard_args(Iso9660pp + REQUIRED_VARS ISO9660PP_LIBRARY ISO9660PP_INCLUDE_DIR ISO9660_LIBRARY ISO9660_INCLUDE_DIR + VERSION_VAR ISO9660PP_VERSION) + +if(ISO9660PP_FOUND) + set(ISO9660PP_LIBRARIES ${ISO9660PP_LIBRARY} ${ISO9660_LIBRARY}) + set(ISO9660PP_INCLUDE_DIRS ${ISO9660PP_INCLUDE_DIR} ${ISO9660_INCLUDE_DIR}) + set(ISO9660PP_DEFINITIONS -DHAS_ISO9660PP=1) +endif() + +mark_as_advanced(ISO9660PP_INCLUDE_DIR ISO9660PP_LIBRARY ISO9660_INCLUDE_DIR ISO9660_LIBRARY) diff --git a/cmake/modules/FindLibDRM.cmake b/cmake/modules/FindLibDRM.cmake index 4b39de3..0d680f2 100644 --- a/cmake/modules/FindLibDRM.cmake +++ b/cmake/modules/FindLibDRM.cmake @@ -8,6 +8,7 @@ # LIBDRM_FOUND - system has LibDRM # LIBDRM_INCLUDE_DIRS - the LibDRM include directory # LIBDRM_LIBRARIES - the LibDRM libraries +# LIBDRM_DEFINITIONS - the LibDRM definitions # # and the following imported targets:: # @@ -30,9 +31,23 @@ find_package_handle_standard_args(LibDRM REQUIRED_VARS LIBDRM_LIBRARY LIBDRM_INCLUDE_DIR VERSION_VAR LIBDRM_VERSION) +include(CheckCSourceCompiles) +set(CMAKE_REQUIRED_INCLUDES ${LIBDRM_INCLUDE_DIR}) +check_c_source_compiles("#include + + int main() + { + struct hdr_output_metadata test; + return test.metadata_type; + } + " LIBDRM_HAS_HDR_OUTPUT_METADATA) + if(LIBDRM_FOUND) set(LIBDRM_LIBRARIES ${LIBDRM_LIBRARY}) set(LIBDRM_INCLUDE_DIRS ${LIBDRM_INCLUDE_DIR}) + if(LIBDRM_HAS_HDR_OUTPUT_METADATA) + set(LIBDRM_DEFINITIONS -DHAVE_HDR_OUTPUT_METADATA=1) + endif() if(NOT TARGET LIBDRM::LIBDRM) add_library(LIBDRM::LIBDRM UNKNOWN IMPORTED) diff --git a/cmake/modules/FindLibDvd.cmake b/cmake/modules/FindLibDvd.cmake index bd08b94..44e7e92 100644 --- a/cmake/modules/FindLibDvd.cmake +++ b/cmake/modules/FindLibDvd.cmake @@ -89,6 +89,8 @@ else() set(HOST_ARCH aarch64-linux-android) elseif(ARCH STREQUAL i486-linux) set(HOST_ARCH i686-linux-android) + elseif(ARCH STREQUAL x86_64) + set(HOST_ARCH x86_64-linux-android) endif() elseif(CORE_SYSTEM_NAME STREQUAL windowsstore) set(LIBDVD_ADDITIONAL_ARGS "-DCMAKE_SYSTEM_NAME=${CMAKE_SYSTEM_NAME}" "-DCMAKE_SYSTEM_VERSION=${CMAKE_SYSTEM_VERSION}") @@ -233,6 +235,7 @@ else() set(LIBDVD_TARGET_DIR dlls) endif() copy_file_to_buildtree(${CMAKE_BINARY_DIR}/${CORE_BUILD_DIR}/libdvd/bin/libdvdnav.dll DIRECTORY ${LIBDVD_TARGET_DIR}) + add_dependencies(export-files dvdnav) endif() set(LIBDVD_INCLUDE_DIRS ${CMAKE_BINARY_DIR}/${CORE_BUILD_DIR}/libdvd/include) diff --git a/cmake/modules/FindLibUSB.cmake b/cmake/modules/FindLibUSB.cmake index 17cf6ec..7bf3a92 100644 --- a/cmake/modules/FindLibUSB.cmake +++ b/cmake/modules/FindLibUSB.cmake @@ -24,7 +24,7 @@ find_library(LIBUSB_LIBRARY NAMES usb set(LIBUSB_VERSION ${PC_LIBUSB_VERSION}) include(FindPackageHandleStandardArgs) -find_package_handle_standard_args(LIBUSB +find_package_handle_standard_args(LibUSB REQUIRED_VARS LIBUSB_LIBRARY LIBUSB_INCLUDE_DIR VERSION_VAR LIBUSB_VERSION) diff --git a/cmake/modules/FindMariaDBClient.cmake b/cmake/modules/FindMariaDBClient.cmake index 7530ab5..374aeeb 100644 --- a/cmake/modules/FindMariaDBClient.cmake +++ b/cmake/modules/FindMariaDBClient.cmake @@ -28,11 +28,11 @@ endif() find_path(MARIADBCLIENT_INCLUDE_DIR NAMES mariadb/mysql.h mariadb/server/mysql.h PATHS ${PC_MARIADBCLIENT_INCLUDEDIR}) -find_library(MARIADBCLIENT_LIBRARY_RELEASE NAMES mariadbclient mariadb +find_library(MARIADBCLIENT_LIBRARY_RELEASE NAMES mariadbclient mariadb libmariadb PATHS ${PC_MARIADBCLIENT_LIBDIR} PATH_SUFFIXES mariadb ${EXTRA_FIND_ARGS}) -find_library(MARIADBCLIENT_LIBRARY_DEBUG NAMES mariadbclient mariadb +find_library(MARIADBCLIENT_LIBRARY_DEBUG NAMES mariadbclient mariadb libmariadbd PATHS ${PC_MARIADBCLIENT_LIBDIR} PATH_SUFFIXES mariadb ${EXTRA_FIND_ARGS}) diff --git a/cmake/modules/FindNFS.cmake b/cmake/modules/FindNFS.cmake index c2414a1..d62d4e6 100644 --- a/cmake/modules/FindNFS.cmake +++ b/cmake/modules/FindNFS.cmake @@ -36,6 +36,44 @@ if(NFS_FOUND) set(NFS_INCLUDE_DIRS ${NFS_INCLUDE_DIR}) set(NFS_DEFINITIONS -DHAS_FILESYSTEM_NFS=1) + set(CMAKE_REQUIRED_INCLUDES "${NFS_INCLUDE_DIR}") + set(CMAKE_REQUIRED_LIBRARIES ${NFS_LIBRARY}) + if(CMAKE_SYSTEM_NAME MATCHES "Windows") + set(NFS_CXX_INCLUDE "#include ") + set(CMAKE_REQUIRED_LIBRARIES ${CMAKE_REQUIRED_LIBRARIES} "ws2_32.lib") + endif() + +# Check for nfs_set_timeout + check_cxx_source_compiles(" + ${NFS_CXX_INCLUDE} + #include + int main() + { + nfs_set_timeout(NULL, 0); + } + " NFS_SET_TIMEOUT) + + if(NFS_SET_TIMEOUT) + list(APPEND NFS_DEFINITIONS -DHAS_NFS_SET_TIMEOUT) + endif() + +# Check for mount_getexports_timeout + check_cxx_source_compiles(" + ${NFS_CXX_INCLUDE} + #include + int main() + { + mount_getexports_timeout(NULL, 0); + } + " NFS_MOUNT_GETEXPORTS_TIMEOUT) + + if(NFS_MOUNT_GETEXPORTS_TIMEOUT) + list(APPEND NFS_DEFINITIONS -DHAS_NFS_MOUNT_GETEXPORTS_TIMEOUT) + endif() + + unset(CMAKE_REQUIRED_INCLUDES) + unset(CMAKE_REQUIRED_LIBRARIES) + if(NOT TARGET NFS::NFS) add_library(NFS::NFS UNKNOWN IMPORTED) if(NFS_LIBRARY) diff --git a/cmake/modules/FindOpenGLES.cmake b/cmake/modules/FindOpenGLES.cmake index 0191d9e..43a1367 100644 --- a/cmake/modules/FindOpenGLES.cmake +++ b/cmake/modules/FindOpenGLES.cmake @@ -18,7 +18,7 @@ if(PKG_CONFIG_FOUND) pkg_check_modules(PC_OPENGLES ${_brcmprefix}glesv2 QUIET) endif() -if(NOT CORE_SYSTEM_NAME STREQUAL ios) +if(NOT CORE_SYSTEM_NAME STREQUAL darwin_embedded) find_path(OPENGLES_INCLUDE_DIR GLES2/gl2.h PATHS ${PC_OPENGLES_INCLUDEDIR}) find_library(OPENGLES_gl_LIBRARY NAMES ${_brcmprefix}GLESv2 diff --git a/cmake/modules/FindPlist.cmake b/cmake/modules/FindPlist.cmake index cd143e9..2c86b74 100644 --- a/cmake/modules/FindPlist.cmake +++ b/cmake/modules/FindPlist.cmake @@ -23,20 +23,13 @@ find_path(PLIST_INCLUDE_DIR plist/plist.h set(PLIST_VERSION ${PC_PLIST_VERSION}) +find_library(PLIST_LIBRARY NAMES plist libplist + PATHS ${PC_PLIST_LIBDIR}) + include(FindPackageHandleStandardArgs) -if(NOT WIN32) - find_library(PLIST_LIBRARY NAMES plist - PATHS ${PC_PLIST_LIBDIR}) - - find_package_handle_standard_args(Plist - REQUIRED_VARS PLIST_LIBRARY PLIST_INCLUDE_DIR - VERSION_VAR PLIST_VERSION) -else() - # Dynamically loaded DLL - find_package_handle_standard_args(Plist - REQUIRED_VARS PLIST_INCLUDE_DIR - VERSION_VAR PLIST_VERSION) -endif() +find_package_handle_standard_args(Plist + REQUIRED_VARS PLIST_LIBRARY PLIST_INCLUDE_DIR + VERSION_VAR PLIST_VERSION) if(PLIST_FOUND) set(PLIST_LIBRARIES ${PLIST_LIBRARY}) diff --git a/cmake/modules/FindPython.cmake b/cmake/modules/FindPython.cmake index 213b17c..e39d4e5 100644 --- a/cmake/modules/FindPython.cmake +++ b/cmake/modules/FindPython.cmake @@ -6,12 +6,12 @@ # PYTHON_LIBRARIES - The python libraries if(PKG_CONFIG_FOUND) - pkg_check_modules(PC_PYTHON python>=2.7 QUIET) + pkg_check_modules(PC_PYTHON python3>=3.5 QUIET) endif() -find_program(PYTHON_EXECUTABLE python ONLY_CMAKE_FIND_ROOT_PATH) -find_library(PYTHON_LIBRARY NAMES python2.7 PATHS ${PC_PYTHON_LIBDIR}) -find_path(PYTHON_INCLUDE_DIR NAMES Python.h PATHS ${PC_PYTHON_INCLUDE_DIRS} ${DEPENDS_PATH}/include/python2.7) +find_program(PYTHON_EXECUTABLE python3 ONLY_CMAKE_FIND_ROOT_PATH) +find_library(PYTHON_LIBRARY NAMES python3.8 python3.7 python3.6 python3.5 PATHS ${PC_PYTHON_LIBDIR}) +find_path(PYTHON_INCLUDE_DIR NAMES Python.h PATHS ${PC_PYTHON_INCLUDE_DIRS} PATH_SUFFIXES python3.8 python3.7 python3.6 python3.5) if(KODI_DEPENDSBUILD) find_library(FFI_LIBRARY ffi REQUIRED) @@ -25,7 +25,7 @@ if(KODI_DEPENDSBUILD) set(PYTHON_LIBRARIES ${PYTHON_LIBRARY} ${FFI_LIBRARY} ${EXPAT_LIBRARY} ${INTL_LIBRARY} ${GMP_LIBRARY} ${PYTHON_DEP_LIBRARIES}) else() - find_package(PythonLibs 2.7 REQUIRED) + find_package(PythonLibs 3.5 REQUIRED) list(APPEND PYTHON_LIBRARIES ${PC_PYTHON_STATIC_LIBRARIES}) endif() diff --git a/cmake/modules/FindSSE.cmake b/cmake/modules/FindSSE.cmake index 08e3630..d9d5c7a 100644 --- a/cmake/modules/FindSSE.cmake +++ b/cmake/modules/FindSSE.cmake @@ -141,6 +141,7 @@ include(FindPackageHandleStandardArgs) find_package_handle_standard_args(SSE REQUIRED_VARS _SSE_TRUE _SSE_OK FAIL_MESSAGE "Could not find hardware support for SSE") +set(FPHSA_NAME_MISMATCHED ON) find_package_handle_standard_args(SSE2 REQUIRED_VARS _SSE2_TRUE _SSE2_OK FAIL_MESSAGE "Could not find hardware support for SSE2") @@ -162,6 +163,7 @@ find_package_handle_standard_args(AVX find_package_handle_standard_args(AVX2 REQUIRED_VARS _AVX2_TRUE _AVX2_OK FAIL_MESSAGE "Could not find hardware support for AVX2") +unset(FPHSA_NAME_MISMATCHED) mark_as_advanced(SSE2_FOUND SSE3_FOUND SSSE3_FOUND SSE4_1_FOUND SSE4_2_FOUND AVX_FOUND AVX2_FOUND) diff --git a/cmake/modules/FindSWIG.cmake b/cmake/modules/FindSWIG.cmake index f9b27c2..fba544b 100644 --- a/cmake/modules/FindSWIG.cmake +++ b/cmake/modules/FindSWIG.cmake @@ -8,7 +8,7 @@ # SWIG_FOUND - system has SWIG # SWIG_EXECUTABLE - the SWIG executable -find_program(SWIG_EXECUTABLE NAMES swig3.0 swig2.0 swig +find_program(SWIG_EXECUTABLE NAMES swig4.0 swig3.0 swig2.0 swig PATH_SUFFIXES swig) if(SWIG_EXECUTABLE) execute_process(COMMAND ${SWIG_EXECUTABLE} -swiglib diff --git a/cmake/modules/FindShairplay.cmake b/cmake/modules/FindShairplay.cmake index bbb3372..506cffd 100644 --- a/cmake/modules/FindShairplay.cmake +++ b/cmake/modules/FindShairplay.cmake @@ -17,32 +17,26 @@ find_path(SHAIRPLAY_INCLUDE_DIR shairplay/raop.h) include(FindPackageHandleStandardArgs) -if(NOT WIN32) - find_library(SHAIRPLAY_LIBRARY NAMES shairplay) - - if(SHAIRPLAY_INCLUDE_DIR AND SHAIRPLAY_LIBRARY) - include(CheckCSourceCompiles) - set(CMAKE_REQUIRED_INCLUDES ${SHAIRPLAY_INCLUDE_DIRS}) - set(CMAKE_REQUIRED_LIBRARIES ${SHAIRPLAY_LIBRARIES}) - check_c_source_compiles("#include - - int main() - { - struct raop_callbacks_s foo; - foo.cls; - return 0; - } - " HAVE_SHAIRPLAY_CALLBACK_CLS) - endif() - - find_package_handle_standard_args(Shairplay - REQUIRED_VARS SHAIRPLAY_LIBRARY SHAIRPLAY_INCLUDE_DIR HAVE_SHAIRPLAY_CALLBACK_CLS) -else() - # Dynamically loaded DLL - find_package_handle_standard_args(Shairplay - REQUIRED_VARS SHAIRPLAY_INCLUDE_DIR) +find_library(SHAIRPLAY_LIBRARY NAMES shairplay libshairplay) + +if(SHAIRPLAY_INCLUDE_DIR AND SHAIRPLAY_LIBRARY) + include(CheckCSourceCompiles) + set(CMAKE_REQUIRED_INCLUDES ${SHAIRPLAY_INCLUDE_DIR}) + set(CMAKE_REQUIRED_LIBRARIES ${SHAIRPLAY_LIBRARIES}) + check_c_source_compiles("#include + + int main() + { + struct raop_callbacks_s foo; + foo.cls; + return 0; + } + " HAVE_SHAIRPLAY_CALLBACK_CLS) endif() +find_package_handle_standard_args(Shairplay + REQUIRED_VARS SHAIRPLAY_LIBRARY SHAIRPLAY_INCLUDE_DIR HAVE_SHAIRPLAY_CALLBACK_CLS) + if(SHAIRPLAY_FOUND) set(SHAIRPLAY_LIBRARIES ${SHAIRPLAY_LIBRARY}) set(SHAIRPLAY_INCLUDE_DIRS ${SHAIRPLAY_INCLUDE_DIR}) diff --git a/cmake/modules/FindSmbClient.cmake b/cmake/modules/FindSmbClient.cmake index 70492ff..fde48ab 100644 --- a/cmake/modules/FindSmbClient.cmake +++ b/cmake/modules/FindSmbClient.cmake @@ -32,6 +32,9 @@ find_package_handle_standard_args(SmbClient if(SMBCLIENT_FOUND) set(SMBCLIENT_LIBRARIES ${SMBCLIENT_LIBRARY}) + if(${SMBCLIENT_LIBRARY} MATCHES ".+\.a$" AND PC_SMBCLIENT_STATIC_LIBRARIES) + list(APPEND SMBCLIENT_LIBRARIES ${PC_SMBCLIENT_STATIC_LIBRARIES}) + endif() set(SMBCLIENT_INCLUDE_DIRS ${SMBCLIENT_INCLUDE_DIR}) set(SMBCLIENT_DEFINITIONS -DHAS_FILESYSTEM_SMB=1) diff --git a/cmake/modules/FindSpdlog.cmake b/cmake/modules/FindSpdlog.cmake new file mode 100644 index 0000000..270e486 --- /dev/null +++ b/cmake/modules/FindSpdlog.cmake @@ -0,0 +1,107 @@ +# FindSpdlog +# ------- +# Finds the Spdlog library +# +# This will define the following variables: +# +# SPDLOG_FOUND - system has Spdlog +# SPDLOG_INCLUDE_DIRS - the Spdlog include directory +# SPDLOG_LIBRARIES - the Spdlog libraries +# SPDLOG_DEFINITIONS - the Spdlog compile definitions +# +# and the following imported targets: +# +# Spdlog::Spdlog - The Spdlog library + +if(ENABLE_INTERNAL_SPDLOG) + include(ExternalProject) + file(STRINGS ${CMAKE_SOURCE_DIR}/tools/depends/target/libspdlog/Makefile VER REGEX "^[ ]*VERSION[ ]*=.+$") + string(REGEX REPLACE "^[ ]*VERSION[ ]*=[ ]*" "" SPDLOG_VERSION "${VER}") + + # allow user to override the download URL with a local tarball + # needed for offline build envs + if(SPDLOG_URL) + get_filename_component(SPDLOG_URL "${SPDLOG_URL}" ABSOLUTE) + else() + set(SPDLOG_URL http://mirrors.kodi.tv/build-deps/sources/spdlog-${SPDLOG_VERSION}.tar.gz) + endif() + if(VERBOSE) + message(STATUS "SPDLOG_URL: ${SPDLOG_URL}") + endif() + + if(APPLE) + set(EXTRA_ARGS "-DCMAKE_OSX_ARCHITECTURES=${CMAKE_OSX_ARCHITECTURES}") + endif() + + set(SPDLOG_LIBRARY ${CMAKE_BINARY_DIR}/${CORE_BUILD_DIR}/lib/libspdlog.a) + set(SPDLOG_INCLUDE_DIR ${CMAKE_BINARY_DIR}/${CORE_BUILD_DIR}/include) + + externalproject_add(spdlog + URL ${SPDLOG_URL} + DOWNLOAD_DIR ${CMAKE_BINARY_DIR}/${CORE_BUILD_DIR}/download + PATCH_COMMAND patch -p1 -i ${CMAKE_SOURCE_DIR}/tools/depends/target/libspdlog/0001-fix_fmt_version.patch + PREFIX ${CORE_BUILD_DIR}/spdlog + CMAKE_ARGS -DCMAKE_INSTALL_PREFIX=${CMAKE_BINARY_DIR}/${CORE_BUILD_DIR} + -DCMAKE_CXX_EXTENSIONS=${CMAKE_CXX_EXTENSIONS} + -DCMAKE_CXX_STANDARD=${CMAKE_CXX_STANDARD} + -DCMAKE_TOOLCHAIN_FILE=${CMAKE_TOOLCHAIN_FILE} + -DCMAKE_INSTALL_LIBDIR=lib + -DSPDLOG_BUILD_EXAMPLE=OFF + -DSPDLOG_BUILD_TESTS=OFF + -DSPDLOG_BUILD_BENCH=OFF + -DSPDLOG_FMT_EXTERNAL=ON + -DCMAKE_PREFIX_PATH=${CMAKE_BINARY_DIR}/${CORE_BUILD_DIR} + "${EXTRA_ARGS}" + BUILD_BYPRODUCTS ${SPDLOG_LIBRARY}) + set_target_properties(spdlog PROPERTIES FOLDER "External Projects") + + if(ENABLE_INTERNAL_FMT) + add_dependencies(spdlog fmt) + endif() +else() + find_package(spdlog 1.5.0 CONFIG REQUIRED QUIET) + + if(PKG_CONFIG_FOUND) + pkg_check_modules(PC_SPDLOG spdlog QUIET) + set(SPDLOG_VERSION ${PC_SPDLOG_VERSION}) + endif() + + find_path(SPDLOG_INCLUDE_DIR NAMES spdlog/spdlog.h + PATHS ${PC_SPDLOG_INCLUDEDIR}) + + find_library(SPDLOG_LIBRARY_RELEASE NAMES spdlog + PATHS ${PC_SPDLOG_LIBDIR}) + find_library(SPDLOG_LIBRARY_DEBUG NAMES spdlogd + PATHS ${PC_SPDLOG_LIBDIR}) + + include(SelectLibraryConfigurations) + select_library_configurations(SPDLOG) +endif() + +include(FindPackageHandleStandardArgs) +find_package_handle_standard_args(Spdlog + REQUIRED_VARS SPDLOG_LIBRARY SPDLOG_INCLUDE_DIR + VERSION_VAR SPDLOG_VERSION) + +if(SPDLOG_FOUND) + set(SPDLOG_LIBRARIES ${SPDLOG_LIBRARY}) + set(SPDLOG_INCLUDE_DIRS ${SPDLOG_INCLUDE_DIR}) + set(SPDLOG_DEFINITIONS -DSPDLOG_FMT_EXTERNAL + -DSPDLOG_DEBUG_ON + -DSPDLOG_NO_ATOMIC_LEVELS + -DSPDLOG_ENABLE_PATTERN_PADDING) + if(WIN32) + list(APPEND SPDLOG_DEFINITIONS -DSPDLOG_WCHAR_FILENAMES + -DSPDLOG_WCHAR_TO_UTF8_SUPPORT) + endif() + + if(NOT TARGET Spdlog::Spdlog) + add_library(Spdlog::Spdlog UNKNOWN IMPORTED) + set_target_properties(Spdlog::Spdlog PROPERTIES + IMPORTED_LOCATION "${SPDLOG_LIBRARY}" + INTERFACE_INCLUDE_DIRECTORIES "${SPDLOG_INCLUDE_DIR}" + INTERFACE_COMPILE_DEFINITIONS "${SPDLOG_DEFINITIONS}") + endif() +endif() + +mark_as_advanced(SPDLOG_INCLUDE_DIR SPDLOG_LIBRARY) diff --git a/cmake/modules/FindUdfread.cmake b/cmake/modules/FindUdfread.cmake new file mode 100644 index 0000000..20fb322 --- /dev/null +++ b/cmake/modules/FindUdfread.cmake @@ -0,0 +1,78 @@ +#.rst: +# FindUdfread +# -------- +# Finds the udfread library +# +# This will define the following variables:: +# +# UDFREAD_FOUND - system has udfread +# UDFREAD_INCLUDE_DIRS - the udfread include directory +# UDFREAD_LIBRARIES - the udfread libraries +# UDFREAD_DEFINITIONS - the udfread definitions + +if(PKG_CONFIG_FOUND) + pkg_check_modules(PC_UDFREAD udfread>=1.0.0 QUIET) +endif() + +find_path(UDFREAD_INCLUDE_DIR NAMES udfread/udfread.h + PATHS ${PC_UDFREAD_INCLUDEDIR}) + +find_library(UDFREAD_LIBRARY NAMES udfread libudfread + PATHS ${PC_UDFREAD_LIBDIR}) + +set(UDFREAD_VERSION ${PC_UDFREAD_VERSION}) + +if(ENABLE_INTERNAL_UDFREAD) + include(ExternalProject) + + # Extract version + file(STRINGS ${CMAKE_SOURCE_DIR}/tools/depends/target/libudfread/UDFREAD-VERSION VER) + + string(REGEX MATCH "VERSION=[^ ]*$.*" UDFREAD_VER "${VER}") + list(GET UDFREAD_VER 0 UDFREAD_VER) + string(SUBSTRING "${UDFREAD_VER}" 8 -1 UDFREAD_VER) + + # allow user to override the download URL with a local tarball + # needed for offline build envs + if(UDFREAD_URL) + get_filename_component(UDFREAD_URL "${UDFREAD_URL}" ABSOLUTE) + else() + set(UDFREAD_URL http://mirrors.kodi.tv/build-deps/sources/libudfread-${UDFREAD_VER}.tar.gz) + endif() + + if(VERBOSE) + message(STATUS "UDFREAD_URL: ${UDFREAD_URL}") + endif() + + set(UDFREAD_LIBRARY ${CMAKE_BINARY_DIR}/${CORE_BUILD_DIR}/lib/libudfread.a) + set(UDFREAD_INCLUDE_DIR ${CMAKE_BINARY_DIR}/${CORE_BUILD_DIR}/include) + set(UDFREAD_VERSION ${UDFREAD_VER}) + + externalproject_add(udfread + URL ${UDFREAD_URL} + DOWNLOAD_NAME libudfread-${UDFREAD_VER}.tar.gz + DOWNLOAD_DIR ${CMAKE_BINARY_DIR}/${CORE_BUILD_DIR}/download + PREFIX ${CORE_BUILD_DIR}/libudfread + CONFIGURE_COMMAND autoreconf -vif && + ./configure + --enable-static + --disable-shared + --prefix=${CMAKE_BINARY_DIR}/${CORE_BUILD_DIR} + BUILD_BYPRODUCTS ${UDFREAD_LIBRARY} + BUILD_IN_SOURCE 1) + + set_target_properties(udfread PROPERTIES FOLDER "External Projects") +endif() + +include(FindPackageHandleStandardArgs) +find_package_handle_standard_args(Udfread + REQUIRED_VARS UDFREAD_LIBRARY UDFREAD_INCLUDE_DIR + VERSION_VAR UDFREAD_VERSION) + +if(UDFREAD_FOUND) + set(UDFREAD_LIBRARIES ${UDFREAD_LIBRARY}) + set(UDFREAD_INCLUDE_DIRS ${UDFREAD_INCLUDE_DIR}) + set(UDFREAD_DEFINITIONS -DHAS_UDFREAD=1) +endif() + +mark_as_advanced(UDFREAD_INCLUDE_DIR UDFREAD_LIBRARY) diff --git a/cmake/platform/android/defines.txt b/cmake/platform/android/defines.txt index fa103d0..4b70e59 100644 --- a/cmake/platform/android/defines.txt +++ b/cmake/platform/android/defines.txt @@ -1 +1 @@ --DTARGET_POSIX -DTARGET_LINUX -D_LINUX -DTARGET_ANDROID +-DTARGET_POSIX -DTARGET_LINUX -DTARGET_ANDROID diff --git a/cmake/platform/darwin_embedded/defines.txt b/cmake/platform/darwin_embedded/defines.txt new file mode 100644 index 0000000..603d749 --- /dev/null +++ b/cmake/platform/darwin_embedded/defines.txt @@ -0,0 +1 @@ +-DTARGET_POSIX -DTARGET_DARWIN -DTARGET_DARWIN_EMBEDDED diff --git a/cmake/platform/darwin_embedded/ios.cmake b/cmake/platform/darwin_embedded/ios.cmake new file mode 100644 index 0000000..4c377b7 --- /dev/null +++ b/cmake/platform/darwin_embedded/ios.cmake @@ -0,0 +1,3 @@ +set(PLATFORM_REQUIRED_DEPS OpenGLES) +set(APP_RENDER_SYSTEM gles) +list(APPEND PLATFORM_DEFINES -DTARGET_DARWIN_IOS) diff --git a/cmake/platform/darwin_embedded/tvos.cmake b/cmake/platform/darwin_embedded/tvos.cmake new file mode 100644 index 0000000..b29ed32 --- /dev/null +++ b/cmake/platform/darwin_embedded/tvos.cmake @@ -0,0 +1,3 @@ +set(PLATFORM_REQUIRED_DEPS OpenGLES) +set(APP_RENDER_SYSTEM gles) +list(APPEND PLATFORM_DEFINES -DTARGET_DARWIN_TVOS) diff --git a/cmake/platform/freebsd/defines.txt b/cmake/platform/freebsd/defines.txt index 9483597..bd23e57 100644 --- a/cmake/platform/freebsd/defines.txt +++ b/cmake/platform/freebsd/defines.txt @@ -1 +1 @@ --DTARGET_POSIX -DTARGET_FREEBSD -D_LINUX +-DTARGET_POSIX -DTARGET_FREEBSD diff --git a/cmake/platform/freebsd/gbm.cmake b/cmake/platform/freebsd/gbm.cmake index b273a06..2d20731 100644 --- a/cmake/platform/freebsd/gbm.cmake +++ b/cmake/platform/freebsd/gbm.cmake @@ -1 +1,2 @@ include(cmake/platform/linux/gbm.cmake) +list(APPEND PLATFORM_REQUIRED_DEPS EpollShim) diff --git a/cmake/platform/ios/defines.txt b/cmake/platform/ios/defines.txt deleted file mode 100644 index d0989ea..0000000 --- a/cmake/platform/ios/defines.txt +++ /dev/null @@ -1 +0,0 @@ --DTARGET_POSIX -DTARGET_DARWIN -DTARGET_DARWIN_IOS -D_LINUX diff --git a/cmake/platform/ios/ios.cmake b/cmake/platform/ios/ios.cmake deleted file mode 100644 index 75c9b7b..0000000 --- a/cmake/platform/ios/ios.cmake +++ /dev/null @@ -1,2 +0,0 @@ -set(PLATFORM_REQUIRED_DEPS OpenGLES) -set(APP_RENDER_SYSTEM gles) diff --git a/cmake/platform/linux/aml.cmake b/cmake/platform/linux/aml.cmake deleted file mode 100644 index a151226..0000000 --- a/cmake/platform/linux/aml.cmake +++ /dev/null @@ -1,3 +0,0 @@ -set(PLATFORM_REQUIRED_DEPS OpenGLES AML EGL LibInput Xkbcommon) -set(APP_RENDER_SYSTEM gles) -list(APPEND PLATFORM_DEFINES -DMESA_EGL_NO_X11_HEADERS) diff --git a/cmake/platform/linux/defines.txt b/cmake/platform/linux/defines.txt index 3fe9c5c..88d2e6e 100644 --- a/cmake/platform/linux/defines.txt +++ b/cmake/platform/linux/defines.txt @@ -1 +1 @@ --DTARGET_POSIX -DTARGET_LINUX -D_LINUX -fPIC +-DTARGET_POSIX -DTARGET_LINUX -fPIC diff --git a/cmake/platform/linux/gbm.cmake b/cmake/platform/linux/gbm.cmake index e5b44ad..75b23f3 100644 --- a/cmake/platform/linux/gbm.cmake +++ b/cmake/platform/linux/gbm.cmake @@ -14,4 +14,4 @@ else() endif() # __GBM__ is needed by eglplatform.h in case it is included before gbm.h -list(APPEND PLATFORM_DEFINES -DMESA_EGL_NO_X11_HEADERS -D__GBM__=1 -DPLATFORM_SETTINGS_FILE=gbm.xml) +list(APPEND PLATFORM_DEFINES -DMESA_EGL_NO_X11_HEADERS -DEGL_NO_X11 -D__GBM__=1 -DPLATFORM_SETTINGS_FILE=gbm.xml) diff --git a/cmake/platform/linux/x11.cmake b/cmake/platform/linux/x11.cmake index 72d9640..5d7f3d4 100644 --- a/cmake/platform/linux/x11.cmake +++ b/cmake/platform/linux/x11.cmake @@ -1,4 +1,17 @@ -set(PLATFORM_REQUIRED_DEPS OpenGl EGL X XRandR LibDRM) -set(PLATFORM_OPTIONAL_DEPS VAAPI VDPAU GLX) -set(APP_RENDER_SYSTEM gl) +set(PLATFORM_REQUIRED_DEPS EGL X XRandR LibDRM) +set(PLATFORM_OPTIONAL_DEPS VAAPI) + +set(X11_RENDER_SYSTEM "" CACHE STRING "Render system to use with X11: \"gl\" or \"gles\"") + +if(X11_RENDER_SYSTEM STREQUAL "gl") + list(APPEND PLATFORM_REQUIRED_DEPS OpenGl) + list(APPEND PLATFORM_OPTIONAL_DEPS GLX VDPAU) + set(APP_RENDER_SYSTEM gl) +elseif(X11_RENDER_SYSTEM STREQUAL "gles") + list(APPEND PLATFORM_REQUIRED_DEPS OpenGLES) + set(APP_RENDER_SYSTEM gles) +else() + message(SEND_ERROR "You need to decide whether you want to use GL- or GLES-based rendering in combination with the X11 windowing system. Please set X11_RENDER_SYSTEM to either \"gl\" or \"gles\". For normal desktop systems, you will usually want to use \"gl\".") +endif() + list(APPEND PLATFORM_DEFINES -DPLATFORM_SETTINGS_FILE=x11.xml) \ No newline at end of file diff --git a/cmake/platform/osx/defines.txt b/cmake/platform/osx/defines.txt index 33b009e..8ebb2ba 100644 --- a/cmake/platform/osx/defines.txt +++ b/cmake/platform/osx/defines.txt @@ -1 +1 @@ --DTARGET_POSIX -DTARGET_DARWIN -DTARGET_DARWIN_OSX -D_LINUX +-DTARGET_POSIX -DTARGET_DARWIN -DTARGET_DARWIN_OSX diff --git a/cmake/scripts/android/ArchSetup.cmake b/cmake/scripts/android/ArchSetup.cmake index 69bb88d..1e529de 100644 --- a/cmake/scripts/android/ArchSetup.cmake +++ b/cmake/scripts/android/ArchSetup.cmake @@ -2,7 +2,7 @@ if(NOT CMAKE_TOOLCHAIN_FILE) message(FATAL_ERROR "CMAKE_TOOLCHAIN_FILE required for android. See ${CMAKE_SOURCE_DIR}/cmake/README.md") endif() -set(ARCH_DEFINES -DTARGET_POSIX -DTARGET_LINUX -D_LINUX -DTARGET_ANDROID) +set(ARCH_DEFINES -DTARGET_POSIX -DTARGET_LINUX -DTARGET_ANDROID) set(SYSTEM_DEFINES -D__STDC_CONSTANT_MACROS -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64 -D__USE_FILE_OFFSET64=1) @@ -10,6 +10,7 @@ set(SYSTEM_DEFINES -D__STDC_CONSTANT_MACROS -D_LARGEFILE64_SOURCE set(CORE_MAIN_SOURCE ${CMAKE_SOURCE_DIR}/xbmc/platform/android/activity/XBMCApp.cpp) set(PLATFORM_DIR platform/linux) +set(PLATFORMDEFS_DIR platform/posix) if(WITH_ARCH) set(ARCH ${WITH_ARCH}) else() @@ -26,16 +27,18 @@ else() elseif(CPU STREQUAL i686) set(ARCH i486-linux) set(NEON False) + elseif(CPU STREQUAL x86_64) + set(ARCH x86_64) + set(NEON False) else() message(SEND_ERROR "Unknown CPU: ${CPU}") endif() endif() # Additional SYSTEM_DEFINES -list(APPEND SYSTEM_DEFINES -DHAS_ZEROCONF -DHAS_LINUX_NETWORK) +list(APPEND SYSTEM_DEFINES -DHAS_ZEROCONF) set(ENABLE_X11 OFF CACHE BOOL "" FORCE) -set(ENABLE_AML OFF CACHE BOOL "" FORCE) set(ENABLE_OPTICAL OFF CACHE BOOL "" FORCE) set(ENABLE_MDNS OFF CACHE BOOL "" FORCE) diff --git a/cmake/scripts/android/Install.cmake b/cmake/scripts/android/Install.cmake index a121295..5b7b411 100644 --- a/cmake/scripts/android/Install.cmake +++ b/cmake/scripts/android/Install.cmake @@ -107,7 +107,7 @@ add_custom_target(bundle ${CMAKE_BINARY_DIR}/tools/android/packaging/media COMMAND ${CMAKE_COMMAND} -E copy_directory ${CMAKE_SOURCE_DIR}/tools/android/packaging/xbmc/res ${CMAKE_BINARY_DIR}/tools/android/packaging/xbmc/res - COMMAND ${CMAKE_COMMAND} -E copy_directory ${DEPENDS_PATH}/lib/python2.7 ${libdir}/python2.7 + COMMAND ${CMAKE_COMMAND} -E copy_directory ${DEPENDS_PATH}/lib/python${PYTHON_VERSION} ${libdir}/python${PYTHON_VERSION} COMMAND ${CMAKE_COMMAND} -E copy_directory ${DEPENDS_PATH}/share/${APP_NAME_LC} ${datadir}/${APP_NAME_LC} COMMAND ${CMAKE_COMMAND} -E copy $ ${libdir}/${APP_NAME_LC}/$) @@ -153,13 +153,12 @@ foreach(lib IN LISTS required_dyload dyload_optional ITEMS Shairplay) endif() endforeach() add_bundle_file(${ASS_LIBRARY} ${libdir} "") -add_bundle_file(${BLURAY_LIBRARY} ${libdir} "") +add_bundle_file(${SHAIRPLAY_LIBRARY} ${libdir} "") add_bundle_file(${SMBCLIENT_LIBRARY} ${libdir} "") # Main targets from Makefile.in if(CPU MATCHES i686) set(CPU x86) - set(ARCH x86) endif() foreach(target apk obb apk-unsigned apk-obb apk-obb-unsigned apk-noobb apk-clean apk-sign) add_custom_target(${target} @@ -168,7 +167,6 @@ foreach(target apk obb apk-unsigned apk-obb apk-obb-unsigned apk-noobb apk-clean CMAKE_SOURCE_DIR=${CMAKE_SOURCE_DIR} CC=${CMAKE_C_COMPILER} CPU=${CPU} - ARCH=${ARCH} HOST=${HOST} TOOLCHAIN=${TOOLCHAIN} PREFIX=${prefix} diff --git a/cmake/scripts/common/AddonHelpers.cmake b/cmake/scripts/common/AddonHelpers.cmake index 2f3f302..c541ad7 100644 --- a/cmake/scripts/common/AddonHelpers.cmake +++ b/cmake/scripts/common/AddonHelpers.cmake @@ -92,6 +92,7 @@ macro (build_addon target prefix libs) endforeach() endif() + message(STATUS "Addon dependency check ...") # Set defines used in addon.xml.in and read from versions.h to set add-on # version parts automatically file(STRINGS ${KODI_INCLUDE_DIR}/versions.h BIN_ADDON_PARTS) @@ -108,7 +109,8 @@ macro (build_addon target prefix libs) if("${include_name}" MATCHES "_DEPENDS") # Use start definition name as base for other value type list(GET loop_var 0 list_name) - string(REPLACE "_DEPENDS" "" depends_name ${list_name}) + string(REPLACE "_DEPENDS" "_MIN" depends_minver ${list_name}) + string(REPLACE "_DEPENDS" "" depends_ver ${list_name}) string(REPLACE "_DEPENDS" "_XML_ID" xml_entry_name ${list_name}) string(REPLACE "_DEPENDS" "_USED" used_type_name ${list_name}) @@ -120,16 +122,14 @@ macro (build_addon target prefix libs) foreach(src_file ${USED_SOURCES}) file(STRINGS ${src_file} BIN_ADDON_SRC_PARTS) foreach(loop_var ${BIN_ADDON_SRC_PARTS}) - string(FIND "${loop_var}" "#include" matchres) - if("${matchres}" EQUAL 0) - string(REPLACE " " ";" loop_var "${loop_var}") - list(GET loop_var 1 include_name) - string(REGEX REPLACE "[<>\"]|kodi/" "" include_name "${include_name}") - if(include_name MATCHES ${depend_header}) - set(ADDON_DEPENDS "${ADDON_DEPENDS}\n") - # Inform with them the addon header about used type + string(REGEX MATCH "^[ \t]*#[ \t]*(include|import)[ \t]*[<\"](kodi\/)?(.+)[\">]" include_name "${loop_var}") + if(include_name AND CMAKE_MATCH_3 MATCHES ^${depend_header}) + get_directory_property(CURRENT_DEFS COMPILE_DEFINITIONS) + if(NOT used_type_name IN_LIST CURRENT_DEFS) + set(ADDON_DEPENDS "${ADDON_DEPENDS}\n") + # Inform with them the addon header about used type, if not present before add_definitions(-D${used_type_name}) - message(STATUS "Added usage definition: ${used_type_name}") + message(STATUS " - Added API usage definition: ${used_type_name} (Version: \"${${depends_ver}}\", Min. Version: \"${${depends_minver}}\")") set(FOUND_HEADER_USAGE 1) endif() endif() @@ -276,6 +276,18 @@ macro (build_addon target prefix libs) install(FILES ${${prefix}_ADDITIONAL_BINARY} DESTINATION ${target} COMPONENT ${target}-${${prefix}_VERSION}-${PLATFORM_TAG}) endif() + if(${prefix}_ADDITIONAL_BINARY_EXE) + install(PROGRAMS ${${prefix}_ADDITIONAL_BINARY_EXE} DESTINATION ${target} + COMPONENT ${target}-${${prefix}_VERSION}-${PLATFORM_TAG}) + endif() + if(${prefix}_ADDITIONAL_BINARY_PARTS) + install(FILES ${${prefix}_ADDITIONAL_BINARY_PARTS} DESTINATION ${target} + COMPONENT ${target}-${${prefix}_VERSION}-${PLATFORM_TAG}) + endif() + if(${prefix}_ADDITIONAL_BINARY_DIRS) + install(DIRECTORY ${${prefix}_ADDITIONAL_BINARY_DIRS} DESTINATION ${target} USE_SOURCE_PERMISSIONS + COMPONENT ${target}-${${prefix}_VERSION}-${PLATFORM_TAG}) + endif() else() # NOT WIN32 if(NOT CPACK_PACKAGE_DIRECTORY) set(CPACK_PACKAGE_DIRECTORY ${CMAKE_BINARY_DIR}) @@ -296,6 +308,18 @@ macro (build_addon target prefix libs) install(FILES ${${prefix}_ADDITIONAL_BINARY} DESTINATION ${target} COMPONENT ${target}-${${prefix}_VERSION}-${PLATFORM_TAG}) endif() + if(${prefix}_ADDITIONAL_BINARY_EXE) + install(PROGRAMS ${${prefix}_ADDITIONAL_BINARY_EXE} DESTINATION ${target} + COMPONENT ${target}-${${prefix}_VERSION}-${PLATFORM_TAG}) + endif() + if(${prefix}_ADDITIONAL_BINARY_PARTS) + install(FILES ${${prefix}_ADDITIONAL_BINARY_PARTS} DESTINATION ${target} + COMPONENT ${target}-${${prefix}_VERSION}-${PLATFORM_TAG}) + endif() + if(${prefix}_ADDITIONAL_BINARY_DIRS) + install(DIRECTORY ${${prefix}_ADDITIONAL_BINARY_DIRS} DESTINATION ${target} USE_SOURCE_PERMISSIONS + COMPONENT ${target}-${${prefix}_VERSION}-${PLATFORM_TAG}) + endif() endif() add_cpack_workaround(${target} ${${prefix}_VERSION} ${ext}) else() @@ -339,6 +363,15 @@ macro (build_addon target prefix libs) if(${prefix}_ADDITIONAL_BINARY) install(FILES ${${prefix}_ADDITIONAL_BINARY} DESTINATION ${CMAKE_INSTALL_LIBDIR}/addons/${target}) endif() + if(${prefix}_ADDITIONAL_BINARY_EXE) + install(PROGRAMS ${${prefix}_ADDITIONAL_BINARY_EXE} DESTINATION ${CMAKE_INSTALL_LIBDIR}/addons/${target}) + endif() + if(${prefix}_ADDITIONAL_BINARY_PARTS) + install(FILES ${${prefix}_ADDITIONAL_BINARY_PARTS} DESTINATION ${CMAKE_INSTALL_LIBDIR}/addons/${target}) + endif() + if(${prefix}_ADDITIONAL_BINARY_DIRS) + install(DIRECTORY ${${prefix}_ADDITIONAL_BINARY_DIRS} DESTINATION ${CMAKE_INSTALL_LIBDIR}/addons/${target} USE_SOURCE_PERMISSIONS) + endif() endif() if(${APP_NAME_UC}_BUILD_DIR) file(GLOB_RECURSE files ${CMAKE_CURRENT_SOURCE_DIR}/${target}/*) diff --git a/cmake/scripts/common/AddonHelpers.dox b/cmake/scripts/common/AddonHelpers.dox new file mode 100644 index 0000000..d3acec0 --- /dev/null +++ b/cmake/scripts/common/AddonHelpers.dox @@ -0,0 +1,59 @@ +/*! +\addtogroup cpp_cmake + +Kodi which uses it as a library for its binary addons has a special build +system for this. + +To implement this, a CMake macro brought by Kodi is used, this is +"build_addon (...)". This processes various definitions passed by the addon to +process the construction. + + +-------------------------------------------------------------------------------- + +Here a minmal example of the for addon used CMakeLists.txt: + +~~~~~~~~~~~~~{.cmake} +cmake_minimum_required(VERSION 3.5) +project(example.addon) + +set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} ${PROJECT_SOURCE_DIR}) + +find_package(Kodi REQUIRED) + +include_directories(${KODI_INCLUDE_DIR} + +set(DEPLIBS ) # Here empty +set(EXAMPLE_SOURCES src/main.cpp) +set(EXAMPLE_HEADERS src/main.h) + +build_addon((example.addon EXAMPLE DEPLIBS) + +include(CPack) +~~~~~~~~~~~~~ + + +-------------------------------------------------------------------------------- + +This is a list of special variables that can be passed to the macro. +The parts defined with "*" must be given the second name given to the macro. + +Here to define the necessary creation and installation files on addon CMakeLists.txt: +| Name | Description +|-----------------------------|------------------------------------------------- +| *_SOURCES | List of source code files to be complicated. +| *_HEADERS | List of used source code header files. +| *_CUSTOM_BINARY | For special cases where an already created library from an external source is inserted, the "* _SOURCES" and "* _HEADERS" are unused in this case.
This is currently used primarily on game addons. +| *_CUSTOM_DATA | To add additional required data from a folder, which are stored in the shared folder of the addon.
With a "/" at the end of the content given to the folder is used, without the folder itself. +| *_ADDITIONAL_BINARY | In case the additional library has to be installed for the addon, the path or CMake name can be given here. +| *_ADDITIONAL_BINARY_EXE | In case you need to addon an additional application you can give the path or CMake name, it will be in the same folder as the addon library.
The mode bits are set there as EXE. +| *_ADDITIONAL_BINARY_DIRS | To add complete folders additionally to folders containing the addon library.
With a "/" at the end of the content given to the folder is used, without the folder itself. + +External creation Options, given by `-D...`: +| Name | Description +|-----------------------------|------------------------------------------------- +| PACKAGE_ZIP | To create a package as a ZIP file. This is also used to install locally addon together.
Default is OFF. +| PACKAGE_TGZ | To create a package as a TGZ file.
Default is OFF. +| BUILD_SHARED_LIBS | To define if addon library is shared or static.
Default is ON to have shared. +| USE_LTO | Use link time optimization.
Default is OFF. +*/ diff --git a/cmake/scripts/common/ArchSetup.cmake b/cmake/scripts/common/ArchSetup.cmake index 07ce6d4..2e1eb12 100644 --- a/cmake/scripts/common/ArchSetup.cmake +++ b/cmake/scripts/common/ArchSetup.cmake @@ -18,24 +18,7 @@ include(CheckCXXSourceCompiles) include(CheckSymbolExists) include(CheckFunctionExists) include(CheckIncludeFile) - -# Macro to check if a given type exists in a given header -# Arguments: -# header the header to check -# type the type to check for existence -# var the compiler definition to set if type exists -# On return: -# If type was found, the definition is added to SYSTEM_DEFINES -macro(check_type header type var) - check_cxx_source_compiles("#include <${header}> - int main() - { - ${type} s; - }" ${var}) - if(${var}) - list(APPEND SYSTEM_DEFINES -D${var}=1) - endif() -endmacro() +include(CheckTypeSize) # Macro to check if a given builtin function exists # Arguments: @@ -95,17 +78,12 @@ endif() include(${CMAKE_SOURCE_DIR}/cmake/scripts/${CORE_SYSTEM_NAME}/ArchSetup.cmake) message(STATUS "Core system type: ${CORE_SYSTEM_NAME}") -message(STATUS "Platform: ${PLATFORM}") +message(STATUS "Platform: ${CORE_PLATFORM_NAME}") message(STATUS "CPU: ${CPU}, ARCH: ${ARCH}") message(STATUS "Cross-Compiling: ${CMAKE_CROSSCOMPILING}") message(STATUS "Execute build artefacts on host: ${CORE_HOST_IS_TARGET}") message(STATUS "Depends based build: ${KODI_DEPENDSBUILD}") -check_type(string std::u16string HAVE_STD__U16_STRING) -check_type(string std::u32string HAVE_STD__U32_STRING) -check_type(string char16_t HAVE_CHAR16_T) -check_type(string char32_t HAVE_CHAR32_T) -check_type(stdint.h uint_least16_t HAVE_STDINT_H) check_symbol_exists(posix_fadvise fcntl.h HAVE_POSIX_FADVISE) check_symbol_exists(PRIdMAX inttypes.h HAVE_INTTYPES_H) check_builtin("long* temp=0; long ret=__sync_add_and_fetch(temp, 1)" HAS_BUILTIN_SYNC_ADD_AND_FETCH) diff --git a/cmake/scripts/common/CheckTargetPlatform.cmake b/cmake/scripts/common/CheckTargetPlatform.cmake index 526e4bd..d776085 100644 --- a/cmake/scripts/common/CheckTargetPlatform.cmake +++ b/cmake/scripts/common/CheckTargetPlatform.cmake @@ -29,7 +29,10 @@ function(check_target_platform dir target_platform build) string(SUBSTRING ${platform} 1 ${platform_length} platform) # check if the current platform does not match the extracted platform - if(NOT ${platform} STREQUAL ${target_platform}) + if(${platform} STREQUAL ${target_platform}) + set(${build} FALSE) + break() + elseif(NOT ${platform} STREQUAL ${target_platform}) set(${build} TRUE) endif() endif() diff --git a/cmake/scripts/common/CompilerSettings.cmake b/cmake/scripts/common/CompilerSettings.cmake new file mode 100644 index 0000000..b4e7e89 --- /dev/null +++ b/cmake/scripts/common/CompilerSettings.cmake @@ -0,0 +1,7 @@ +# Languages and global compiler settings +if(NOT DEFINED CMAKE_CXX_STANDARD OR CMAKE_CXX_STANDARD LESS 14) + set(CMAKE_CXX_STANDARD 14) +endif() +set(CMAKE_CXX_STANDARD_REQUIRED ON) +set(CMAKE_CXX_EXTENSIONS OFF) +set(CMAKE_ASM_FLAGS "${CMAKE_C_FLAGS} -x assembler-with-cpp") diff --git a/cmake/scripts/common/GenerateVersionedFiles.cmake b/cmake/scripts/common/GenerateVersionedFiles.cmake index 1d324db..d54b524 100644 --- a/cmake/scripts/common/GenerateVersionedFiles.cmake +++ b/cmake/scripts/common/GenerateVersionedFiles.cmake @@ -24,9 +24,6 @@ foreach(loop_var ${ADDON_XML_IN_FILE}) string(REPLACE ${CORE_SOURCE_DIR} ${CMAKE_BINARY_DIR} dest_dir ${source_dir}) file(MAKE_DIRECTORY ${dest_dir}) - # copy everything except addon.xml.in to build folder - file(COPY "${source_dir}" DESTINATION "${CMAKE_BINARY_DIR}/addons" REGEX ".xml.in" EXCLUDE) - configure_file(${source_dir}/addon.xml.in ${dest_dir}/addon.xml @ONLY) unset(source_dir) diff --git a/cmake/scripts/common/HandleDepends.cmake b/cmake/scripts/common/HandleDepends.cmake index 40e382b..7cacd25 100644 --- a/cmake/scripts/common/HandleDepends.cmake +++ b/cmake/scripts/common/HandleDepends.cmake @@ -68,8 +68,8 @@ 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) + # windows args + if (CMAKE_SYSTEM_NAME STREQUAL WindowsStore OR CMAKE_SYSTEM_NAME STREQUAL Windows) list(APPEND BUILD_ARGS -DCMAKE_SYSTEM_NAME=${CMAKE_SYSTEM_NAME} -DCMAKE_SYSTEM_VERSION=${CMAKE_SYSTEM_VERSION}) endif() @@ -78,8 +78,10 @@ function(add_addon_depends addon searchpath) # make sure we create strings, not lists set(TMP_C_FLAGS "${CMAKE_C_FLAGS} ${ARCH_DEFINES}") set(TMP_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${ARCH_DEFINES}") + set(TMP_EXE_LINKER_FLAGS "-L${OUTPUT_DIR}/lib ${CMAKE_EXE_LINKER_FLAGS}") list(APPEND BUILD_ARGS -DCMAKE_C_FLAGS=${TMP_C_FLAGS} - -DCMAKE_CXX_FLAGS=${TMP_CXX_FLAGS}) + -DCMAKE_CXX_FLAGS=${TMP_CXX_FLAGS} + -DCMAKE_EXE_LINKER_FLAGS=${TMP_EXE_LINKER_FLAGS}) endif() if(CMAKE_TOOLCHAIN_FILE) @@ -88,6 +90,17 @@ function(add_addon_depends addon searchpath) message(${BUILD_ARGS}) endif() + # used for addons where need special folders to store there content (if + # not set the addon define it byself). + # e.g. Google Chromium addon where his git bring: + # - "unable to create file" ... "Filename too long" + # see also WARNING by Windows on: https://bitbucket.org/chromiumembedded/cef/wiki/MasterBuildQuickStart + if(THIRD_PARTY_PATH) + message(STATUS "Third party lib path specified") + message(STATUS ${THIRD_PARTY_PATH}) + list(APPEND BUILD_ARGS -DTHIRD_PARTY_PATH=${THIRD_PARTY_PATH}) + endif() + set(PATCH_COMMAND) # if there's a CMakeLists.txt use it to prepare the build @@ -215,7 +228,6 @@ function(add_addon_depends addon searchpath) -DOUTPUT_DIR=${OUTPUT_DIR} -DCMAKE_PREFIX_PATH=${OUTPUT_DIR} -DCMAKE_INSTALL_PREFIX=${OUTPUT_DIR} - -DCMAKE_EXE_LINKER_FLAGS=-L${OUTPUT_DIR}/lib -DCMAKE_INCLUDE_PATH=${OUTPUT_DIR}/include) endif() diff --git a/cmake/scripts/common/Macros.cmake b/cmake/scripts/common/Macros.cmake index eefd7c8..f7327e3 100644 --- a/cmake/scripts/common/Macros.cmake +++ b/cmake/scripts/common/Macros.cmake @@ -111,26 +111,6 @@ function(core_add_test_library name) endforeach() endfunction() -# Add an addon callback library -# Arguments: -# name name of the library to add -# Implicit arguments: -# SOURCES the sources of the library -# HEADERS the headers of the library (only for IDE support) -# OTHERS other library related files (only for IDE support) -# On return: -# Library target is defined and added to LIBRARY_FILES -function(core_add_addon_library name) - get_filename_component(DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR} NAME) - list(APPEND SOURCES lib${name}.cpp) - core_add_shared_library(${name} OUTPUT_DIRECTORY addons/${DIRECTORY}) - set_target_properties(${name} PROPERTIES FOLDER addons) - target_include_directories(${name} PRIVATE - ${CMAKE_CURRENT_SOURCE_DIR} - ${CMAKE_SOURCE_DIR}/xbmc/addons/kodi-addon-dev-kit/include/kodi - ${CMAKE_SOURCE_DIR}/xbmc) -endfunction() - # Add an dl-loaded shared library # Arguments: # name name of the library to add @@ -386,25 +366,6 @@ function(core_require_dep) endforeach() endfunction() -# add required dyloaded dependencies of main application -# Arguments: -# dep_list One or many dependency specifications (see split_dependency_specification) -# for syntax). The dependency name is used uppercased as variable prefix. -# On return: -# dependency added to ${SYSTEM_INCLUDES}, ${dep}_SONAME is set up -function(core_require_dyload_dep) - foreach(depspec ${ARGN}) - split_dependency_specification(${depspec} dep version) - find_package_with_ver(${dep} ${version} REQUIRED) - string(TOUPPER ${dep} depup) - list(APPEND SYSTEM_INCLUDES ${${depup}_INCLUDE_DIRS}) - list(APPEND DEP_DEFINES ${${depup}_DEFINITIONS}) - find_soname(${depup} REQUIRED) - export_dep() - set(${depup}_SONAME ${${depup}_SONAME} PARENT_SCOPE) - endforeach() -endfunction() - # helper macro for optional deps macro(setup_enable_switch) string(TOUPPER ${dep} depup) @@ -450,39 +411,6 @@ function(core_optional_dep) set(final_message ${final_message} PARENT_SCOPE) endfunction() -# add optional dyloaded dependencies of main application -# Arguments: -# dep_list One or many dependency specifications (see split_dependency_specification) -# for syntax). The dependency name is used uppercased as variable prefix. -# On return: -# dependency optionally added to ${SYSTEM_INCLUDES}, ${DEP_DEFINES}, ${dep}_SONAME is set up -function(core_optional_dyload_dep) - foreach(depspec ${ARGN}) - set(_required False) - split_dependency_specification(${depspec} dep version) - setup_enable_switch() - if(${enable_switch} STREQUAL AUTO) - find_package_with_ver(${dep} ${version}) - elseif(${${enable_switch}}) - find_package_with_ver(${dep} ${version} REQUIRED) - set(_required True) - endif() - - if(${depup}_FOUND) - list(APPEND SYSTEM_INCLUDES ${${depup}_INCLUDE_DIRS}) - find_soname(${depup} REQUIRED) - list(APPEND DEP_DEFINES ${${depup}_DEFINITIONS}) - set(final_message ${final_message} "${depup} enabled: Yes" PARENT_SCOPE) - export_dep() - set(${depup}_SONAME ${${depup}_SONAME} PARENT_SCOPE) - elseif(_required) - message(FATAL_ERROR "${depup} enabled but not found") - else() - set(final_message ${final_message} "${depup} enabled: No" PARENT_SCOPE) - endif() - endforeach() -endfunction() - function(core_file_read_filtered result filepattern) # Reads STRINGS from text files # with comments filtered out diff --git a/cmake/scripts/common/PrepareEnv.cmake b/cmake/scripts/common/PrepareEnv.cmake index 753dca1..559788f 100644 --- a/cmake/scripts/common/PrepareEnv.cmake +++ b/cmake/scripts/common/PrepareEnv.cmake @@ -34,6 +34,14 @@ endif() set(PLATFORM_TAG ${CORE_SYSTEM_NAME}) +# The CPU variable is given either by ./tools/depends or by the +# ./cmake/scripts/common/ArchSetup.cmake (which refers to the Kodi building +# itself). However, this file is only used by addons, so CPU can not always +# be defined, so in this case, if empty, the base CPU will be used. +if(NOT CPU) + set(CPU ${CMAKE_SYSTEM_PROCESSOR}) +endif() + if(CORE_SYSTEM_NAME STREQUAL android) if (CPU MATCHES "v7a") set(PLATFORM_TAG ${PLATFORM_TAG}-armv7) @@ -41,13 +49,14 @@ if(CORE_SYSTEM_NAME STREQUAL android) set(PLATFORM_TAG ${PLATFORM_TAG}-aarch64) elseif (CPU MATCHES "i686") set(PLATFORM_TAG ${PLATFORM_TAG}-i686) + elseif (CPU MATCHES "x86_64") + set(PLATFORM_TAG ${PLATFORM_TAG}-x86_64) else() message(FATAL_ERROR "Unsupported architecture") endif() -elseif(CORE_SYSTEM_NAME STREQUAL ios) - if (CPU MATCHES armv7) - set(PLATFORM_TAG ${PLATFORM_TAG}-armv7) - elseif (CPU MATCHES arm64) +elseif(CORE_SYSTEM_NAME STREQUAL darwin_embedded) + set(PLATFORM_TAG ${CORE_PLATFORM_NAME}) + if (CPU MATCHES arm64) set(PLATFORM_TAG ${PLATFORM_TAG}-aarch64) else() message(FATAL_ERROR "Unsupported architecture") diff --git a/cmake/scripts/darwin/Macros.cmake b/cmake/scripts/darwin/Macros.cmake new file mode 100644 index 0000000..9a805c4 --- /dev/null +++ b/cmake/scripts/darwin/Macros.cmake @@ -0,0 +1,8 @@ +macro(enable_arc) + if(CMAKE_GENERATOR STREQUAL Xcode) + set(CMAKE_XCODE_ATTRIBUTE_CLANG_ENABLE_OBJC_ARC YES) + else() + set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -fobjc-arc") + set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fobjc-arc") + endif() +endmacro() diff --git a/cmake/scripts/darwin_embedded/ArchSetup.cmake b/cmake/scripts/darwin_embedded/ArchSetup.cmake new file mode 100644 index 0000000..7160da9 --- /dev/null +++ b/cmake/scripts/darwin_embedded/ArchSetup.cmake @@ -0,0 +1,65 @@ +if(NOT CMAKE_TOOLCHAIN_FILE) + message(FATAL_ERROR "CMAKE_TOOLCHAIN_FILE required for ios/tvos. See ${CMAKE_SOURCE_DIR}/cmake/README.md") +endif() + +set(CORE_MAIN_SOURCE ${CMAKE_SOURCE_DIR}/xbmc/platform/darwin/${CORE_PLATFORM_NAME_LC}/XBMCApplication.mm) +set(PLATFORM_BUNDLE_INFO_PLIST ${CMAKE_SOURCE_DIR}/xbmc/platform/darwin/${CORE_PLATFORM_NAME_LC}/Info.plist.in) + +set(ARCH_DEFINES -DTARGET_POSIX -DTARGET_DARWIN -DTARGET_DARWIN_EMBEDDED) +if(CORE_PLATFORM_NAME_LC STREQUAL tvos) + list(APPEND ARCH_DEFINES -DTARGET_DARWIN_TVOS) +else() + list(APPEND ARCH_DEFINES -DTARGET_DARWIN_IOS) +endif() +set(SYSTEM_DEFINES -D_REENTRANT -D_FILE_OFFSET_BITS=64 -D_LARGEFILE64_SOURCE + -D__STDC_CONSTANT_MACROS -DHAS_IOS_NETWORK -DHAS_ZEROCONF) +set(PLATFORM_DIR platform/darwin) +set(PLATFORMDEFS_DIR platform/posix) +set(CMAKE_SYSTEM_NAME Darwin) +if(WITH_ARCH) + set(ARCH ${WITH_ARCH}) +else() + if(CPU STREQUAL arm64) + set(ARCH aarch64) + else() + message(SEND_ERROR "Unknown CPU: ${CPU}") + endif() + set(CMAKE_OSX_ARCHITECTURES ${CPU}) + set(NEON True) +endif() + +list(APPEND CMAKE_SYSTEM_PREFIX_PATH ${NATIVEPREFIX}) + +list(APPEND DEPLIBS "-framework CoreFoundation" "-framework CoreVideo" + "-framework CoreAudio" "-framework AudioToolbox" + "-framework QuartzCore" "-framework MediaPlayer" + "-framework CFNetwork" "-framework CoreGraphics" + "-framework Foundation" "-framework UIKit" + "-framework CoreMedia" "-framework AVFoundation" + "-framework VideoToolbox" "-lresolv" "-ObjC" + "-framework AVKit" "-framework GameController") + +set(ENABLE_OPTICAL OFF CACHE BOOL "" FORCE) + +# AppleTV already has built-in AirPlay support +if(CORE_PLATFORM_NAME_LC STREQUAL tvos) + set(ENABLE_AIRTUNES OFF CACHE BOOL "" FORCE) +endif() +set(CMAKE_XCODE_ATTRIBUTE_INLINES_ARE_PRIVATE_EXTERN OFF) +set(CMAKE_XCODE_ATTRIBUTE_GCC_SYMBOLS_PRIVATE_EXTERN OFF) +set(CMAKE_XCODE_ATTRIBUTE_COPY_PHASE_STRIP OFF) + +include(cmake/scripts/darwin/Macros.cmake) +enable_arc() + +# Xcode strips dead code by default which breaks wrapping +set(CMAKE_XCODE_ATTRIBUTE_DEAD_CODE_STRIPPING OFF) + +option(ENABLE_XCODE_ADDONBUILD "Enable Xcode automatic addon building?" OFF) + +# Unify output directories for iOS/tvOS packaging scripts +set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CORE_BUILD_DIR}/${CORE_BUILD_CONFIG}) +foreach(OUTPUTCONFIG ${CMAKE_CONFIGURATION_TYPES}) + string(TOUPPER ${OUTPUTCONFIG} OUTPUTCONFIG) + set(CMAKE_RUNTIME_OUTPUT_DIRECTORY_${OUTPUTCONFIG} ${CORE_BUILD_DIR}/${CORE_BUILD_CONFIG}) +endforeach() diff --git a/cmake/scripts/darwin_embedded/ExtraTargets.cmake b/cmake/scripts/darwin_embedded/ExtraTargets.cmake new file mode 100644 index 0000000..2b9980a --- /dev/null +++ b/cmake/scripts/darwin_embedded/ExtraTargets.cmake @@ -0,0 +1,25 @@ +if(CORE_PLATFORM_NAME_LC STREQUAL tvos) + # top shelf extension + set(TOPSHELF_EXTENSION_NAME "${APP_NAME_LC}-topshelf") + set(TOPSHELF_BUNDLE_EXTENSION appex) + set(TOPSHELF_DIR "${CMAKE_SOURCE_DIR}/xbmc/platform/darwin/tvos/TopShelf") + # same path as the output Info.plist, taken from cmGlobalXCodeGenerator::ComputeInfoPListLocation() + set(ENTITLEMENTS_OUT_PATH "${CMAKE_BINARY_DIR}/CMakeFiles/${TOPSHELF_EXTENSION_NAME}.dir/TopShelf.entitlements") + + set(SOURCES + ${TOPSHELF_DIR}/ServiceProvider.m + ${TOPSHELF_DIR}/../tvosShared.m) + set(HEADERS + ${TOPSHELF_DIR}/ServiceProvider.h + ${TOPSHELF_DIR}/../tvosShared.h) + add_executable(${TOPSHELF_EXTENSION_NAME} MACOSX_BUNDLE ${SOURCES} ${HEADERS}) + + configure_file(${TOPSHELF_DIR}/TopShelf.entitlements.in ${ENTITLEMENTS_OUT_PATH} @ONLY) + set_target_properties(${TOPSHELF_EXTENSION_NAME} PROPERTIES BUNDLE_EXTENSION ${TOPSHELF_BUNDLE_EXTENSION} + MACOSX_BUNDLE_INFO_PLIST ${TOPSHELF_DIR}/Info.plist.in + XCODE_PRODUCT_TYPE com.apple.product-type.tv-app-extension + XCODE_ATTRIBUTE_CODE_SIGN_ENTITLEMENTS ${ENTITLEMENTS_OUT_PATH}) + target_link_libraries(${TOPSHELF_EXTENSION_NAME} "-framework TVServices" "-framework Foundation") + + add_dependencies(${APP_NAME_LC} ${TOPSHELF_EXTENSION_NAME}) +endif() diff --git a/cmake/scripts/darwin_embedded/Install.cmake b/cmake/scripts/darwin_embedded/Install.cmake new file mode 100644 index 0000000..af18277 --- /dev/null +++ b/cmake/scripts/darwin_embedded/Install.cmake @@ -0,0 +1,135 @@ +# IOS/TVOS packaging +if(CORE_PLATFORM_NAME_LC STREQUAL tvos) + # asset catalog + set(ASSET_CATALOG "${CMAKE_SOURCE_DIR}/xbmc/platform/darwin/tvos/Assets.xcassets") + set(ASSET_CATALOG_ASSETS Assets) + set(ASSET_CATALOG_LAUNCH_IMAGE LaunchImage) + + message("generating missing asset catalog images...") + execute_process(COMMAND ${CMAKE_SOURCE_DIR}/tools/darwin/Support/GenerateMissingImages-tvos.py "${ASSET_CATALOG}" ${ASSET_CATALOG_ASSETS} ${ASSET_CATALOG_LAUNCH_IMAGE}) + + target_sources(${APP_NAME_LC} PRIVATE "${ASSET_CATALOG}") + set_source_files_properties("${ASSET_CATALOG}" PROPERTIES MACOSX_PACKAGE_LOCATION "Resources") # adds to Copy Bundle Resources build phase + + # entitlements + set(ENTITLEMENTS_OUT_PATH "${CMAKE_BINARY_DIR}/CMakeFiles/${APP_NAME_LC}.dir/Kodi.entitlements") + configure_file(${CMAKE_SOURCE_DIR}/xbmc/platform/darwin/tvos/Kodi.entitlements.in ${ENTITLEMENTS_OUT_PATH} @ONLY) + + set_target_properties(${APP_NAME_LC} PROPERTIES XCODE_ATTRIBUTE_ASSETCATALOG_COMPILER_APPICON_NAME ${ASSET_CATALOG_ASSETS} + XCODE_ATTRIBUTE_ASSETCATALOG_COMPILER_LAUNCHIMAGE_NAME ${ASSET_CATALOG_LAUNCH_IMAGE} + XCODE_ATTRIBUTE_CODE_SIGN_ENTITLEMENTS ${ENTITLEMENTS_OUT_PATH}) + +else() + set(BUNDLE_RESOURCES ${CMAKE_SOURCE_DIR}/media/splash.jpg + ${CMAKE_SOURCE_DIR}/tools/darwin/packaging/media/ios/rounded/AppIcon29x29.png + ${CMAKE_SOURCE_DIR}/tools/darwin/packaging/media/ios/rounded/AppIcon29x29@2x.png + ${CMAKE_SOURCE_DIR}/tools/darwin/packaging/media/ios/rounded/AppIcon40x40.png + ${CMAKE_SOURCE_DIR}/tools/darwin/packaging/media/ios/rounded/AppIcon40x40@2x.png + ${CMAKE_SOURCE_DIR}/tools/darwin/packaging/media/ios/rounded/AppIcon50x50.png + ${CMAKE_SOURCE_DIR}/tools/darwin/packaging/media/ios/rounded/AppIcon50x50@2x.png + ${CMAKE_SOURCE_DIR}/tools/darwin/packaging/media/ios/rounded/AppIcon57x57.png + ${CMAKE_SOURCE_DIR}/tools/darwin/packaging/media/ios/rounded/AppIcon57x57@2x.png + ${CMAKE_SOURCE_DIR}/tools/darwin/packaging/media/ios/rounded/AppIcon60x60.png + ${CMAKE_SOURCE_DIR}/tools/darwin/packaging/media/ios/rounded/AppIcon60x60@2x.png + ${CMAKE_SOURCE_DIR}/tools/darwin/packaging/media/ios/rounded/AppIcon72x72.png + ${CMAKE_SOURCE_DIR}/tools/darwin/packaging/media/ios/rounded/AppIcon72x72@2x.png + ${CMAKE_SOURCE_DIR}/tools/darwin/packaging/media/ios/rounded/AppIcon76x76.png + ${CMAKE_SOURCE_DIR}/tools/darwin/packaging/media/ios/rounded/AppIcon76x76@2x.png) + + target_sources(${APP_NAME_LC} PRIVATE ${BUNDLE_RESOURCES}) + foreach(file IN LISTS BUNDLE_RESOURCES) + set_source_files_properties(${file} PROPERTIES MACOSX_PACKAGE_LOCATION .) + endforeach() + + target_sources(${APP_NAME_LC} PRIVATE ${CMAKE_SOURCE_DIR}/xbmc/platform/darwin/ios/LaunchScreen.storyboard) + set_source_files_properties(${CMAKE_SOURCE_DIR}/xbmc/platform/darwin/ios/LaunchScreen.storyboard PROPERTIES MACOSX_PACKAGE_LOCATION "Resources") + +endif() + +# setup code signing +# dev team ID / identity (certificate) +set(DEVELOPMENT_TEAM "" CACHE STRING "Development Team") +set(CODE_SIGN_IDENTITY $,iPhone\ Developer,> CACHE STRING "Code Sign Identity") + +# app provisioning profile +set(CODE_SIGN_STYLE_APP Automatic) +set(PROVISIONING_PROFILE_APP "" CACHE STRING "Provisioning profile name for the Kodi app") +if(PROVISIONING_PROFILE_APP) + set(CODE_SIGN_STYLE_APP Manual) +endif() + +# top shelf provisioning profile +if(CORE_PLATFORM_NAME_LC STREQUAL tvos) + set(CODE_SIGN_STYLE_TOPSHELF Automatic) + set(PROVISIONING_PROFILE_TOPSHELF "" CACHE STRING "Provisioning profile name for the Top Shelf") + if(PROVISIONING_PROFILE_TOPSHELF) + set(CODE_SIGN_STYLE_TOPSHELF Manual) + endif() + set_target_properties(${TOPSHELF_EXTENSION_NAME} PROPERTIES XCODE_ATTRIBUTE_CODE_SIGN_IDENTITY "${CODE_SIGN_IDENTITY}" + XCODE_ATTRIBUTE_CODE_SIGN_STYLE ${CODE_SIGN_STYLE_TOPSHELF} + XCODE_ATTRIBUTE_DEVELOPMENT_TEAM "${DEVELOPMENT_TEAM}" + XCODE_ATTRIBUTE_PROVISIONING_PROFILE_SPECIFIER "${PROVISIONING_PROFILE_TOPSHELF}") + # copy extension inside PlugIns dir of the app bundle + add_custom_command(TARGET ${APP_NAME_LC} POST_BUILD + COMMAND ${CMAKE_COMMAND} ARGS -E copy_directory $ + $/PlugIns/${TOPSHELF_EXTENSION_NAME}.${TOPSHELF_BUNDLE_EXTENSION} + MAIN_DEPENDENCY ${TOPSHELF_EXTENSION_NAME}) +endif() +set_target_properties(${APP_NAME_LC} PROPERTIES XCODE_ATTRIBUTE_CODE_SIGN_IDENTITY "${CODE_SIGN_IDENTITY}" + XCODE_ATTRIBUTE_CODE_SIGN_STYLE ${CODE_SIGN_STYLE_APP} + XCODE_ATTRIBUTE_DEVELOPMENT_TEAM "${DEVELOPMENT_TEAM}" + XCODE_ATTRIBUTE_PROVISIONING_PROFILE_SPECIFIER "${PROVISIONING_PROFILE_APP}") + +# Create xcode target that allows to build binary-addons. +if(ADDONS_TO_BUILD) + set(_addons "ADDONS=${ADDONS_TO_BUILD}") +endif() +add_custom_target(binary-addons + COMMAND $(MAKE) -C ${CMAKE_SOURCE_DIR}/tools/depends/target/binary-addons clean + COMMAND $(MAKE) -C ${CMAKE_SOURCE_DIR}/tools/depends/target/binary-addons VERBOSE=1 V=99 + INSTALL_PREFIX="${CMAKE_BINARY_DIR}/addons" CROSS_COMPILING=yes ${_addons}) +if(ENABLE_XCODE_ADDONBUILD) + add_dependencies(${APP_NAME_LC} binary-addons) +endif() +unset(_addons) + +add_custom_command(TARGET ${APP_NAME_LC} POST_BUILD + # TODO: Remove in sync with CopyRootFiles-darwin_embedded expecting the ".bin" file + COMMAND ${CMAKE_COMMAND} -E copy $ + $/${APP_NAME}.bin + + COMMAND ${CMAKE_COMMAND} -E copy ${CMAKE_BINARY_DIR}/${CORE_BUILD_DIR}/DllPaths_generated.h + ${CMAKE_BINARY_DIR}/xbmc/DllPaths_generated.h + COMMAND "ACTION=build" + "APP_NAME=${APP_NAME}" + "XBMC_DEPENDS=${DEPENDS_PATH}" + ${CMAKE_SOURCE_DIR}/tools/darwin/Support/CopyRootFiles-darwin_embedded.command + COMMAND "XBMC_DEPENDS=${DEPENDS_PATH}" + "PYTHON_VERSION=${PYTHON_VERSION}" + ${CMAKE_SOURCE_DIR}/tools/darwin/Support/copyframeworks-darwin_embedded.command + COMMAND ${CMAKE_SOURCE_DIR}/tools/darwin/Support/copyframeworks-dylibs2frameworks.command + COMMAND "XBMC_DEPENDS=${DEPENDS_PATH}" + "NATIVEPREFIX=${NATIVEPREFIX}" + ${CMAKE_SOURCE_DIR}/tools/darwin/Support/Codesign.command +) + +if(CORE_PLATFORM_NAME_LC STREQUAL tvos) + add_custom_command(TARGET ${APP_NAME_LC} POST_BUILD + COMMAND ${CMAKE_COMMAND} -E copy_directory ${DEPENDS_PATH}/share/${APP_NAME_LC} $/AppData/AppHome + ) +endif() + +set(DEPENDS_ROOT_FOR_XCODE ${NATIVEPREFIX}/..) +configure_file(${CMAKE_SOURCE_DIR}/tools/darwin/packaging/darwin_embedded/mkdeb-darwin_embedded.sh.in + ${CMAKE_BINARY_DIR}/tools/darwin/packaging/darwin_embedded/mkdeb-darwin_embedded.sh @ONLY) + +if(CORE_PLATFORM_NAME_LC STREQUAL ios) + configure_file(${CMAKE_SOURCE_DIR}/tools/darwin/packaging/darwin_embedded/migrate_to_kodi.sh.in + ${CMAKE_BINARY_DIR}/tools/darwin/packaging/darwin_embedded/migrate_to_kodi.sh @ONLY) +endif() + +add_custom_target(deb + COMMAND sh ./mkdeb-darwin_embedded.sh ${CORE_BUILD_CONFIG} + WORKING_DIRECTORY ${CMAKE_BINARY_DIR}/tools/darwin/packaging/darwin_embedded) +add_dependencies(deb ${APP_NAME_LC}) + diff --git a/cmake/scripts/darwin_embedded/Macros.cmake b/cmake/scripts/darwin_embedded/Macros.cmake new file mode 100644 index 0000000..91f2d86 --- /dev/null +++ b/cmake/scripts/darwin_embedded/Macros.cmake @@ -0,0 +1,118 @@ +function(core_link_library lib wraplib) + if(CMAKE_GENERATOR MATCHES "Unix Makefiles" OR CMAKE_GENERATOR STREQUAL Ninja) + set(wrapper_obj cores/dll-loader/exports/CMakeFiles/wrapper.dir/wrapper.c.o) + elseif(CMAKE_GENERATOR MATCHES "Xcode") + set(wrapper_obj cores/dll-loader/exports/kodi.build/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME)/wrapper.build/Objects-$(CURRENT_VARIANT)/$(CURRENT_ARCH)/wrapper.o) + else() + message(FATAL_ERROR "Unsupported generator in core_link_library") + endif() + + set(export -bundle -undefined dynamic_lookup + -Wl,-alias_list,${CMAKE_BINARY_DIR}/${CORE_BUILD_DIR}/cores/dll-loader/exports/wrapper.def + ${CMAKE_BINARY_DIR}/${CORE_BUILD_DIR}/${wrapper_obj}) + set(extension ${CMAKE_SHARED_MODULE_SUFFIX}) + set(check_arg "") + if(TARGET ${lib}) + set(target ${lib}) + set(link_lib $) + set(check_arg ${ARGV2}) + set(data_arg ${ARGV3}) + + # iOS: EFFECTIVE_PLATFORM_NAME is not resolved + # http://public.kitware.com/pipermail/cmake/2016-March/063049.html + if(CORE_SYSTEM_NAME STREQUAL darwin_embedded) + get_target_property(dir ${lib} BINARY_DIR) + set(link_lib ${dir}/${CORE_BUILD_CONFIG}/${CMAKE_STATIC_LIBRARY_PREFIX}${lib}${CMAKE_STATIC_LIBRARY_SUFFIX}) + endif() + else() + set(target ${ARGV2}) + set(link_lib ${lib}) + set(check_arg ${ARGV3}) + set(data_arg ${ARGV4}) + endif() + if(check_arg STREQUAL export) + set(export ${export} + -Wl,--version-script=${ARGV3}) + elseif(check_arg STREQUAL extras) + foreach(arg ${data_arg}) + list(APPEND export ${arg}) + endforeach() + elseif(check_arg STREQUAL archives) + set(extra_libs ${data_arg}) + endif() + get_filename_component(dir ${wraplib} DIRECTORY) + + # We can't simply pass the linker flags to the args section of the custom command + # because cmake will add quotes around it (and the linker will fail due to those). + # We need to do this handstand first ... + string(REPLACE " " ";" CUSTOM_COMMAND_ARGS_LDFLAGS ${CMAKE_SHARED_LINKER_FLAGS}) + + add_custom_command(OUTPUT ${wraplib}-${ARCH}${extension} + COMMAND ${CMAKE_COMMAND} -E make_directory ${dir} + COMMAND ${CMAKE_C_COMPILER} + ARGS ${CUSTOM_COMMAND_ARGS_LDFLAGS} ${export} -Wl,-force_load ${link_lib} ${extra_libs} + -o ${CMAKE_BINARY_DIR}/${wraplib}-${ARCH}${extension} + DEPENDS ${target} wrapper.def wrapper + VERBATIM) + + get_filename_component(libname ${wraplib} NAME_WE) + add_custom_target(wrap_${libname} ALL DEPENDS ${wraplib}-${ARCH}${extension}) + set_target_properties(wrap_${libname} PROPERTIES FOLDER lib/wrapped) + add_dependencies(${APP_NAME_LC}-libraries wrap_${libname}) + + set(LIBRARY_FILES ${LIBRARY_FILES} ${CMAKE_BINARY_DIR}/${wraplib}-${ARCH}${extension} CACHE STRING "" FORCE) +endfunction() + +function(find_soname lib) + cmake_parse_arguments(arg "REQUIRED" "" "" ${ARGN}) + + string(TOLOWER ${lib} liblow) + if(${lib}_LDFLAGS) + set(link_lib "${${lib}_LDFLAGS}") + else() + set(link_lib "${${lib}_LIBRARIES}") + endif() + + execute_process(COMMAND ${CMAKE_C_COMPILER} -print-search-dirs + COMMAND fgrep libraries: + COMMAND sed "s/[^=]*=\\(.*\\)/\\1/" + COMMAND sed "s/:/ /g" + ERROR_QUIET + OUTPUT_VARIABLE cc_lib_path + OUTPUT_STRIP_TRAILING_WHITESPACE) + execute_process(COMMAND echo ${link_lib} + COMMAND sed "s/-L[ ]*//g" + COMMAND sed "s/-l[^ ]*//g" + ERROR_QUIET + OUTPUT_VARIABLE env_lib_path + OUTPUT_STRIP_TRAILING_WHITESPACE) + + foreach(path ${cc_lib_path} ${env_lib_path}) + if(IS_DIRECTORY ${path}) + execute_process(COMMAND ls -- ${path}/lib${liblow}.dylib + ERROR_QUIET + OUTPUT_VARIABLE lib_file + OUTPUT_STRIP_TRAILING_WHITESPACE) + else() + set(lib_file ${path}) + endif() + if(lib_file) + # we want the path/name that is embedded in the dylib + execute_process(COMMAND otool -L ${lib_file} + COMMAND grep -v lib${liblow}.dylib + COMMAND grep ${liblow} + COMMAND awk "{V=1; print $V}" + ERROR_QUIET + OUTPUT_VARIABLE filename + OUTPUT_STRIP_TRAILING_WHITESPACE) + get_filename_component(${lib}_SONAME "${filename}" NAME) + if(VERBOSE) + message(STATUS "${lib} soname: ${${lib}_SONAME}") + endif() + endif() + endforeach() + if(arg_REQUIRED AND NOT ${lib}_SONAME) + message(FATAL_ERROR "Could not find dynamically loadable library ${lib}") + endif() + set(${lib}_SONAME ${${lib}_SONAME} PARENT_SCOPE) +endfunction() diff --git a/cmake/scripts/darwin_embedded/PathSetup.cmake b/cmake/scripts/darwin_embedded/PathSetup.cmake new file mode 100644 index 0000000..efaca0b --- /dev/null +++ b/cmake/scripts/darwin_embedded/PathSetup.cmake @@ -0,0 +1,7 @@ +set(BUNDLE_IDENTIFIER_DESC "Bundle ID") +if(CORE_PLATFORM_NAME_LC STREQUAL tvos) + string(CONCAT BUNDLE_IDENTIFIER_DESC "${BUNDLE_IDENTIFIER_DESC}" " (app, top shelf, group ID)") +endif() +set(PLATFORM_BUNDLE_IDENTIFIER "${APP_PACKAGE}-${CORE_PLATFORM_NAME_LC}" CACHE STRING "${BUNDLE_IDENTIFIER_DESC}") +list(APPEND final_message "Bundle ID: ${PLATFORM_BUNDLE_IDENTIFIER}") +include(cmake/scripts/osx/PathSetup.cmake) diff --git a/cmake/scripts/freebsd/ArchSetup.cmake b/cmake/scripts/freebsd/ArchSetup.cmake index 3d5599c..7da6c51 100644 --- a/cmake/scripts/freebsd/ArchSetup.cmake +++ b/cmake/scripts/freebsd/ArchSetup.cmake @@ -1,7 +1,8 @@ -set(ARCH_DEFINES -D_LINUX -DTARGET_POSIX -DTARGET_FREEBSD) +set(ARCH_DEFINES -DTARGET_POSIX -DTARGET_FREEBSD) set(SYSTEM_DEFINES -D__STDC_CONSTANT_MACROS -D_LARGEFILE64_SOURCE - -D_FILE_OFFSET_BITS=64) + -D_FILE_OFFSET_BITS=64 -DHAS_OSS) set(PLATFORM_DIR platform/linux) +set(PLATFORMDEFS_DIR platform/posix) set(SYSTEM_LDFLAGS -L/usr/local/lib) if(WITH_ARCH) set(ARCH ${WITH_ARCH}) @@ -30,4 +31,4 @@ if(NOT ENABLE_ALSA) endif() # Additional SYSTEM_DEFINES -list(APPEND SYSTEM_DEFINES -DHAS_LINUX_NETWORK) +list(APPEND SYSTEM_DEFINES -DHAS_POSIX_NETWORK -DHAS_FREEBSD_NETWORK) diff --git a/cmake/scripts/ios/ArchSetup.cmake b/cmake/scripts/ios/ArchSetup.cmake deleted file mode 100644 index b6c626f..0000000 --- a/cmake/scripts/ios/ArchSetup.cmake +++ /dev/null @@ -1,61 +0,0 @@ -if(NOT CMAKE_TOOLCHAIN_FILE) - message(FATAL_ERROR "CMAKE_TOOLCHAIN_FILE required for ios. See ${CMAKE_SOURCE_DIR}/cmake/README.md") -endif() - -set(CORE_MAIN_SOURCE ${CMAKE_SOURCE_DIR}/xbmc/platform/darwin/ios/XBMCApplication.mm) - -set(ARCH_DEFINES -D_LINUX -DTARGET_POSIX -DTARGET_DARWIN -DTARGET_DARWIN_IOS) -set(SYSTEM_DEFINES -D_REENTRANT -D_FILE_OFFSET_BITS=64 -D_LARGEFILE64_SOURCE - -D__STDC_CONSTANT_MACROS) -set(PLATFORM_DIR platform/linux) -set(CMAKE_SYSTEM_NAME Darwin) -if(WITH_ARCH) - set(ARCH ${WITH_ARCH}) -else() - if(CPU STREQUAL armv7) - set(CMAKE_OSX_ARCHITECTURES ${CPU}) - set(ARCH arm) - set(NEON True) - elseif(CPU STREQUAL arm64) - set(CMAKE_OSX_ARCHITECTURES ${CPU}) - set(ARCH aarch64) - set(NEON True) - else() - message(SEND_ERROR "Unknown CPU: ${CPU}") - endif() -endif() - -# Additional SYSTEM_DEFINES -list(APPEND SYSTEM_DEFINES -DHAS_LINUX_NETWORK -DHAS_ZEROCONF) - -list(APPEND CMAKE_SYSTEM_PREFIX_PATH ${NATIVEPREFIX}) - -list(APPEND DEPLIBS "-framework CoreFoundation" "-framework CoreVideo" - "-framework CoreAudio" "-framework AudioToolbox" - "-framework QuartzCore" "-framework MediaPlayer" - "-framework CFNetwork" "-framework CoreGraphics" - "-framework Foundation" "-framework UIKit" - "-framework CoreMedia" "-framework AVFoundation" - "-framework VideoToolbox") - -set(ENABLE_OPTICAL OFF CACHE BOOL "" FORCE) - -set(CMAKE_XCODE_ATTRIBUTE_IPHONEOS_DEPLOYMENT_TARGET "9.0") -set(CMAKE_XCODE_ATTRIBUTE_TARGETED_DEVICE_FAMILY "1,2") - -set(CMAKE_XCODE_ATTRIBUTE_INLINES_ARE_PRIVATE_EXTERN OFF) -set(CMAKE_XCODE_ATTRIBUTE_GCC_SYMBOLS_PRIVATE_EXTERN OFF) -set(CMAKE_XCODE_ATTRIBUTE_COPY_PHASE_STRIP OFF) - -# Xcode strips dead code by default which breaks wrapping -set(CMAKE_XCODE_ATTRIBUTE_DEAD_CODE_STRIPPING OFF) - -# Unify output directories for iOS packaging scripts -if(NOT CMAKE_GENERATOR MATCHES Xcode) - set(CORE_BUILD_CONFIG "${CORE_BUILD_CONFIG}-iphoneos") -endif() -set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CORE_BUILD_DIR}/${CORE_BUILD_CONFIG}) -foreach(OUTPUTCONFIG ${CMAKE_CONFIGURATION_TYPES}) - string(TOUPPER ${OUTPUTCONFIG} OUTPUTCONFIG) - set(CMAKE_RUNTIME_OUTPUT_DIRECTORY_${OUTPUTCONFIG} ${CORE_BUILD_DIR}/${CORE_BUILD_CONFIG}) -endforeach() diff --git a/cmake/scripts/ios/Install.cmake b/cmake/scripts/ios/Install.cmake deleted file mode 100644 index 7668e7c..0000000 --- a/cmake/scripts/ios/Install.cmake +++ /dev/null @@ -1,99 +0,0 @@ -# IOS packaging - -set(BUNDLE_RESOURCES ${CMAKE_SOURCE_DIR}/xbmc/platform/darwin/ios/LaunchImage-1100-Landscape-2436h@3x.png - ${CMAKE_SOURCE_DIR}/xbmc/platform/darwin/ios/LaunchImage-1100-Portrait-2436h@3x.png - ${CMAKE_SOURCE_DIR}/xbmc/platform/darwin/ios/LaunchImage-1200-Landscape-1792h@2x.png - ${CMAKE_SOURCE_DIR}/xbmc/platform/darwin/ios/LaunchImage-1200-Portrait-2224h@2x.png - ${CMAKE_SOURCE_DIR}/xbmc/platform/darwin/ios/LaunchImage-1200-Landscape-2224h@2x.png - ${CMAKE_SOURCE_DIR}/xbmc/platform/darwin/ios/LaunchImage-1200-Portrait-2388h@2x.png - ${CMAKE_SOURCE_DIR}/xbmc/platform/darwin/ios/LaunchImage-1200-Landscape-2388h@2x.png - ${CMAKE_SOURCE_DIR}/xbmc/platform/darwin/ios/LaunchImage-1200-Landscape-2688h@3x.png - ${CMAKE_SOURCE_DIR}/xbmc/platform/darwin/ios/LaunchImage-1200-Portrait-1792h@2x.png - ${CMAKE_SOURCE_DIR}/xbmc/platform/darwin/ios/LaunchImage-1200-Portrait-2688h@3x.png - ${CMAKE_SOURCE_DIR}/xbmc/platform/darwin/ios/LaunchImage-568h@2x.png - ${CMAKE_SOURCE_DIR}/xbmc/platform/darwin/ios/LaunchImage-700-568h@2x.png - ${CMAKE_SOURCE_DIR}/xbmc/platform/darwin/ios/LaunchImage-700-Landscape@2x~ipad.png - ${CMAKE_SOURCE_DIR}/xbmc/platform/darwin/ios/LaunchImage-700-Portrait@2x~ipad.png - ${CMAKE_SOURCE_DIR}/xbmc/platform/darwin/ios/LaunchImage-700@2x.png - ${CMAKE_SOURCE_DIR}/xbmc/platform/darwin/ios/LaunchImage-800-667h@2x.png - ${CMAKE_SOURCE_DIR}/xbmc/platform/darwin/ios/LaunchImage-800-Landscape-736h@3x.png - ${CMAKE_SOURCE_DIR}/xbmc/platform/darwin/ios/LaunchImage-800-Portrait-736h@3x.png - ${CMAKE_SOURCE_DIR}/xbmc/platform/darwin/ios/LaunchImage-Landscape@2x~ipad.png - ${CMAKE_SOURCE_DIR}/xbmc/platform/darwin/ios/LaunchImage-Portrait@2x~ipad.png - ${CMAKE_SOURCE_DIR}/xbmc/platform/darwin/ios/LaunchImage@2x.png - ${CMAKE_SOURCE_DIR}/tools/darwin/packaging/media/ios/rounded/AppIcon29x29.png - ${CMAKE_SOURCE_DIR}/tools/darwin/packaging/media/ios/rounded/AppIcon29x29@2x.png - ${CMAKE_SOURCE_DIR}/tools/darwin/packaging/media/ios/rounded/AppIcon40x40.png - ${CMAKE_SOURCE_DIR}/tools/darwin/packaging/media/ios/rounded/AppIcon40x40@2x.png - ${CMAKE_SOURCE_DIR}/tools/darwin/packaging/media/ios/rounded/AppIcon50x50.png - ${CMAKE_SOURCE_DIR}/tools/darwin/packaging/media/ios/rounded/AppIcon50x50@2x.png - ${CMAKE_SOURCE_DIR}/tools/darwin/packaging/media/ios/rounded/AppIcon57x57.png - ${CMAKE_SOURCE_DIR}/tools/darwin/packaging/media/ios/rounded/AppIcon57x57@2x.png - ${CMAKE_SOURCE_DIR}/tools/darwin/packaging/media/ios/rounded/AppIcon60x60.png - ${CMAKE_SOURCE_DIR}/tools/darwin/packaging/media/ios/rounded/AppIcon60x60@2x.png - ${CMAKE_SOURCE_DIR}/tools/darwin/packaging/media/ios/rounded/AppIcon72x72.png - ${CMAKE_SOURCE_DIR}/tools/darwin/packaging/media/ios/rounded/AppIcon72x72@2x.png - ${CMAKE_SOURCE_DIR}/tools/darwin/packaging/media/ios/rounded/AppIcon76x76.png - ${CMAKE_SOURCE_DIR}/tools/darwin/packaging/media/ios/rounded/AppIcon76x76@2x.png) - -target_sources(${APP_NAME_LC} PRIVATE ${BUNDLE_RESOURCES}) -foreach(file IN LISTS BUNDLE_RESOURCES) - set_source_files_properties(${file} PROPERTIES MACOSX_PACKAGE_LOCATION .) -endforeach() - -target_sources(${APP_NAME_LC} PRIVATE ${CMAKE_SOURCE_DIR}/xbmc/platform/darwin/ios/English.lproj/InfoPlist.strings) -set_source_files_properties(${CMAKE_SOURCE_DIR}/xbmc/platform/darwin/ios/English.lproj/InfoPlist.strings PROPERTIES MACOSX_PACKAGE_LOCATION "./English.lproj") - -# Options for code signing propagated as env vars to Codesign.command via Xcode -set(IOS_CODE_SIGN_IDENTITY "" CACHE STRING "Code Sign Identity") -if(IOS_CODE_SIGN_IDENTITY) - set_target_properties(${APP_NAME_LC} PROPERTIES XCODE_ATTRIBUTE_CODE_SIGNING_REQUIRED TRUE - XCODE_ATTRIBUTE_CODE_SIGN_IDENTITY ${IOS_CODE_SIGN_IDENTITY}) -endif() - -add_custom_command(TARGET ${APP_NAME_LC} POST_BUILD - # TODO: Remove in sync with CopyRootFiles-ios expecting the ".bin" file - COMMAND ${CMAKE_COMMAND} -E copy $ - $/${APP_NAME}.bin - - COMMAND ${CMAKE_COMMAND} -E copy ${CMAKE_BINARY_DIR}/${CORE_BUILD_DIR}/DllPaths_generated.h - ${CMAKE_BINARY_DIR}/xbmc/DllPaths_generated.h - COMMAND "ACTION=build" - "TARGET_BUILD_DIR=$/.." - "TARGET_NAME=${APP_NAME}.app" - "APP_NAME=${APP_NAME}" - "PRODUCT_NAME=${APP_NAME}" - "WRAPPER_EXTENSION=app" - "SRCROOT=${CMAKE_BINARY_DIR}" - ${CMAKE_SOURCE_DIR}/tools/darwin/Support/CopyRootFiles-ios.command - COMMAND "XBMC_DEPENDS=${DEPENDS_PATH}" - "TARGET_BUILD_DIR=$/.." - "TARGET_NAME=${APP_NAME}.app" - "APP_NAME=${APP_NAME}" - "PRODUCT_NAME=${APP_NAME}" - "FULL_PRODUCT_NAME=${APP_NAME}.app" - "WRAPPER_EXTENSION=app" - "SRCROOT=${CMAKE_BINARY_DIR}" - ${CMAKE_SOURCE_DIR}/tools/darwin/Support/copyframeworks-ios.command - COMMAND "XBMC_DEPENDS=${DEPENDS_PATH}" - "NATIVEPREFIX=${NATIVEPREFIX}" - "PLATFORM_NAME=${PLATFORM}" - "CODESIGNING_FOLDER_PATH=$" - "BUILT_PRODUCTS_DIR=$/.." - "WRAPPER_NAME=${APP_NAME}.app" - "APP_NAME=${APP_NAME}" - "CURRENT_ARCH=${ARCH}" - ${CMAKE_SOURCE_DIR}/tools/darwin/Support/Codesign.command -) - -set(DEPENDS_ROOT_FOR_XCODE ${NATIVEPREFIX}/..) -configure_file(${CMAKE_SOURCE_DIR}/tools/darwin/packaging/ios/mkdeb-ios.sh.in - ${CMAKE_BINARY_DIR}/tools/darwin/packaging/ios/mkdeb-ios.sh @ONLY) -configure_file(${CMAKE_SOURCE_DIR}/tools/darwin/packaging/migrate_to_kodi_ios.sh.in - ${CMAKE_BINARY_DIR}/tools/darwin/packaging/migrate_to_kodi_ios.sh @ONLY) - -add_custom_target(deb - COMMAND sh ./mkdeb-ios.sh ${CORE_BUILD_CONFIG} - WORKING_DIRECTORY ${CMAKE_BINARY_DIR}/tools/darwin/packaging/ios) -add_dependencies(deb ${APP_NAME_LC}) - diff --git a/cmake/scripts/ios/Macros.cmake b/cmake/scripts/ios/Macros.cmake deleted file mode 120000 index 54c1b28..0000000 --- a/cmake/scripts/ios/Macros.cmake +++ /dev/null @@ -1 +0,0 @@ -../osx/Macros.cmake \ No newline at end of file diff --git a/cmake/scripts/ios/PathSetup.cmake b/cmake/scripts/ios/PathSetup.cmake deleted file mode 120000 index d7f25b2..0000000 --- a/cmake/scripts/ios/PathSetup.cmake +++ /dev/null @@ -1 +0,0 @@ -../osx/PathSetup.cmake \ No newline at end of file diff --git a/cmake/scripts/linux/ArchSetup.cmake b/cmake/scripts/linux/ArchSetup.cmake index 602ef3d..04fc6e3 100644 --- a/cmake/scripts/linux/ArchSetup.cmake +++ b/cmake/scripts/linux/ArchSetup.cmake @@ -1,8 +1,8 @@ # we always want to use GNU features if available, so set _GNU_SOURCE -set(ARCH_DEFINES -D_LINUX -DTARGET_POSIX -DTARGET_LINUX -D_GNU_SOURCE) -set(SYSTEM_DEFINES -D__STDC_CONSTANT_MACROS -D_FILE_DEFINED - -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64) +set(ARCH_DEFINES -DTARGET_POSIX -DTARGET_LINUX -D_GNU_SOURCE) +set(SYSTEM_DEFINES -D__STDC_CONSTANT_MACROS -D_FILE_OFFSET_BITS=64) set(PLATFORM_DIR platform/linux) +set(PLATFORMDEFS_DIR platform/posix) set(CMAKE_SYSTEM_NAME Linux) if(WITH_ARCH) set(ARCH ${WITH_ARCH}) @@ -84,10 +84,27 @@ endif() include(LDGOLD) include(CheckIncludeFiles) -check_include_files("linux/memfd.h" HAVE_LINUX_MEMFD) -if(HAVE_LINUX_MEMFD) - list(APPEND ARCH_DEFINES "-DHAVE_LINUX_MEMFD=1") +check_include_files("linux/udmabuf.h" HAVE_LINUX_UDMABUF) +if(HAVE_LINUX_UDMABUF) + list(APPEND ARCH_DEFINES "-DHAVE_LINUX_UDMABUF=1") +else() + message(STATUS "include/linux/udmabuf.h not found") +endif() + +check_include_files("linux/dma-heap.h" HAVE_LINUX_DMA_HEAP) +if(HAVE_LINUX_DMA_HEAP) + list(APPEND ARCH_DEFINES "-DHAVE_LINUX_DMA_HEAP=1") +else() + message(STATUS "include/linux/dma-heap.h not found") +endif() + +check_include_files("linux/dma-buf.h" HAVE_LINUX_DMA_BUF) +if(HAVE_LINUX_DMA_BUF) + list(APPEND ARCH_DEFINES "-DHAVE_LINUX_DMA_BUF=1") +else() + message(STATUS "include/linux/dma-buf.h not found") endif() + include(CheckSymbolExists) set(CMAKE_REQUIRED_DEFINITIONS "-D_GNU_SOURCE") check_symbol_exists("mkostemp" "stdlib.h" HAVE_MKOSTEMP) @@ -96,8 +113,17 @@ if(HAVE_MKOSTEMP) list(APPEND ARCH_DEFINES "-DHAVE_MKOSTEMP=1") endif() +set(CMAKE_REQUIRED_DEFINITIONS "-D_GNU_SOURCE") +check_symbol_exists("memfd_create" "sys/mman.h" HAVE_LINUX_MEMFD) +set(CMAKE_REQUIRED_DEFINITIONS "") +if(HAVE_LINUX_MEMFD) + list(APPEND ARCH_DEFINES "-DHAVE_LINUX_MEMFD=1") +else() + message(STATUS "memfd_create() not found") +endif() + # Additional SYSTEM_DEFINES -list(APPEND SYSTEM_DEFINES -DHAS_LINUX_NETWORK) +list(APPEND SYSTEM_DEFINES -DHAS_POSIX_NETWORK -DHAS_LINUX_NETWORK) # Code Coverage if(CMAKE_BUILD_TYPE STREQUAL Coverage) diff --git a/cmake/scripts/osx/ArchSetup.cmake b/cmake/scripts/osx/ArchSetup.cmake index 74f2ed4..7d8f58b 100644 --- a/cmake/scripts/osx/ArchSetup.cmake +++ b/cmake/scripts/osx/ArchSetup.cmake @@ -6,10 +6,11 @@ set(CORE_MAIN_SOURCE ${CMAKE_SOURCE_DIR}/xbmc/platform/posix/main.cpp ${CMAKE_SOURCE_DIR}/xbmc/platform/darwin/osx/SDLMain.mm ${CMAKE_SOURCE_DIR}/xbmc/platform/darwin/osx/SDLMain.h) -set(ARCH_DEFINES -D_LINUX -DTARGET_POSIX -DTARGET_DARWIN -DTARGET_DARWIN_OSX) +set(ARCH_DEFINES -DTARGET_POSIX -DTARGET_DARWIN -DTARGET_DARWIN_OSX) set(SYSTEM_DEFINES -D_REENTRANT -D_FILE_OFFSET_BITS=64 -D_LARGEFILE64_SOURCE -D__STDC_CONSTANT_MACROS) -set(PLATFORM_DIR platform/linux) +set(PLATFORM_DIR platform/darwin) +set(PLATFORMDEFS_DIR platform/posix) set(CMAKE_SYSTEM_NAME Darwin) if(WITH_ARCH) set(ARCH ${WITH_ARCH}) @@ -23,7 +24,7 @@ else() endif() # Additional SYSTEM_DEFINES -list(APPEND SYSTEM_DEFINES -DHAS_LINUX_NETWORK -DHAS_SDL -DHAS_ZEROCONF) +list(APPEND SYSTEM_DEFINES -DHAS_POSIX_NETWORK -DHAS_OSX_NETWORK -DHAS_SDL -DHAS_ZEROCONF) list(APPEND CMAKE_SYSTEM_PREFIX_PATH ${NATIVEPREFIX}) @@ -32,7 +33,10 @@ list(APPEND DEPLIBS "-framework DiskArbitration" "-framework IOKit" "-framework ApplicationServices" "-framework AppKit" "-framework CoreAudio" "-framework AudioToolbox" "-framework CoreGraphics" "-framework CoreMedia" - "-framework VideoToolbox") + "-framework VideoToolbox" "-framework Security") -set(CMAKE_OSX_DEPLOYMENT_TARGET 10.9) +set(CMAKE_OSX_DEPLOYMENT_TARGET 10.13) set(CMAKE_XCODE_ATTRIBUTE_CLANG_LINK_OBJC_RUNTIME OFF) + +include(cmake/scripts/darwin/Macros.cmake) +enable_arc() diff --git a/cmake/scripts/osx/Install.cmake b/cmake/scripts/osx/Install.cmake index 77c771c..aca31b4 100644 --- a/cmake/scripts/osx/Install.cmake +++ b/cmake/scripts/osx/Install.cmake @@ -22,6 +22,7 @@ add_custom_target(bundle "APP_NAME=${APP_NAME}" "FULL_PRODUCT_NAME=${APP_NAME}.app" "SRCROOT=${CMAKE_BINARY_DIR}" + "PYTHON_VERSION=${PYTHON_VERSION}" ${CMAKE_SOURCE_DIR}/tools/darwin/Support/copyframeworks-osx.command) set_target_properties(bundle PROPERTIES FOLDER "Build Utilities") add_dependencies(bundle ${APP_NAME_LC}) diff --git a/cmake/scripts/osx/Macros.cmake b/cmake/scripts/osx/Macros.cmake index 52f87d1..251cc79 100644 --- a/cmake/scripts/osx/Macros.cmake +++ b/cmake/scripts/osx/Macros.cmake @@ -20,7 +20,7 @@ function(core_link_library lib wraplib) # iOS: EFFECTIVE_PLATFORM_NAME is not resolved # http://public.kitware.com/pipermail/cmake/2016-March/063049.html - if(CORE_SYSTEM_NAME STREQUAL ios AND CMAKE_GENERATOR STREQUAL Xcode) + if(CORE_SYSTEM_NAME STREQUAL darwin_embedded) get_target_property(dir ${lib} BINARY_DIR) set(link_lib ${dir}/${CORE_BUILD_CONFIG}/${CMAKE_STATIC_LIBRARY_PREFIX}${lib}${CMAKE_STATIC_LIBRARY_SUFFIX}) endif() diff --git a/cmake/scripts/windows/ArchSetup.cmake b/cmake/scripts/windows/ArchSetup.cmake index 032632c..f3628f2 100644 --- a/cmake/scripts/windows/ArchSetup.cmake +++ b/cmake/scripts/windows/ArchSetup.cmake @@ -35,7 +35,6 @@ set(MINGW_LIBS_DIR ${CMAKE_SOURCE_DIR}/${DEPS_FOLDER_RELATIVE}/mingwlibs/${ARCH} list(APPEND CMAKE_PREFIX_PATH ${MINGW_LIBS_DIR}) list(APPEND CMAKE_LIBRARY_PATH ${MINGW_LIBS_DIR}/bin) list(APPEND CMAKE_PREFIX_PATH ${DEPENDENCIES_DIR}) -set(PYTHON_INCLUDE_DIR ${DEPENDENCIES_DIR}/include/python) # -------- Compiler options --------- @@ -46,12 +45,9 @@ set(SYSTEM_DEFINES -DWIN32_LEAN_AND_MEAN -DNOMINMAX -DHAS_DX -D__STDC_CONSTANT_M -DPLT_HTTP_DEFAULT_USER_AGENT="UPnP/1.0 DLNADOC/1.50 Kodi" -DPLT_HTTP_DEFAULT_SERVER="UPnP/1.0 DLNADOC/1.50 Kodi" -DUNICODE -D_UNICODE + -DFRIBIDI_STATIC $<$:-DD3D_DEBUG_INFO>) -if(${ARCH} STREQUAL win32) - list(APPEND SYSTEM_DEFINES $<$:-D_ITERATOR_DEBUG_LEVEL=0>) -endif() - # Additional SYSTEM_DEFINES list(APPEND SYSTEM_DEFINES -DHAS_WIN32_NETWORK -DHAS_FILESYSTEM_SMB) @@ -74,7 +70,8 @@ link_directories(${DEPENDENCIES_DIR}/lib) # Additional libraries list(APPEND DEPLIBS bcrypt.lib d3d11.lib DInput8.lib DSound.lib winmm.lib Mpr.lib Iphlpapi.lib WS2_32.lib - PowrProf.lib setupapi.lib Shlwapi.lib dwmapi.lib dxguid.lib DelayImp.lib) + PowrProf.lib setupapi.lib Shlwapi.lib dwmapi.lib dxguid.lib DelayImp.lib version.lib + crypt32.lib Mfplat.lib Mfuuid.lib Strmiids.lib) # NODEFAULTLIB option set(_nodefaultlibs_RELEASE libcmt) @@ -87,7 +84,7 @@ foreach(_lib ${_nodefaultlibs_DEBUG}) endforeach() # DELAYLOAD option -set(_delayloadlibs zlib.dll libmysql.dll libxslt.dll dnssd.dll dwmapi.dll sqlite3.dll +set(_delayloadlibs zlib.dll libmariadb.dll libxslt.dll dnssd.dll dwmapi.dll sqlite3.dll d3dcompiler_47.dll) foreach(_lib ${_delayloadlibs}) set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} /DELAYLOAD:\"${_lib}\"") diff --git a/cmake/scripts/windowsstore/ArchSetup.cmake b/cmake/scripts/windowsstore/ArchSetup.cmake index 2e6d7cb..ad55a01 100644 --- a/cmake/scripts/windowsstore/ArchSetup.cmake +++ b/cmake/scripts/windowsstore/ArchSetup.cmake @@ -53,8 +53,6 @@ list(APPEND CMAKE_PREFIX_PATH ${MINGW_LIBS_DIR}) list(APPEND CMAKE_LIBRARY_PATH ${MINGW_LIBS_DIR}/bin) # dependencies list(APPEND CMAKE_PREFIX_PATH ${DEPENDENCIES_DIR}) -# for python -set(PYTHON_INCLUDE_DIR ${DEPENDENCIES_DIR}/include/python) # -------- Compiler options --------- @@ -64,22 +62,24 @@ add_options(CXX ALL_BUILDS "/wd\"4146\"") add_options(CXX ALL_BUILDS "/wd\"4251\"") add_options(CXX ALL_BUILDS "/wd\"4668\"") add_options(CXX ALL_BUILDS "/wd\"5033\"") -set(ARCH_DEFINES -D_WINDOWS -DTARGET_WINDOWS -DTARGET_WINDOWS_STORE -DXBMC_EXPORT -DMS_UWP) +set(ARCH_DEFINES -D_WINDOWS -DTARGET_WINDOWS -DTARGET_WINDOWS_STORE -DXBMC_EXPORT -DMS_UWP -DMS_STORE) if(NOT SDK_TARGET_ARCH STREQUAL arm) list(APPEND ARCH_DEFINES -D__SSE__ -D__SSE2__) endif() set(SYSTEM_DEFINES -DWIN32_LEAN_AND_MEAN -DNOMINMAX -DHAS_DX -D__STDC_CONSTANT_MACROS - -DFMT_HEADER_ONLY -DTAGLIB_STATIC -DNPT_CONFIG_ENABLE_LOGGING + -DTAGLIB_STATIC -DNPT_CONFIG_ENABLE_LOGGING -DPLT_HTTP_DEFAULT_USER_AGENT="UPnP/1.0 DLNADOC/1.50 Kodi" -DPLT_HTTP_DEFAULT_SERVER="UPnP/1.0 DLNADOC/1.50 Kodi" -DUNICODE -D_UNICODE + -DFRIBIDI_STATIC $<$:-DD3D_DEBUG_INFO>) # Additional SYSTEM_DEFINES list(APPEND SYSTEM_DEFINES -DHAS_WIN10_NETWORK) # The /MP option enables /FS by default. -set(CMAKE_CXX_FLAGS "/MP ${CMAKE_CXX_FLAGS} /EHsc /await /std:c++latest") +set(CMAKE_CXX_FLAGS "/MP ${CMAKE_CXX_FLAGS} /EHsc /await") +set(CMAKE_CXX_STANDARD 17) # Google Test needs to use shared version of runtime libraries set(gtest_force_shared_crt ON CACHE STRING "" FORCE) @@ -91,7 +91,8 @@ set(gtest_force_shared_crt ON CACHE STRING "" FORCE) link_directories(${MINGW_LIBS_DIR}/lib ${DEPENDENCIES_DIR}/lib) -list(APPEND DEPLIBS bcrypt.lib d3d11.lib WS2_32.lib dxguid.lib dloadhelper.lib WindowsApp.lib) +list(APPEND DEPLIBS bcrypt.lib d3d11.lib WS2_32.lib dxguid.lib dloadhelper.lib WindowsApp.lib + Mfplat.lib Mfuuid.lib Strmiids.lib) set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} /WINMD:NO") set(CMAKE_EXE_LINKER_FLAGS_DEBUG "${CMAKE_EXE_LINKER_FLAGS_DEBUG} /NODEFAULTLIB:msvcrt /DEBUG:FASTLINK /OPT:NOREF /OPT:NOICF") diff --git a/cmake/scripts/windowsstore/Macros.cmake b/cmake/scripts/windowsstore/Macros.cmake index de89c62..c8cb960 100644 --- a/cmake/scripts/windowsstore/Macros.cmake +++ b/cmake/scripts/windowsstore/Macros.cmake @@ -112,7 +112,7 @@ endmacro() macro(winstore_append_props target) # exclude debug dlls from packaging - set(DEBUG_DLLS zlibd.dll freetyped.dll sqlite3d.dll) + set(DEBUG_DLLS zlibd.dll) foreach(_dll ${DEBUG_DLLS}) if (DEBUG_DLLS_EXCLUDE) list(APPEND DEBUG_DLLS_EXCLUDE "\;$(BuildRootPath)/dlls/${_dll}") diff --git a/cmake/treedata/android/subdirs.txt b/cmake/treedata/android/subdirs.txt index 335c331..0c4cf88 100644 --- a/cmake/treedata/android/subdirs.txt +++ b/cmake/treedata/android/subdirs.txt @@ -3,6 +3,7 @@ xbmc/cores/VideoPlayer/Process/android cores/VideoPlayer/Process/android xbmc/input/touch input/touch xbmc/input/touch/generic input/touch/generic xbmc/media/decoderfilter media/decoderfilter +xbmc/platform/android platform/android xbmc/platform/android/activity platform/android/activity xbmc/platform/android/bionic_supplement platform/android/bionicsupplement xbmc/platform/android/filesystem platform/android/filesystem @@ -12,7 +13,7 @@ xbmc/platform/android/network platform/android/network xbmc/platform/android/peripherals platform/android/peripherals xbmc/platform/android/powermanagement platform/android/powermanagement xbmc/platform/android/storage platform/android/storage -xbmc/platform/linux platform/linux +xbmc/platform/android/utils platform/android/utils xbmc/platform/linux/peripherals platform/linux/peripherals xbmc/platform/posix platform/posix xbmc/platform/posix/filesystem platform/posix/filesystem diff --git a/cmake/treedata/common/gbm/gbm.txt b/cmake/treedata/common/gbm/gbm.txt new file mode 100644 index 0000000..113c47b --- /dev/null +++ b/cmake/treedata/common/gbm/gbm.txt @@ -0,0 +1,3 @@ +xbmc/cores/RetroPlayer/process/gbm cores/RetroPlayer/process/gbm +xbmc/cores/VideoPlayer/Process/gbm cores/VideoPlayer/Process/gbm +xbmc/windowing/gbm windowing/gbm diff --git a/cmake/treedata/common/pvr.txt b/cmake/treedata/common/pvr.txt index decdabb..74e766f 100644 --- a/cmake/treedata/common/pvr.txt +++ b/cmake/treedata/common/pvr.txt @@ -1,8 +1,12 @@ -xbmc/pvr pvr -xbmc/pvr/addons pvr/addons -xbmc/pvr/channels pvr/channels -xbmc/pvr/dialogs pvr/dialogs -xbmc/pvr/epg pvr/epg -xbmc/pvr/recordings pvr/recordings -xbmc/pvr/timers pvr/timers -xbmc/pvr/windows pvr/windows +xbmc/pvr pvr +xbmc/pvr/addons pvr/addons +xbmc/pvr/channels pvr/channels +xbmc/pvr/dialogs pvr/dialogs +xbmc/pvr/epg pvr/epg +xbmc/pvr/filesystem pvr/filesystem +xbmc/pvr/guilib pvr/guilib +xbmc/pvr/guilib/guiinfo pvr/guilib/guiinfo +xbmc/pvr/recordings pvr/recordings +xbmc/pvr/settings pvr/settings +xbmc/pvr/timers pvr/timers +xbmc/pvr/windows pvr/windows diff --git a/cmake/treedata/common/rbpi/rbpi.txt b/cmake/treedata/common/rbpi/rbpi.txt new file mode 100644 index 0000000..dc268e7 --- /dev/null +++ b/cmake/treedata/common/rbpi/rbpi.txt @@ -0,0 +1,2 @@ +xbmc/cores/omxplayer cores/omxplayer +xbmc/windowing/rpi windowing/rpi diff --git a/cmake/treedata/common/subdirs.txt b/cmake/treedata/common/subdirs.txt index 083e8ef..8131113 100644 --- a/cmake/treedata/common/subdirs.txt +++ b/cmake/treedata/common/subdirs.txt @@ -1,16 +1,21 @@ xbmc xbmc xbmc/addons addons +xbmc/addons/addoninfo addons_addoninfo xbmc/addons/binary-addons addons_binary-addons xbmc/addons/interfaces addons_interfaces -xbmc/addons/interfaces/Addon addons_interfaces_addon -xbmc/addons/interfaces/GUI addons_interfaces_gui -xbmc/addons/interfaces/GUI/controls addons_interfaces_gui_controls -xbmc/addons/interfaces/GUI/dialogs addons_interfaces_gui_dialogs +xbmc/addons/interfaces/gui addons_interfaces_gui +xbmc/addons/interfaces/gui/controls addons_interfaces_gui_controls +xbmc/addons/interfaces/gui/dialogs addons_interfaces_gui_dialogs xbmc/addons/kodi-addon-dev-kit/include/kodi addons_kodi-addon-dev-kit_include_kodi xbmc/addons/kodi-addon-dev-kit/include/kodi/addon-instance addons_kodi-addon-dev-kit_include_kodi_addon-instance +xbmc/addons/kodi-addon-dev-kit/include/kodi/addon-instance/pvr addons_kodi-addon-dev-kit_include_kodi_addon-instance_pvr +xbmc/addons/kodi-addon-dev-kit/include/kodi/c-api addons_kodi-addon-dev-kit_include_kodi_c-api +xbmc/addons/kodi-addon-dev-kit/include/kodi/c-api/addon-instance addons_kodi-addon-dev-kit_include_kodi_c-api_addon-instance +xbmc/addons/kodi-addon-dev-kit/include/kodi/c-api/addon-instance/pvr addons_kodi-addon-dev-kit_include_kodi_c-api_addon-instance_pvr xbmc/addons/kodi-addon-dev-kit/include/kodi/gui addons_kodi-addon-dev-kit_include_kodi_gui xbmc/addons/kodi-addon-dev-kit/include/kodi/gui/controls addons_kodi-addon-dev-kit_include_kodi_gui_controls xbmc/addons/kodi-addon-dev-kit/include/kodi/gui/dialogs addons_kodi-addon-dev-kit_include_kodi_gui_dialogs +xbmc/addons/kodi-addon-dev-kit/include/kodi/gui/gl addons_kodi-addon-dev-kit_include_kodi_gui_gl xbmc/addons/kodi-addon-dev-kit/include/kodi/tools addons_kodi-addon-dev-kit_include_kodi_tools xbmc/addons/settings addons_settings xbmc/commons commons diff --git a/cmake/treedata/common/tests.txt b/cmake/treedata/common/tests.txt index 415eae6..9573812 100644 --- a/cmake/treedata/common/tests.txt +++ b/cmake/treedata/common/tests.txt @@ -5,6 +5,7 @@ xbmc/interfaces/python/test test/python xbmc/music/tags/test test/music_tags xbmc/network/test test/network xbmc/playlists/test test/playlists +xbmc/pvr/channels/test test/pvrchannels xbmc/test test xbmc/threads/test test/threads xbmc/utils/test test/utils diff --git a/cmake/treedata/common/videoplayer.txt b/cmake/treedata/common/videoplayer.txt index ce6a757..8110f08 100644 --- a/cmake/treedata/common/videoplayer.txt +++ b/cmake/treedata/common/videoplayer.txt @@ -1,4 +1,5 @@ xbmc/cores/VideoPlayer cores/VideoPlayer +xbmc/cores/VideoPlayer/Buffers cores/VideoPlayer/Buffers xbmc/cores/VideoPlayer/DVDCodecs cores/VideoPlayer/codecs xbmc/cores/VideoPlayer/DVDCodecs/Audio cores/VideoPlayer/codecs/audio xbmc/cores/VideoPlayer/DVDCodecs/Overlay cores/VideoPlayer/codecs/overlay diff --git a/cmake/treedata/common/wayland/wayland.txt b/cmake/treedata/common/wayland/wayland.txt new file mode 100644 index 0000000..bbbb14e --- /dev/null +++ b/cmake/treedata/common/wayland/wayland.txt @@ -0,0 +1,3 @@ +xbmc/cores/RetroPlayer/process/wayland cores/RetroPlayer/process/wayland +xbmc/cores/VideoPlayer/Process/wayland cores/VideoPlayer/Process/wayland +xbmc/windowing/wayland windowing/wayland diff --git a/cmake/treedata/common/x11/X.txt b/cmake/treedata/common/x11/X.txt new file mode 100644 index 0000000..548c9dd --- /dev/null +++ b/cmake/treedata/common/x11/X.txt @@ -0,0 +1,3 @@ +xbmc/cores/RetroPlayer/process/X11 cores/RetroPlayer/process/X11 +xbmc/cores/VideoPlayer/Process/X11 cores/VideoPlayer/Process/X11 +xbmc/windowing/X11 windowing/X11 diff --git a/cmake/treedata/darwin_embedded/ios/ios.txt b/cmake/treedata/darwin_embedded/ios/ios.txt new file mode 100644 index 0000000..f5d13e3 --- /dev/null +++ b/cmake/treedata/darwin_embedded/ios/ios.txt @@ -0,0 +1,2 @@ +xbmc/platform/darwin/ios platform/ios +xbmc/windowing/ios windowing/ios diff --git a/cmake/treedata/darwin_embedded/subdirs.txt b/cmake/treedata/darwin_embedded/subdirs.txt new file mode 100644 index 0000000..718c5c5 --- /dev/null +++ b/cmake/treedata/darwin_embedded/subdirs.txt @@ -0,0 +1,14 @@ +xbmc/cores/RetroPlayer/process/ios cores/RetroPlayer/process/ios +xbmc/cores/VideoPlayer/Process/ios cores/VideoPlayer/Process/ios +xbmc/input/touch input/touch +xbmc/input/touch/generic input/touch/generic +xbmc/platform/darwin platform/darwin +xbmc/platform/darwin/ios-common platform/ios-common +xbmc/platform/darwin/ios-common/network platform/ios-common/network +xbmc/platform/darwin/ios-common/peripherals platform/ios-common/peripherals +xbmc/platform/darwin/ios-common/storage platform/ios-common/storage +xbmc/platform/darwin/network platform/darwin/network +xbmc/platform/darwin/utils platform/darwin/utils +xbmc/platform/posix posix +xbmc/platform/posix/filesystem platform/posix/filesystem +xbmc/platform/posix/utils platform/posix/utils diff --git a/cmake/treedata/darwin_embedded/tvos/tvos.txt b/cmake/treedata/darwin_embedded/tvos/tvos.txt new file mode 100755 index 0000000..1335e66 --- /dev/null +++ b/cmake/treedata/darwin_embedded/tvos/tvos.txt @@ -0,0 +1,5 @@ +xbmc/platform/darwin/tvos platform/tvos +xbmc/platform/darwin/tvos/filesystem platform/darwin/tvos/filesystem +xbmc/platform/darwin/tvos/input platform/darwin/tvos/input +xbmc/platform/darwin/tvos/powermanagement platform/darwin/tvos/powermanagement +xbmc/windowing/tvos windowing/tvos diff --git a/cmake/treedata/freebsd/subdirs.txt b/cmake/treedata/freebsd/subdirs.txt index fd8ed5f..79e3462 100644 --- a/cmake/treedata/freebsd/subdirs.txt +++ b/cmake/treedata/freebsd/subdirs.txt @@ -3,13 +3,14 @@ xbmc/cores/VideoPlayer/Process/rbpi cores/VideoPlayer/Process/rbpi xbmc/input/touch input/touch xbmc/input/touch/generic input/touch/generic xbmc/platform/freebsd platform/freebsd -xbmc/platform/linux platform/linux +xbmc/platform/freebsd/network platform/freebsd/network xbmc/platform/linux/input platform/linux/input -xbmc/platform/linux/network platform/linux/network xbmc/platform/linux/peripherals platform/linux/peripherals xbmc/platform/linux/powermanagement platform/linux/powermanagement +xbmc/platform/linux/sse4 platform/linux/sse4 xbmc/platform/linux/storage platform/linux/storage xbmc/platform/posix platform/posix xbmc/platform/posix/filesystem platform/posix/filesystem +xbmc/platform/posix/network platform/posix/network xbmc/platform/posix/utils platform/posix/utils xbmc/windowing/linux windowing/linux diff --git a/cmake/treedata/ios/subdirs.txt b/cmake/treedata/ios/subdirs.txt deleted file mode 100644 index a3a03be..0000000 --- a/cmake/treedata/ios/subdirs.txt +++ /dev/null @@ -1,15 +0,0 @@ -xbmc/cores/RetroPlayer/process/ios cores/RetroPlayer/process/ios -xbmc/cores/VideoPlayer/Process/ios cores/VideoPlayer/Process/ios -xbmc/input/touch input/touch -xbmc/input/touch/generic input/touch/generic -xbmc/platform/darwin platform/darwin -xbmc/platform/darwin/ios platform/ios -xbmc/platform/darwin/ios-common platform/ios-common -xbmc/platform/darwin/network platform/darwin/network -xbmc/platform/darwin/storage platform/storage -xbmc/platform/linux platform/linux -xbmc/platform/linux/network platform/linux/network -xbmc/platform/posix posix -xbmc/platform/posix/filesystem platform/posix/filesystem -xbmc/platform/posix/utils platform/posix/utils -xbmc/windowing/ios windowing/ios diff --git a/cmake/treedata/linux/subdirs.txt b/cmake/treedata/linux/subdirs.txt index 7619e2e..51a7cbd 100644 --- a/cmake/treedata/linux/subdirs.txt +++ b/cmake/treedata/linux/subdirs.txt @@ -7,8 +7,10 @@ xbmc/platform/linux/input platform/linux/input xbmc/platform/linux/network platform/linux/network xbmc/platform/linux/peripherals platform/linux/peripherals xbmc/platform/linux/powermanagement platform/linux/powermanagement +xbmc/platform/linux/sse4 platform/linux/sse4 xbmc/platform/linux/storage platform/linux/storage xbmc/platform/posix platform/posix xbmc/platform/posix/filesystem platform/posix/filesystem +xbmc/platform/posix/network platform/posix/network xbmc/platform/posix/utils platform/posix/utils xbmc/windowing/linux windowing/linux diff --git a/cmake/treedata/linux/tests.txt b/cmake/treedata/linux/tests.txt new file mode 100644 index 0000000..3f3a3e3 --- /dev/null +++ b/cmake/treedata/linux/tests.txt @@ -0,0 +1 @@ +xbmc/platform/linux/test platform/linux/test diff --git a/cmake/treedata/optional/common/X.txt b/cmake/treedata/optional/common/X.txt deleted file mode 100644 index a250537..0000000 --- a/cmake/treedata/optional/common/X.txt +++ /dev/null @@ -1,3 +0,0 @@ -xbmc/cores/RetroPlayer/process/X11 cores/RetroPlayer/process/X11 # X -xbmc/cores/VideoPlayer/Process/X11 cores/VideoPlayer/Process/X11 # X -xbmc/windowing/X11 windowing/X11 # X diff --git a/cmake/treedata/optional/common/aml.txt b/cmake/treedata/optional/common/aml.txt deleted file mode 100644 index 09bf2db..0000000 --- a/cmake/treedata/optional/common/aml.txt +++ /dev/null @@ -1,2 +0,0 @@ -xbmc/cores/RetroPlayer/process/amlogic cores/RetroPlayer/process/amlogic # AML -xbmc/windowing/amlogic windowing/amlogic # AML diff --git a/cmake/treedata/optional/common/avahi.txt b/cmake/treedata/optional/common/avahi.txt new file mode 100644 index 0000000..41b82b9 --- /dev/null +++ b/cmake/treedata/optional/common/avahi.txt @@ -0,0 +1 @@ +xbmc/platform/linux/network/zeroconf platform/linux/network/zeroconf # AVAHI diff --git a/cmake/treedata/optional/common/gbm.txt b/cmake/treedata/optional/common/gbm.txt deleted file mode 100644 index 5d898d4..0000000 --- a/cmake/treedata/optional/common/gbm.txt +++ /dev/null @@ -1,2 +0,0 @@ -xbmc/cores/RetroPlayer/process/gbm cores/RetroPlayer/process/gbm # GBM -xbmc/windowing/gbm windowing/gbm # GBM diff --git a/cmake/treedata/optional/common/wayland.txt b/cmake/treedata/optional/common/wayland.txt deleted file mode 100644 index f8f77a6..0000000 --- a/cmake/treedata/optional/common/wayland.txt +++ /dev/null @@ -1,3 +0,0 @@ -xbmc/cores/RetroPlayer/process/wayland cores/RetroPlayer/process/wayland # WAYLANDPP -xbmc/cores/VideoPlayer/Process/wayland cores/VideoPlayer/Process/wayland # WAYLANDPP -xbmc/windowing/wayland windowing/wayland # WAYLANDPP diff --git a/cmake/treedata/osx/subdirs.txt b/cmake/treedata/osx/subdirs.txt index 943c366..fa28aa0 100644 --- a/cmake/treedata/osx/subdirs.txt +++ b/cmake/treedata/osx/subdirs.txt @@ -3,12 +3,13 @@ xbmc/cores/VideoPlayer/Process/osx cores/VideoPlayer/Process/osx xbmc/platform/darwin platform/darwin xbmc/platform/darwin/network platform/darwin/network xbmc/platform/darwin/osx platform/osx +xbmc/platform/darwin/osx/network platform/darwin/osx/network xbmc/platform/darwin/osx/peripherals platform/osx/peripherals xbmc/platform/darwin/osx/powermanagement platform/darwin/osx/powermanagement -xbmc/platform/darwin/storage platform/storage -xbmc/platform/linux platform/linux -xbmc/platform/linux/network platform/linux/network +xbmc/platform/darwin/osx/storage platform/osx/storage +xbmc/platform/darwin/utils platform/darwin/utils xbmc/platform/posix posix xbmc/platform/posix/filesystem platform/posix/filesystem +xbmc/platform/posix/network platform/posix/network xbmc/platform/posix/utils platform/posix/utils xbmc/windowing/osx windowing/osx diff --git a/cmake/treedata/windows/subdirs.txt b/cmake/treedata/windows/subdirs.txt index 0078758..c633977 100644 --- a/cmake/treedata/windows/subdirs.txt +++ b/cmake/treedata/windows/subdirs.txt @@ -1,6 +1,7 @@ xbmc/cores/RetroPlayer/process/windows cores/RetroPlayer/process/windows xbmc/cores/RetroPlayer/rendering/VideoShaders/windows cores/RetroPlayer/rendering/VideoShaders/windows xbmc/cores/VideoPlayer/Process/windows cores/VideoPlayer/Process/windows +xbmc/cores/VideoPlayer/VideoRenderers/windows cores/VideoPlayer/VideoRenderers/windows xbmc/input/touch input/touch xbmc/input/touch/generic input/touch/generic xbmc/network/mdns network/mdns diff --git a/cmake/treedata/windowsstore/subdirs.txt b/cmake/treedata/windowsstore/subdirs.txt index 0644fd2..da42566 100644 --- a/cmake/treedata/windowsstore/subdirs.txt +++ b/cmake/treedata/windowsstore/subdirs.txt @@ -1,4 +1,5 @@ xbmc/cores/VideoPlayer/Process/windows cores/VideoPlayer/Process/windows +xbmc/cores/VideoPlayer/VideoRenderers/windows cores/VideoPlayer/VideoRenderers/windows xbmc/input/touch input/touch xbmc/input/touch/generic input/touch/generic xbmc/network/mdns network/mdns -- cgit v1.2.3