diff options
author | fuzzard <fuzzard@kodi.tv> | 2022-03-23 19:50:07 +1000 |
---|---|---|
committer | fuzzard <fuzzard@kodi.tv> | 2022-03-26 14:15:12 +1000 |
commit | e4e02a33e4fea6ad807451e5d4704d443d439b95 (patch) | |
tree | a3384364250f5d9b05a7c55c712852f6cb83e7f4 | |
parent | 30487801f7bd2a337a4bc904bbb7e8381483f3be (diff) |
[cmake] ENABLE_INTERNAL_RapidJSON for all platforms
header only lib, so enable "build" for all platforms
patches remove superfluous docs/examples
win arm64 patch for endian define.
-rw-r--r-- | CMakeLists.txt | 3 | ||||
-rw-r--r-- | cmake/modules/FindRapidJSON.cmake | 19 | ||||
-rw-r--r-- | project/BuildDependencies/scripts/0_package.target-win10-arm.list | 1 | ||||
-rw-r--r-- | project/BuildDependencies/scripts/0_package.target-win10-win32.list | 1 | ||||
-rw-r--r-- | project/BuildDependencies/scripts/0_package.target-win10-x64.list | 1 | ||||
-rw-r--r-- | project/BuildDependencies/scripts/0_package.target-win32.list | 1 | ||||
-rw-r--r-- | project/BuildDependencies/scripts/0_package.target-x64.list | 1 | ||||
-rw-r--r-- | tools/depends/target/Makefile | 1 | ||||
-rw-r--r-- | tools/depends/target/rapidjson/001-remove_custom_cxx_flags.patch (renamed from tools/depends/target/rapidjson/0001-remove_custom_cxx_flags.patch) | 0 | ||||
-rw-r--r-- | tools/depends/target/rapidjson/002-cmake-removedocs-examples.patch | 28 | ||||
-rw-r--r-- | tools/depends/target/rapidjson/003-win-arm64.patch | 11 | ||||
-rw-r--r-- | tools/depends/target/rapidjson/Makefile | 8 |
12 files changed, 59 insertions, 16 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt index db9f62dc4b..e4653d8a97 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -59,9 +59,10 @@ option(ENABLE_TESTING "Enable testing support?" ON) option(ENABLE_INTERNAL_CROSSGUID "Enable internal crossguid?" ON) # use ffmpeg from depends or system option(ENABLE_INTERNAL_FFMPEG "Enable internal ffmpeg?" OFF) +option(ENABLE_INTERNAL_RapidJSON "Enable internal rapidjson?" ON) + if(UNIX) option(FFMPEG_PATH "Path to external ffmpeg?" "") - option(ENABLE_INTERNAL_RapidJSON "Enable internal rapidjson?" OFF) option(ENABLE_INTERNAL_FMT "Enable internal fmt?" OFF) option(ENABLE_INTERNAL_FSTRCMP "Enable internal fstrcmp?" OFF) option(ENABLE_INTERNAL_FLATBUFFERS "Enable internal flatbuffers?" OFF) diff --git a/cmake/modules/FindRapidJSON.cmake b/cmake/modules/FindRapidJSON.cmake index e3943f5b32..19c54b41a1 100644 --- a/cmake/modules/FindRapidJSON.cmake +++ b/cmake/modules/FindRapidJSON.cmake @@ -15,23 +15,28 @@ if(ENABLE_INTERNAL_RapidJSON) SETUP_BUILD_VARS() - if(APPLE) - set(EXTRA_ARGS "-DCMAKE_OSX_ARCHITECTURES=${CMAKE_OSX_ARCHITECTURES}") - endif() - set(RapidJSON_INCLUDE_DIR ${${MODULE}_INCLUDE_DIR}) set(RapidJSON_VERSION ${${MODULE}_VER}) + # Use custom findpatch to handle windows patch binary if not available + include(cmake/modules/FindPatch.cmake) + + set(PATCH_COMMAND ${PATCH_EXECUTABLE} -p1 -i ${CORE_SOURCE_DIR}/tools/depends/target/rapidjson/001-remove_custom_cxx_flags.patch + COMMAND ${PATCH_EXECUTABLE} -p1 -i ${CORE_SOURCE_DIR}/tools/depends/target/rapidjson/002-cmake-removedocs-examples.patch + COMMAND ${PATCH_EXECUTABLE} -p1 -i ${CORE_SOURCE_DIR}/tools/depends/target/rapidjson/003-win-arm64.patch) + set(CMAKE_ARGS -DCMAKE_INSTALL_PREFIX=${CMAKE_BINARY_DIR}/${CORE_BUILD_DIR} -DRAPIDJSON_BUILD_DOC=OFF -DRAPIDJSON_BUILD_EXAMPLES=OFF -DRAPIDJSON_BUILD_TESTS=OFF - -DRAPIDJSON_BUILD_THIRDPARTY_GTEST=OFF - "${EXTRA_ARGS}") - set(PATCH_COMMAND patch -p1 < ${CORE_SOURCE_DIR}/tools/depends/target/rapidjson/0001-remove_custom_cxx_flags.patch) + -DRAPIDJSON_BUILD_THIRDPARTY_GTEST=OFF) + set(BUILD_BYPRODUCTS ${CMAKE_BINARY_DIR}/${CORE_BUILD_DIR}/include/rapidjson/rapidjson.h) BUILD_DEP_TARGET() + + # Add dependency to libkodi to build + set_property(GLOBAL APPEND PROPERTY INTERNAL_DEPS_PROP rapidjson) else() if(PKG_CONFIG_FOUND) pkg_check_modules(PC_RapidJSON RapidJSON>=1.0.2 QUIET) diff --git a/project/BuildDependencies/scripts/0_package.target-win10-arm.list b/project/BuildDependencies/scripts/0_package.target-win10-arm.list index 7d78f86749..af2cb9acc1 100644 --- a/project/BuildDependencies/scripts/0_package.target-win10-arm.list +++ b/project/BuildDependencies/scripts/0_package.target-win10-arm.list @@ -35,7 +35,6 @@ pcre-8.43-win10-arm-v141-20200105.7z pillow-6.2.1-win10-arm-v142-20200803.7z pycryptodome-3.9.4-win10-arm-v142-20200803.7z python-3.8.5-win10-arm-v142-20210211.7z -rapidjson-1.1.0-20200105.7z spdlog-1.5.0-win10-arm-v141-20200320-2.7z sqlite-3300100-win10-arm-v141-20200105.7z taglib-1.11.1-win10-arm-v141-20200105.7z diff --git a/project/BuildDependencies/scripts/0_package.target-win10-win32.list b/project/BuildDependencies/scripts/0_package.target-win10-win32.list index 1c723e17eb..69fbf046e0 100644 --- a/project/BuildDependencies/scripts/0_package.target-win10-win32.list +++ b/project/BuildDependencies/scripts/0_package.target-win10-win32.list @@ -35,7 +35,6 @@ pcre-8.43-win10-win32-v141-20200105.7z pillow-6.2.1-win10-win32-v142-20200803.7z pycryptodome-3.9.4-win10-win32-v142-20200803.7z python-3.8.5-win10-win32-v142-20210211.7z -rapidjson-1.1.0-20200105.7z spdlog-1.5.0-win10-win32-v141-20200320-2.7z sqlite-3300100-win10-win32-v141-20200105.7z taglib-1.11.1-win10-win32-v141-20200105.7z diff --git a/project/BuildDependencies/scripts/0_package.target-win10-x64.list b/project/BuildDependencies/scripts/0_package.target-win10-x64.list index bf3a5b624d..f89ff6dc14 100644 --- a/project/BuildDependencies/scripts/0_package.target-win10-x64.list +++ b/project/BuildDependencies/scripts/0_package.target-win10-x64.list @@ -35,7 +35,6 @@ pcre-8.43-win10-x64-v141-20200105.7z pillow-6.2.1-win10-x64-v142-20200803.7z pycryptodome-3.9.4-win10-x64-v142-20200803.7z python-3.8.5-win10-x64-v142-20210211.7z -rapidjson-1.1.0-20200105.7z spdlog-1.5.0-win10-x64-v141-20200320.7z sqlite-3300100-win10-x64-v141-20200105.7z taglib-1.11.1-win10-x64-v141-20200105.7z diff --git a/project/BuildDependencies/scripts/0_package.target-win32.list b/project/BuildDependencies/scripts/0_package.target-win32.list index a671e6af03..6f8f9fb00d 100644 --- a/project/BuildDependencies/scripts/0_package.target-win32.list +++ b/project/BuildDependencies/scripts/0_package.target-win32.list @@ -42,7 +42,6 @@ pcre-8.43-win32-v141-20200105.7z pillow-6.2.1-win32-v142-20200803.7z pycryptodome-3.9.4-win32-v142-20200803.7z python-3.8.5-win32-v142-20210211.7z -rapidjson-1.1.0-20200105.7z shairplay-ce80e00-win32-v141-20200105.7z spdlog-1.5.0-win32-v141-20200320-2.7z sqlite-3300100-win32-v141-20200105.7z diff --git a/project/BuildDependencies/scripts/0_package.target-x64.list b/project/BuildDependencies/scripts/0_package.target-x64.list index 87a4c302f4..c2fc393b6b 100644 --- a/project/BuildDependencies/scripts/0_package.target-x64.list +++ b/project/BuildDependencies/scripts/0_package.target-x64.list @@ -39,7 +39,6 @@ pcre-8.43-x64-v141-20200105.7z pillow-6.2.1-x64-v142-20200803.7z pycryptodome-3.9.4-x64-v142-20200803.7z python-3.8.5-x64-v142-20210211.7z -rapidjson-1.1.0-20200105.7z shairplay-ce80e00-x64-v141-20200105.7z spdlog-1.5.0-x64-v141-20200320.7z sqlite-3300100-x64-v141-20200105.7z diff --git a/tools/depends/target/Makefile b/tools/depends/target/Makefile index 28a1533b18..1695a975e1 100644 --- a/tools/depends/target/Makefile +++ b/tools/depends/target/Makefile @@ -52,7 +52,6 @@ DEPENDS = \ pythonmodule-pil \ pythonmodule-pycryptodome \ pythonmodule-setuptools \ - rapidjson \ spdlog \ sqlite3 \ taglib \ diff --git a/tools/depends/target/rapidjson/0001-remove_custom_cxx_flags.patch b/tools/depends/target/rapidjson/001-remove_custom_cxx_flags.patch index c923c76380..c923c76380 100644 --- a/tools/depends/target/rapidjson/0001-remove_custom_cxx_flags.patch +++ b/tools/depends/target/rapidjson/001-remove_custom_cxx_flags.patch diff --git a/tools/depends/target/rapidjson/002-cmake-removedocs-examples.patch b/tools/depends/target/rapidjson/002-cmake-removedocs-examples.patch new file mode 100644 index 0000000000..4bf06da59c --- /dev/null +++ b/tools/depends/target/rapidjson/002-cmake-removedocs-examples.patch @@ -0,0 +1,28 @@ +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -134,14 +134,17 @@ + COMPONENT pkgconfig) + ENDIF() + ++if(RAPIDJSON_BUILD_DOC) + install(FILES readme.md + DESTINATION "${DOC_INSTALL_DIR}" + COMPONENT doc) ++endif() + + install(DIRECTORY include/rapidjson + DESTINATION "${INCLUDE_INSTALL_DIR}" + COMPONENT dev) + ++if(RAPIDJSON_BUILD_EXAMPLES) + install(DIRECTORY example/ + DESTINATION "${DOC_INSTALL_DIR}/examples" + COMPONENT examples +@@ -150,6 +153,7 @@ + PATTERN "CMakeFiles" EXCLUDE + PATTERN "Makefile" EXCLUDE + PATTERN "cmake_install.cmake" EXCLUDE) ++endif() + + # Provide config and version files to be used by other applications + # =============================== diff --git a/tools/depends/target/rapidjson/003-win-arm64.patch b/tools/depends/target/rapidjson/003-win-arm64.patch new file mode 100644 index 0000000000..2d045dcaf6 --- /dev/null +++ b/tools/depends/target/rapidjson/003-win-arm64.patch @@ -0,0 +1,11 @@ +--- a/include/rapidjson/rapidjson.h ++++ b/include/rapidjson/rapidjson.h +@@ -236,7 +236,7 @@ + # define RAPIDJSON_ENDIAN RAPIDJSON_BIGENDIAN + # elif defined(__i386__) || defined(__alpha__) || defined(__ia64) || defined(__ia64__) || defined(_M_IX86) || defined(_M_IA64) || defined(_M_ALPHA) || defined(__amd64) || defined(__amd64__) || defined(_M_AMD64) || defined(__x86_64) || defined(__x86_64__) || defined(_M_X64) || defined(__bfin__) + # define RAPIDJSON_ENDIAN RAPIDJSON_LITTLEENDIAN +-# elif defined(_MSC_VER) && defined(_M_ARM) ++# elif defined(_MSC_VER) && (defined(_M_ARM) || defined(_M_ARM64)) + # define RAPIDJSON_ENDIAN RAPIDJSON_LITTLEENDIAN + # elif defined(RAPIDJSON_DOXYGEN_RUNNING) + # define RAPIDJSON_ENDIAN diff --git a/tools/depends/target/rapidjson/Makefile b/tools/depends/target/rapidjson/Makefile index 565a97ac2f..050f7eebc6 100644 --- a/tools/depends/target/rapidjson/Makefile +++ b/tools/depends/target/rapidjson/Makefile @@ -1,6 +1,8 @@ -include ../../Makefile.include include RAPIDJSON-VERSION -DEPS = Makefile RAPIDJSON-VERSION 0001-remove_custom_cxx_flags.patch ../../download-files.include +DEPS = Makefile RAPIDJSON-VERSION 001-remove_custom_cxx_flags.patch ../../download-files.include \ + 002-cmake-removedocs-examples.patch \ + 003-win-arm64.patch CMAKE_OPTIONS=-DRAPIDJSON_HAS_STDSTRING=ON -DRAPIDJSON_BUILD_DOC=OFF -DRAPIDJSON_BUILD_EXAMPLES=OFF -DRAPIDJSON_BUILD_TESTS=OFF -DRAPIDJSON_BUILD_THIRDPARTY_GTEST=OFF @@ -39,7 +41,9 @@ endif rm -rf $(PLATFORM); mkdir -p $(PLATFORM) cd $(PLATFORM); $(ARCHIVE_TOOL) $(ARCHIVE_TOOL_FLAGS) $(TARBALLS_LOCATION)/$(ARCHIVE) cd $(PLATFORM); rm -rf build; mkdir -p build - cd $(PLATFORM); patch -p1 -i ../0001-remove_custom_cxx_flags.patch + cd $(PLATFORM); patch -p1 -i ../001-remove_custom_cxx_flags.patch + cd $(PLATFORM); patch -p1 -i ../002-cmake-removedocs-examples.patch + cd $(PLATFORM); patch -p1 -i ../003-win-arm64.patch cd $(PLATFORM)/build; $(CMAKE) $(CMAKE_OPTIONS) .. .installed-$(PLATFORM): $(PLATFORM) |