فهرست منبع

Expat conversion (#78)

* Added EXPAT as a build-from-source script
* Allows pull_and_build_from_git to specify global build and generate commands.
* allows pull_and_build_from_git to work on repos which have CMakeLists.txt in a subfolder.

Signed-off-by: lawsonamzn <[email protected]>
Nicholas Lawson 3 سال پیش
والد
کامیت
ade78c2976

+ 31 - 9
Scripts/extras/pull_and_build_from_git.py

@@ -59,15 +59,26 @@ The following keys can exist at the root level or the target-platform level:
 * patch_file            : (optional) Option patch file to apply to the synced source before performing a build
 * source_path           : (optional) Option to provide a path to the project source rather than getting it from github
 * git_skip              : (optional) Option to skip all git commands, requires source_path
-
-
+* cmake_src_subfolder   : (optional) Some packages don't have a CMakeLists at the root and instead its in a subfolder.
+                                    In this case, set this to be the relative path from the src root to the folder that
+                                    contains the CMakeLists.txt.
+* cmake_generate_args_common : (optional) When used at the root, this provides a set of cmake arguments for generation which will 
+                                apply to ALL platforms and configs (appended to cmake_generate_args).
+                                Can be overriden by a specific platform by specifying it in the platform specific section.
+                                The final args will be (cmake_generate_args || cmake_generation_args_CONFIG) + cmake_generate_args_common
+* cmake_build_args_common : (optional) When used at the root, provides a set of cmake arguments for building which will apply to ALL
+                            platforms and configurations.
+                            The final args will be (cmake_build_args || cmake_build_args_CONFIG) + cmake_build_args_common
+                            `cmake --build (build folder) --config config` will automatically be supplied.
+ 
 The following keys can only exist at the target platform level as they describe the specifics for that platform.
 
 * cmake_generate_args                     : The cmake generation arguments (minus the build folder target or any configuration) for generating 
                                             the project for the platform (for all configurations). To perform specific generation commands (i.e.
                                             for situations where the generator does not support multiple configs) the key can contain the 
-                                            suffix of the configuration name (cmake_generate_args_debug, cmake_generate_args_release)
-                                            
+                                            suffix of the configuration name (cmake_generate_args_debug, cmake_generate_args_release).
+                                            For common args that should apply to every config, see cmake_generate_args_common above.
+
 * cmake_build_args                        : Additional build args to pass to cmake during the cmake build command
 
 * cmake_install_filter                    : Optional list of filename patterns to filter what is actually copied to the target package based on
@@ -223,7 +234,9 @@ class PackageInfo(object):
         self.cmake_find_template_custom_indent = _get_value("cmake_find_template_custom_indent", default=1)
         self.additional_src_files = _get_value("additional_src_files", required=False)
         self.depends_on_packages = _get_value("depends_on_packages", required=False)
-
+        self.cmake_src_subfolder = _get_value("cmake_src_subfolder")
+        self.cmake_generate_args_common = _get_value("cmake_generate_args_common")
+        self.cmake_build_args_common = _get_value("cmake_build_args_common")
         if self.cmake_find_template and self.cmake_find_source:
             raise BuildError("Bad build config file. 'cmake_find_template' and 'cmake_find_source' cannot both be set in the configuration.")            
         if not self.cmake_find_template and not self.cmake_find_source:
@@ -555,8 +568,6 @@ class BuildInfo(object):
             # Otherwise install directly to the target
             install_target_folder = self.build_install_folder
 
-        build_args = validate_args(self.platform_config.get('cmake_build_args', []))
-
         can_skip_generate = False
 
         for config in self.build_configs:
@@ -568,10 +579,18 @@ class BuildInfo(object):
                     # Can skip generate the next time since there is only 1 unique cmake generation
                     can_skip_generate = True
 
+                # if there is a cmake_generate_args_common key in the build config, then start with that.
+                if self.package_info.cmake_generate_args_common:
+                    cmake_generator_args = cmake_generator_args + self.package_info.cmake_generate_args_common
+
                 validate_args(cmake_generator_args)
 
+                cmakelists_folder = self.src_folder
+                if self.package_info.cmake_src_subfolder:
+                    cmakelists_folder = cmakelists_folder / self.package_info.cmake_src_subfolder
+
                 cmake_generate_cmd = [self.cmake_command,
-                                      '-S', str(self.src_folder.absolute()),
+                                      '-S', str(cmakelists_folder.absolute()),
                                       '-B', str(self.build_folder.name)]
 
                 if self.custom_toolchain_file:
@@ -605,6 +624,9 @@ class BuildInfo(object):
                                self.platform_config.get('cmake_build_args') or \
                                []
 
+            if self.package_info.cmake_build_args_common:
+                cmake_build_args = cmake_build_args + self.package_info.cmake_build_args_common
+
             validate_args(cmake_build_args)
 
             cmake_build_cmd = [self.cmake_command,
@@ -613,7 +635,7 @@ class BuildInfo(object):
             if custom_cmake_install:
                 cmake_build_cmd.extend(['--target', 'install'])
 
-            cmake_build_cmd.extend(build_args)
+            cmake_build_cmd.extend(cmake_build_args)
 
             call_result = subprocess.run(subp_args(cmake_build_cmd),
                                          shell=True,

+ 64 - 0
package-system/expat/Findexpat.cmake

@@ -0,0 +1,64 @@
+#
+# Copyright (c) Contributors to the Open 3D Engine Project.
+# For complete copyright and license terms please see the LICENSE at the root of this distribution.
+# 
+# SPDX-License-Identifier: Apache-2.0 OR MIT
+#
+#
+
+# the following is like an include guard:
+if (TARGET 3rdParty::expat)
+    return()
+endif()
+
+# Even though expat itself exports it as lowercase expat, older cmake (and cmake's built-in targets)
+# expect uppercase.  So we define both, for backwards compat:
+
+if (WIN32)
+    # on windows, expat adds the nonstandard 'lib' prefix and MD, dMD suffixes for 
+    # Multighreaded Dynamic CRT and debug Multithreaded Dynamic CRT
+    # We don't use the debug version since its a pure C library with no C++ and thus will
+    # not have an ITERATOR_DEBUG_LEVEL conflict
+    set(PREFIX_TO_USE "lib")
+    set(SUFFIX_TO_USE "MD.lib")
+else()
+    # on other platforms its just standard prefixes and suffix
+    set(PREFIX_TO_USE ${CMAKE_STATIC_LIBRARY_PREFIX})
+    set(SUFFIX_TO_USE ${CMAKE_STATIC_LIBRARY_SUFFIX})
+endif()
+
+set(EXPAT_LIBRARY ${CMAKE_CURRENT_LIST_DIR}/expat/lib/${PREFIX_TO_USE}expat${SUFFIX_TO_USE})
+set(expat_LIBRARY ${EXPAT_LIBRARY})
+
+set(EXPAT_INCLUDE_DIR ${CMAKE_CURRENT_LIST_DIR}/expat/include)
+set(expat_INCLUDE_DIR ${EXPAT_INCLUDE_DIR})
+
+set(EXPAT_FOUND TRUE)
+set(expat_FOUND TRUE)
+
+add_library(expat::expat STATIC IMPORTED GLOBAL)
+set_target_properties(expat::expat PROPERTIES IMPORTED_LINK_INTERFACE_LANGUAGES "C")
+set_target_properties(expat::expat PROPERTIES IMPORTED_LOCATION ${EXPAT_LIBRARY})
+target_compile_definitions(expat::expat INTERFACE XML_STATIC)
+
+if (COMMAND ly_target_include_system_directories)
+    # inside the O3DE ecosystem, this macro makes sure it works even in cmake < 3.19
+    ly_target_include_system_directories(TARGET expat::expat INTERFACE ${EXPAT_INCLUDE_DIR})
+else()
+    # outside the O3DE ecosystem, we do our best...
+    target_include_directories(expat::expat SYSTEM INTERFACE ${EXPAT_INCLUDE_DIR})
+endif()
+
+# create O3DE aliases:
+add_library(3rdParty::expat ALIAS expat::expat)
+
+# upppercase for compat:
+add_library(EXPAT::EXPAT ALIAS expat::expat)
+
+# if we're not in O3DE, it's also extremely helpful to show a message to logs that indicate that this
+# library was successfully picked up, as opposed to the system one.
+# A good way to know if you're in O3DE or not is that O3DE sets various cache variables before 
+# calling find_package, specifically, LY_VERSION_ENGINE_NAME is always set very early:
+if (NOT LY_VERSION_ENGINE_NAME)
+    message(STATUS "Using O3DE expat ${expat_VERSION} from ${CMAKE_CURRENT_LIST_DIR}")
+endif()

+ 91 - 0
package-system/expat/build_config.json

@@ -0,0 +1,91 @@
+{
+    "git_url":"https://github.com/libexpat/libexpat",
+    "git_tag":"R_2_4_2",
+    "package_name":"expat",
+    "package_version":"2.4.2-rev1",
+    "package_url":"https://libexpat.github.io/",
+    "package_license":"MIT",
+    "package_license_file":"expat/COPYING",
+    "cmake_find_source":"Findexpat.cmake",
+    "cmake_find_target":"Findexpat.cmake",
+    "cmake_src_subfolder": "expat",
+    "cmake_generate_args_common": [
+        "-DBUILD_SHARED_LIBS=0",
+        "-DCMAKE_CXX_STANDARD=17",
+        "-DEXPAT_BUILD_DOCS=OFF",
+        "-DEXPAT_BUILD_EXAMPLES=OFF",
+        "-DEXPAT_BUILD_FUZZERS=OFF",
+        "-DEXPAT_BUILD_TESTS=OFF",
+        "-DEXPAT_BUILD_TOOLS=OFF",
+        "-DEXPAT_SHARED_LIBS=OFF"
+    ],
+    "cmake_build_args_common": [
+        "--parallel"
+    ],
+    "build_configs":[
+        "Release"
+    ],
+    "Platforms":{
+        "Windows":{
+          "Windows": {
+              "custom_cmake_install": true,
+              "cmake_generate_args": [
+                  "-G",
+                  "\"Visual Studio 16 2019\""
+              ],
+              "custom_test_cmd" : [
+                "test_expat_windows.cmd"
+              ]
+          },
+          "Android": {
+            "custom_cmake_install": true,
+            "cmake_generate_args": [
+                "-G",
+                "Ninja",
+                "-DCMAKE_TOOLCHAIN_FILE=../../../../Scripts/cmake/Platform/Android/Toolchain_android.cmake"
+            ],
+            "custom_test_cmd" : [
+                "test_expat_android.cmd"
+              ]
+        }
+        },
+        "Darwin": {
+          "Mac": {
+              "custom_cmake_install": true,
+              "cmake_generate_args": [
+                  "-G",
+                  "Xcode",
+                  "-DCMAKE_TOOLCHAIN_FILE=../../../../Scripts/cmake/Platform/Mac/Toolchain_mac.cmake"
+              ],
+              "custom_test_cmd" : [
+                "./test_expat_mac.sh"
+            ]
+          },
+          "iOS" : {
+            "custom_cmake_install": true,
+            "cmake_generate_args": [
+                "-G",
+                "Xcode",
+                "-DDCMAKE_MACOSX_BUNDLE=OFF",
+                "-DCMAKE_TOOLCHAIN_FILE=../../../../Scripts/cmake/Platform/iOS/Toolchain_ios.cmake"
+            ],
+            "custom_test_cmd" : [
+              "./test_expat_ios.sh"
+            ]
+          }
+        },
+        "Linux":{
+           "Linux":{
+              "custom_cmake_install":true,
+              "cmake_generate_args": [
+                  "-G",
+                  "Unix\\ Makefiles",
+                  "-DCMAKE_C_FLAGS=-fPIC"
+              ],
+              "custom_test_cmd" : [
+                "./test_expat_linux.sh"
+              ]
+           }
+        }
+     }
+}

+ 25 - 0
package-system/expat/test/CMakeLists.txt

@@ -0,0 +1,25 @@
+#
+# Copyright (c) Contributors to the Open 3D Engine Project.
+# For complete copyright and license terms please see the LICENSE at the root of this distribution.
+# 
+# SPDX-License-Identifier: Apache-2.0 OR MIT
+#
+#
+
+cmake_minimum_required(VERSION 3.20)
+
+PROJECT(test_expat VERSION 1.0 LANGUAGES C)
+
+find_package(expat)
+
+add_executable(test_expat test_expat.c)
+
+# note that we use 3rdParty::expat here.  This will ONLY work 
+# if the O3DE version of expat is used, which is what we are testing for.
+target_link_libraries(test_expat PRIVATE 3rdParty::expat)
+
+set_target_properties(test_expat PROPERTIES
+                 XCODE_ATTRIBUTE_CODE_SIGNING_ALLOWED OFF
+                 MACOSX_BUNDLE TRUE
+                 XCODE_ATTRIBUTE_EXECUTABLE_NAME "test_expat")
+

+ 7 - 0
package-system/expat/test/example_file.xml

@@ -0,0 +1,7 @@
+<?xml version="1.0" encoding="utf-8" ?>
+<rootelement>
+    <!-- a comment in here and a utf-8 element. This is not an 
+    exhaustive self test of expat though, it has those in its own code. -->
+    <special-element>✔️</special-element>
+</rootelement>
+

+ 51 - 0
package-system/expat/test/test_expat.c

@@ -0,0 +1,51 @@
+/*
+ Copyright (c) Contributors to the Open 3D Engine Project.
+ For complete copyright and license terms please see the LICENSE at the root of this distribution.
+ 
+ SPDX-License-Identifier: Apache-2.0 OR MIT
+*/
+
+// test that the TIFF library imports correctly
+// Doesn't test much else about it.  Can be expanded if this becomes a problem in the
+// future.
+
+#include <expat.h>
+#include <stdio.h>
+
+int main()
+{
+    FILE* xmlfile = fopen("example_file.xml", "rb");
+    if (!xmlfile)
+    {
+      printf("Failed to open example_file.xml\n");
+      return 1;
+    }
+    fseek(xmlfile, 0, SEEK_END);
+    int bytes_to_read = (int)ftell(xmlfile);
+    fseek(xmlfile, 0, SEEK_SET);
+    printf("Reading %i bytes from file...\n", bytes_to_read);
+
+    char* databuf = (char*)malloc(bytes_to_read + 1);
+    if (fread(databuf, 1, bytes_to_read, xmlfile) != bytes_to_read)
+    {
+      printf("Could not read entire example_file.xml");
+      return 0;
+    }
+    databuf[bytes_to_read] = 0;
+    fclose(xmlfile);
+
+    printf("invoking EXPAT to parse\n");
+    XML_Parser parser = XML_ParserCreate(0);
+    if (XML_Parse(parser, databuf, bytes_to_read, 1) == XML_STATUS_ERROR) 
+    {
+      printf("Error during reading: %s!\n", XML_ErrorString(XML_GetErrorCode(parser)));
+      return 1;
+    }
+
+    XML_ParserFree(parser);
+
+    printf("Trivial self test SUCCEEDED - no errors from parse.\n");
+
+    return 0;
+
+}

+ 27 - 0
package-system/expat/test_expat_android.cmd

@@ -0,0 +1,27 @@
+@rem #
+@rem # Copyright (c) Contributors to the Open 3D Engine Project.
+@rem # For complete copyright and license terms please see the LICENSE at the root of this distribution.
+@rem # 
+@rem # SPDX-License-Identifier: Apache-2.0 OR MIT
+@rem #
+@rem #
+
+rmdir /S /Q  temp\build_test
+mkdir temp\build_test
+
+@rem CMAKE demands forward slashes but PACKAGE_ROOT is in native path:
+set "PACKAGE_ROOT=%PACKAGE_ROOT:\=/%"
+set "DOWNLOADED_PACKAGE_FOLDERS=%DOWNLOADED_PACKAGE_FOLDERS:\=/%"
+
+cmake -S test -B temp/build_test ^
+    -G Ninja ^
+    -DCMAKE_BUILD_TYPE=Release ^
+    -DCMAKE_TOOLCHAIN_FILE=../../../../Scripts/cmake/Platform/Android/Toolchain_android.cmake ^
+    -DCMAKE_MODULE_PATH="%DOWNLOADED_PACKAGE_FOLDERS%;%PACKAGE_ROOT%" || exit /b 1
+
+cmake --build temp/build_test --parallel || exit /b 1
+
+@rem we can't actually run this - its an android binary.  But at least the above
+@rem makes sure it links and that our Findexpat.cmake script is working.
+
+exit /b 0

+ 22 - 0
package-system/expat/test_expat_ios.sh

@@ -0,0 +1,22 @@
+#
+# Copyright (c) Contributors to the Open 3D Engine Project.
+# For complete copyright and license terms please see the LICENSE at the root of this distribution.
+# 
+# SPDX-License-Identifier: Apache-2.0 OR MIT
+#
+#
+
+rm -rf temp/build_test
+mkdir temp/build_test
+
+cmake -S test -B temp/build_test -G Xcode \
+    -DCMAKE_TOOLCHAIN_FILE=../../../../Scripts/cmake/Platform/iOS/Toolchain_ios.cmake \
+    -DCMAKE_MODULE_PATH="$PACKAGE_ROOT" || exit 1
+
+cmake --build temp/build_test --parallel --config Release || exit 1
+
+# we can't actually run it on ios, that'd require an emulator or device as well as
+# cert / signing - but we can at least make sure it compiles!
+
+exit 0
+

+ 23 - 0
package-system/expat/test_expat_linux.sh

@@ -0,0 +1,23 @@
+#
+# Copyright (c) Contributors to the Open 3D Engine Project.
+# For complete copyright and license terms please see the LICENSE at the root of this distribution.
+# 
+# SPDX-License-Identifier: Apache-2.0 OR MIT
+#
+#
+
+rm -rf temp/build_test
+mkdir temp/build_test
+
+cmake -S test -B temp/build_test -G Ninja -DCMAKE_BUILD_TYPE=Release  \
+    -DCMAKE_MODULE_PATH="$DOWNLOADED_PACKAGE_FOLDERS;$PACKAGE_ROOT" || exit 1
+
+cmake --build temp/build_test --parallel || exit 1
+
+pushd test
+
+../temp/build_test/test_expat || exit 1
+
+popd
+
+exit 0

+ 20 - 0
package-system/expat/test_expat_mac.sh

@@ -0,0 +1,20 @@
+#
+# Copyright (c) Contributors to the Open 3D Engine Project.
+# For complete copyright and license terms please see the LICENSE at the root of this distribution.
+# 
+# SPDX-License-Identifier: Apache-2.0 OR MIT
+#
+#
+
+rm -rf temp/build_test
+mkdir temp/build_test
+
+cmake -S test -B temp/build_test -G Xcode \
+    -DCMAKE_TOOLCHAIN_FILE=../../../../Scripts/cmake/Platform/Mac/Toolchain_mac.cmake \
+    -DCMAKE_MODULE_PATH="$PACKAGE_ROOT" || exit 1
+
+cmake --build temp/build_test --parallel --config Release || exit 1
+pushd test
+../temp/build_test/Release/test_expat.app/Contents/MacOS/test_expat || exit 1
+popd
+exit 0

+ 29 - 0
package-system/expat/test_expat_windows.cmd

@@ -0,0 +1,29 @@
+@rem #
+@rem # Copyright (c) Contributors to the Open 3D Engine Project.
+@rem # For complete copyright and license terms please see the LICENSE at the root of this distribution.
+@rem # 
+@rem # SPDX-License-Identifier: Apache-2.0 OR MIT
+@rem #
+@rem #
+
+setlocal
+
+rmdir /S /Q  temp\build_test
+mkdir temp\build_test
+
+@rem CMAKE demands forward slashes but PACKAGE_ROOT is in native path:
+set "PACKAGE_ROOT=%PACKAGE_ROOT:\=/%"
+set "DOWNLOADED_PACKAGE_FOLDERS=%DOWNLOADED_PACKAGE_FOLDERS:\=/%"
+
+cmake -S test -B temp/build_test ^
+    -DCMAKE_MODULE_PATH="%DOWNLOADED_PACKAGE_FOLDERS%;%PACKAGE_ROOT%" || exit /b 1
+
+cmake --build temp/build_test --parallel --config Release || exit /b 1
+cmake --build temp/build_test --parallel --config Debug || exit /b 1
+
+cd test
+
+..\temp\build_test\Release\test_expat.exe || exit /b 1
+..\temp\build_test\Debug\test_expat.exe || exit /b 1
+
+exit /b 0

+ 6 - 2
package_build_list_host_darwin.json

@@ -47,7 +47,9 @@
         "lz4-1.9.3-vcpkg-rev4-mac": "package-system/lz4/build_package_image.py --platform-name mac",
         "lz4-1.9.3-vcpkg-rev4-ios": "package-system/lz4/build_package_image.py --platform-name ios",
         "tiff-4.2.0.15-rev3-mac": "Scripts/extras/pull_and_build_from_git.py ../../package-system/tiff --platform-name Mac --package-root ../../package-system --clean",
-        "tiff-4.2.0.15-rev3-ios": "Scripts/extras/pull_and_build_from_git.py ../../package-system/tiff --platform-name iOS --package-root ../../package-system --clean"
+        "tiff-4.2.0.15-rev3-ios": "Scripts/extras/pull_and_build_from_git.py ../../package-system/tiff --platform-name iOS --package-root ../../package-system --clean",
+        "expat-2.4.2-rev1-mac": "Scripts/extras/pull_and_build_from_git.py ../../package-system/expat --platform-name Mac --package-root ../../package-system/expat/temp --clean",
+        "expat-2.4.2-rev1-ios": "Scripts/extras/pull_and_build_from_git.py ../../package-system/expat --platform-name iOS --package-root ../../package-system/expat/temp --clean"
     },
     "build_from_folder": {
         "assimp-5.0.1-rev12-mac": "package-system/assimp-mac",
@@ -95,6 +97,8 @@
         "zlib-1.2.11-rev5-mac": "package-system/zlib-mac",
         "zlib-1.2.11-rev5-ios": "package-system/zlib-ios",
         "lz4-1.9.3-vcpkg-rev4-mac": "package-system/lz4-mac",
-        "lz4-1.9.3-vcpkg-rev4-ios": "package-system/lz4-ios"
+        "lz4-1.9.3-vcpkg-rev4-ios": "package-system/lz4-ios",
+        "expat-2.4.2-rev1-mac": "package-system/expat/temp/expat-mac",
+        "expat-2.4.2-rev1-ios": "package-system/expat/temp/expat-ios"
     }
 }

+ 4 - 2
package_build_list_host_linux.json

@@ -34,7 +34,8 @@
         "mikkelsen-1.0.0.4-linux": "package-system/mikkelsen/build_package_image.py",
         "qt-5.15.2-rev5-linux": "Scripts/extras/pull_and_build_from_git.py ../../package-system/Qt --platform-name Linux --package-root ../../package-system --clean",
         "zlib-1.2.11-rev5-linux": "Scripts/extras/pull_and_build_from_git.py ../../package-system/zlib --platform-name Linux --package-root ../../package-system --clean",
-        "lz4-1.9.3-vcpkg-rev4-linux": "package-system/lz4/build_package_image.py --platform-name linux"
+        "lz4-1.9.3-vcpkg-rev4-linux": "package-system/lz4/build_package_image.py --platform-name linux",
+        "expat-2.4.2-rev1-linux": "Scripts/extras/pull_and_build_from_git.py ../../package-system/expat --platform-name Linux --package-root ../../package-system/expat/temp --clean"
     },
     "build_from_folder": {
         "assimp-5.0.1-rev12-linux": "package-system/assimp-linux",
@@ -70,6 +71,7 @@
         "xxhash-0.7.4-rev1-multiplatform": "package-system/xxhash-multiplatform",
         "qt-5.15.2-rev5-linux": "package-system/qt-linux",
         "zlib-1.2.11-rev5-linux": "package-system/zlib-linux",
-        "lz4-1.9.3-vcpkg-rev4-linux": "package-system/lz4-linux"
+        "lz4-1.9.3-vcpkg-rev4-linux": "package-system/lz4-linux",
+        "expat-2.4.2-rev1-linux": "package-system/expat/temp/expat-linux"
     }
 }

+ 7 - 3
package_build_list_host_windows.json

@@ -48,8 +48,10 @@
         "mikkelsen-1.0.0.4-android": "package-system/mikkelsen/build_package_image.py --platform android",
         "qt-5.15.2-rev4-windows": "Scripts/extras/pull_and_build_from_git.py ../../package-system/Qt --platform-name Windows --package-root ../../package-system --clean",
         "zlib-1.2.11-rev1-windows": "Scripts/extras/pull_and_build_from_git.py ../../package-system/zlib --platform-name Windows --package-root ../../package-system --clean",
-        "zlib-1.2.11-rev1-android": "Scripts/extras/pull_and_build_from_git.py ../../package-system/zlib --platform-name Android --package-root ../../package-system --clean"
-      },
+        "zlib-1.2.11-rev1-android": "Scripts/extras/pull_and_build_from_git.py ../../package-system/zlib --platform-name Android --package-root ../../package-system --clean",
+        "expat-2.4.2-rev1-windows": "Scripts/extras/pull_and_build_from_git.py ../../package-system/expat --platform-name Windows --package-root ../../package-system/expat/temp --clean",
+        "expat-2.4.2-rev1-android": "Scripts/extras/pull_and_build_from_git.py ../../package-system/expat --platform-name Android --package-root ../../package-system/expat/temp --clean"
+  },
   "build_from_folder": {
     "assimp-5.0.1-rev12-windows": "package-system/assimp-windows",
     "astc-encoder-3.2-rev2-windows": "package-system/astc-encoder-windows",
@@ -118,6 +120,8 @@
     "qt-5.15.2-rev4-windows": "package-system/qt-windows",
     "Wwise-2021.1.0.7575-rev1-multiplatform": "package-system/Wwise-multiplatform",
     "zlib-1.2.11-rev1-android": "package-system/zlib-android",
-    "zlib-1.2.11-rev1-windows": "package-system/zlib-windows"
+    "zlib-1.2.11-rev1-windows": "package-system/zlib-windows",
+    "expat-2.4.2-rev1-android": "package-system/expat/temp/expat-android",
+    "expat-2.4.2-rev1-windows": "package-system/expat/temp/expat-windows"
   }
 }