Skip to content
Open
Show file tree
Hide file tree
Changes from 11 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
package-system/Crashpad/add_o3de_handler_extensions.patch eol=lf
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

.gitattributes files can be in any folder, why not put this in a .gitattributes file in the same folder as the file it affects?

package-system/zlib/emscripten-alias-fix.patch eol=lf
5 changes: 5 additions & 0 deletions .github/workflows/build-package.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -175,6 +175,11 @@ jobs:
if: runner.os == 'Windows'
uses: ilammy/[email protected]

- name: Setup Emscripten
uses: mymindstorm/setup-emsdk@v14
with:
version: 4.0.10

- name: Setup NDK
env:
ANDROID_NDK_VERSION: 25.1.8937393
Expand Down
4 changes: 4 additions & 0 deletions Scripts/builders/vcpkgbuilder.py
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,10 @@ def tripletForPlatform(platformName: str, static: bool):
'ios': {
True: 'arm64-ios',
False: 'arm64-ios-dynamic',
},
'wasm32': {
True: 'wasm32-emscripten',
False: 'wasm32-emscripten',
}
}
try:
Expand Down
11 changes: 10 additions & 1 deletion Scripts/extras/pull_and_build_from_git.py
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,7 @@
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).
For common args that should apply to every config, see cmake_generate_args_common above.
Note : If your Target Platform is Emscripten, the generate call is wrapped by emcmake utility

* cmake_build_args : Additional build args to pass to cmake during the cmake build command

Expand Down Expand Up @@ -191,6 +192,9 @@

"""

# The platform used to target WebAssembly
EMSCRIPTEN_PLATFORM = 'Emscripten'

# The current path of this script, expected to be under '3rdPartySource/Scripts'
CURRENT_PATH = pathlib.Path(os.path.dirname(__file__)).resolve()

Expand Down Expand Up @@ -746,7 +750,12 @@ def build_and_install_cmake(self):
if self.package_info.cmake_src_subfolder:
cmakelists_folder = cmakelists_folder / self.package_info.cmake_src_subfolder

cmake_generate_cmd = [self.cmake_command,
# emcmake self configure the proper environment when targeting WebAssembly
cmake_command = self.cmake_command
Copy link
Contributor Author

@guillaume-haerinck guillaume-haerinck Jul 1, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I am unsure about this approach, we might want to setup the same environment as emcmake is doing in the configure json file. Yet this is the easiest and lowest maintenance path so I let the build system pro decide on what is best

if self.package_info.platform_name == EMSCRIPTEN_PLATFORM:
cmake_command = 'emcmake ' + self.cmake_command

cmake_generate_cmd = [cmake_command,
'-S', str(cmakelists_folder.resolve()),
'-B', str(self.build_folder.name)]

Expand Down
13 changes: 12 additions & 1 deletion package-system/Lua/build_config.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,9 @@
"CMakeLists.txt",
"LICENSE.txt"
],
"cmake_generate_args_common": [
"-DCMAKE_POLICY_VERSION_MINIMUM=3.5"
],
"cmake_build_args_common": [
"--parallel"
],
Expand All @@ -36,6 +39,14 @@
"-DCMAKE_C_FLAGS=\"-fPIC -O2 -Wall -Wextra\"",
"-DCMAKE_BUILD_TYPE=Release"
]
},
"Emscripten":{
"cmake_generate_args": [
"-G",
"Ninja",
"-DCMAKE_C_FLAGS=\"-fPIC -O2 -Wall -Wextra\"",
"-DCMAKE_BUILD_TYPE=Release"
]
}
},
"Darwin":{
Expand Down Expand Up @@ -69,7 +80,7 @@
"-DCMAKE_BUILD_TYPE=Release"
]
},
"Linux-aarch64": "@Linux"
"Linux-aarch64": "@Linux"
}
}
}
9 changes: 6 additions & 3 deletions package-system/OpenSSL/build_package_image.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ def main():
parser.add_argument(
'--platform-name',
dest='platformName',
choices=['windows', 'android', 'mac', 'ios'],
choices=['windows', 'android', 'mac', 'ios', 'wasm32'],
default=VcpkgBuilder.defaultPackagePlatformName(),
)
args = parser.parse_args()
Expand All @@ -45,20 +45,23 @@ def main():
'mac': True,
'ios': True,
'windows': True,
'wasm32': True,
}

revisionForPlatform = {
'android': 'rev2',
'mac': 'rev1',
'ios': 'rev1',
'windows': 'rev1'
'windows': 'rev1',
"wasm32": 'rev1',
}

testScriptForPlatform = {
'android' : opensslPackageSourceDir / 'test_OpenSSL_android.cmd',
'mac' : opensslPackageSourceDir / 'test_OpenSSL_mac.sh',
'ios' : opensslPackageSourceDir / 'test_OpenSSL_ios.sh',
'windows' : opensslPackageSourceDir / 'test_OpenSSL_windows.cmd'
'windows' : opensslPackageSourceDir / 'test_OpenSSL_windows.cmd',
'wasm32' : opensslPackageSourceDir / 'test_OpenSSL_wasm32.cmd'
}

with TemporaryDirectory() as tempdir:
Expand Down
9 changes: 9 additions & 0 deletions package-system/OpenSSL/test_OpenSSL_wasm32.cmd
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
@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 #

exit /b 0
9 changes: 8 additions & 1 deletion package-system/expat/build_config.json
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,8 @@
"-DEXPAT_BUILD_FUZZERS=OFF",
"-DEXPAT_BUILD_TESTS=OFF",
"-DEXPAT_BUILD_TOOLS=OFF",
"-DEXPAT_SHARED_LIBS=OFF"
"-DEXPAT_SHARED_LIBS=OFF",
"-DCMAKE_POLICY_VERSION_MINIMUM=3.5"
],
"cmake_build_args_common": [
"--parallel"
Expand Down Expand Up @@ -52,6 +53,12 @@
"custom_test_cmd" : [
"test_expat_android.cmd"
]
},
"Emscripten": {
"cmake_generate_args": [
"-G",
"Ninja"
]
}
},
"Darwin": {
Expand Down
16 changes: 16 additions & 0 deletions package-system/googletest/build_config.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,9 @@
"package_license_file":"LICENSE",
"cmake_find_template":"Findgoogletest.cmake.template",
"cmake_find_target":"Findgoogletest.cmake",
"cmake_generate_args_common": [
"-DCMAKE_POLICY_VERSION_MINIMUM=3.5"
],
"Platforms":{
"Windows":{
"Windows":{
Expand Down Expand Up @@ -59,6 +62,19 @@
"custom_additional_libraries":[

]
},
"Emscripten": {
"cmake_generate_args" : [
"-G",
"Ninja",
"-DCMAKE_CXX_FLAGS=\"-fPIC\"",
"-DCMAKE_CXX_STANDARD=17",
"-DCMAKE_BUILD_TYPE=Release"
],
"custom_additional_compile_definitions":[
"GTEST_HAS_TR1_TUPLE=0",
"GTEST_OS_SUPPORTS_DEATH_TEST=0"
]
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm under the impression that we now build googletest as an inline fetchcontent build, this package is unused. see Code\Framework\AzTest\3rdParty\Findgoogletest.cmake

}
},
"Darwin":{
Expand Down
16 changes: 16 additions & 0 deletions package-system/libsamplerate/build_config.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,9 @@
"package_license_file":"COPYING",
"cmake_find_template":"Findlibsamplerate.cmake.template",
"cmake_find_target":"Findlibsamplerate.cmake",
"cmake_generate_args_common": [
"-DCMAKE_POLICY_VERSION_MINIMUM=3.5"
],
"Platforms":{
"Windows":{
"Windows":{
Expand Down Expand Up @@ -45,6 +48,19 @@
"cmake_build_args":[
"--target samplerate"
]
},
"Emscripten":{
"build_configs":[
"Release"
],
"cmake_generate_args_release":[
"-G",
"Ninja",
"-DCMAKE_BUILD_TYPE=Release"
],
"cmake_build_args":[
"--target samplerate"
]
}
},
"Darwin":{
Expand Down
10 changes: 9 additions & 1 deletion package-system/lz4/build_config.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,8 @@
],
"cmake_generate_args_common": [
"-DBUILD_SHARED_LIBS=0",
"-DCMAKE_CXX_STANDARD=17"
"-DCMAKE_CXX_STANDARD=17",
"-DCMAKE_POLICY_VERSION_MINIMUM=3.5"
],
"cmake_build_args_common": [
"-j"
Expand All @@ -36,6 +37,13 @@
"-DCMAKE_TOOLCHAIN_FILE=../../../../Scripts/cmake/Platform/Android/Toolchain_android.cmake",
"-DCMAKE_BUILD_TYPE=Release"
]
},
"Emscripten": {
"cmake_generate_args_release": [
"-G",
"Ninja",
"-DCMAKE_BUILD_TYPE=Release"
]
}
},
"Darwin": {
Expand Down
23 changes: 23 additions & 0 deletions package-system/zlib/build_config.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,9 @@
"package_license_file":"LICENSE",
"cmake_find_source":"FindZLIB.cmake",
"cmake_find_target":"FindZLIB.cmake",
"cmake_generate_args_common": [
"-DCMAKE_POLICY_VERSION_MINIMUM=3.5"
],
"Platforms":{
"Windows":{
"Windows":{
Expand All @@ -29,6 +32,26 @@
"custom_install_cmd": [
"install_zlib_android.cmd"
]
},
"Emscripten":{
"patch_file": "emscripten-alias-fix.patch",
"cmake_generate_args" : [
"-G",
"Ninja",
"-DCMAKE_BUILD_TYPE=Release",
"-DCMAKE_CXX_STANDARD=17",
"-DBUILD_SHARED_LIBS=OFF",
"-DSKIP_INSTALL_ALL=ON"
],
"cmake_build_args": [
"--target",
"zlibstatic"
],
"extra_files_to_copy": [
["temp/build/zconf.h", "zlib/include/zconf.h"],
["temp/build/libz.a", "zlib/lib/libz.a"],
["temp/src/zlib.h", "zlib/include/zlib.h"]
]
}
},

Expand Down
13 changes: 13 additions & 0 deletions package-system/zlib/emscripten-alias-fix.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 0fe939d..0cce489 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -201,7 +201,7 @@ endif()

if(UNIX)
# On unix-like platforms the library is almost always called libz
- set_target_properties(zlib zlibstatic PROPERTIES OUTPUT_NAME z)
+ set_target_properties(zlibstatic PROPERTIES OUTPUT_NAME z)
if(NOT APPLE)
set_target_properties(zlib PROPERTIES LINK_FLAGS "-Wl,--version-script,\"${CMAKE_CURRENT_SOURCE_DIR}/zlib.map\"")
endif()
8 changes: 8 additions & 0 deletions package_build_list_host_windows.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,17 +16,20 @@
"DirectXShaderCompilerDxc-1.7.2308-o3de-rev2-windows": "Scripts/extras/pull_and_build_from_git.py ../../package-system/DirectXShaderCompiler --platform-name Windows --package-root ../../package-system --clean",
"expat-2.4.2-rev2-android": "Scripts/extras/pull_and_build_from_git.py ../../package-system/expat --platform-name Android --package-root ../../package-system/expat/temp --clean",
"expat-2.4.2-rev2-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-rev2-emscripten": "Scripts/extras/pull_and_build_from_git.py ../../package-system/expat --platform-name Emscripten --package-root ../../package-system/expat/temp --clean",
"freetype-2.11.1-rev1-android": "Scripts/extras/pull_and_build_from_git.py ../../package-system/freetype --platform-name Android --package-root ../../package-system/freetype/temp --clean",
"freetype-2.11.1-rev1-windows": "Scripts/extras/pull_and_build_from_git.py ../../package-system/freetype --platform-name Windows --package-root ../../package-system/freetype/temp --clean",
"googlebenchmark-1.7.0-rev2-android": "Scripts/extras/pull_and_build_from_git.py ../../package-system/googlebenchmark --platform-name Android --package-root ../../package-system --clean",
"googlebenchmark-1.7.0-rev1-windows": "Scripts/extras/pull_and_build_from_git.py ../../package-system/googlebenchmark --platform-name Windows --package-root ../../package-system --clean",
"googletest-1.8.1-rev4-android": "Scripts/extras/pull_and_build_from_git.py ../../package-system/googletest --platform-name Android --package-root ../../package-system --clean",
"googletest-1.8.1-rev4-windows": "Scripts/extras/pull_and_build_from_git.py ../../package-system/googletest --platform-name Windows --package-root ../../package-system --clean",
"googletest-1.8.1-rev4-emscripten": "Scripts/extras/pull_and_build_from_git.py ../../package-system/googletest --platform-name Emscripten --package-root ../../package-system --clean",
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As above.. you can do this, but the engine doesn't use it.

"ISPCTexComp-36b80aa-rev1-windows": "package-system/ISPCTexComp/build_package_image.py",
"libsamplerate-0.2.1-rev2-android": "Scripts/extras/pull_and_build_from_git.py ../../package-system/libsamplerate --platform-name Android --package-root ../../package-system --custom-toolchain-file ../../Scripts/cmake/Platform/Android/Toolchain_android.cmake --clean",
"libsamplerate-0.2.1-rev2-windows": "Scripts/extras/pull_and_build_from_git.py ../../package-system/libsamplerate --platform-name Windows --package-root ../../package-system --clean",
"Lua-5.4.4-rev1-android": "Scripts/extras/pull_and_build_from_git.py ../../package-system/Lua --platform-name Android --package-root ../../package-system/Lua/temp --clean",
"Lua-5.4.4-rev1-windows": "Scripts/extras/pull_and_build_from_git.py ../../package-system/Lua --platform-name Windows --package-root ../../package-system/Lua/temp --clean",
"Lua-5.4.4-rev1-emscripten": "Scripts/extras/pull_and_build_from_git.py ../../package-system/Lua --platform-name Emscripten --package-root ../../package-system/Lua/temp --clean",
"lz4-1.9.4-rev1-android": "Scripts/extras/pull_and_build_from_git.py ../../package-system/lz4 --platform-name Android --package-root ../../package-system/lz4/temp --clean",
"lz4-1.9.4-rev1-windows": "Scripts/extras/pull_and_build_from_git.py ../../package-system/lz4 --platform-name Windows --package-root ../../package-system/lz4/temp --clean",
"mcpp-2.7.2_az.2-rev1-windows": "package-system/mcpp/get_and_build_mcpp.py mcpp-2.7.2_az.2-rev1",
Expand Down Expand Up @@ -62,6 +65,7 @@
"vulkan-validationlayers-1.3.261-rev1-windows": "Scripts/extras/pull_and_build_from_git.py ../../package-system/vulkan-validationlayers --platform-name Windows --package-root ../../package-system --clean",
"vulkan-validationlayers-1.3.261-rev1-android": "Scripts/extras/pull_and_build_from_git.py ../../package-system/vulkan-validationlayers --platform-name Android --package-root ../../package-system --clean",
"zlib-1.2.11-rev5-android": "Scripts/extras/pull_and_build_from_git.py ../../package-system/zlib --platform-name Android --package-root ../../package-system --clean",
"zlib-1.2.11-rev5-emscripten": "Scripts/extras/pull_and_build_from_git.py ../../package-system/zlib --platform-name Emscripten --package-root ../../package-system --clean",
"zlib-1.2.11-rev5-windows": "Scripts/extras/pull_and_build_from_git.py ../../package-system/zlib --platform-name Windows --package-root ../../package-system --clean"
},
"build_from_folder": {
Expand All @@ -81,13 +85,15 @@
"d3dx12-headers-rev1-windows": "package-system/d3dx12-windows",
"expat-2.4.2-rev2-android": "package-system/expat/temp/expat-android",
"expat-2.4.2-rev2-windows": "package-system/expat/temp/expat-windows",
"expat-2.4.2-rev2-emscripten": "package-system/expat/temp/expat-emscripten",
"freetype-2.11.1-rev1-android": "package-system/freetype/temp/freetype-android",
"freetype-2.11.1-rev1-windows": "package-system/freetype/temp/freetype-windows",
"glad-2.0.0-beta-rev2-multiplatform": "package-system/glad-multiplatform",
"googlebenchmark-1.7.0-rev2-android": "package-system/googlebenchmark-android",
"googlebenchmark-1.7.0-rev1-windows": "package-system/googlebenchmark-windows",
"googletest-1.8.1-rev4-android": "package-system/googletest-android",
"googletest-1.8.1-rev4-windows": "package-system/googletest-windows",
"googletest-1.8.1-rev4-emscripten": "package-system/googletest-emscripten",
"hdf5-1.0.11-rev2-multiplatform": "package-system/hdf5-multiplatform",
"ISPCTexComp-36b80aa-rev1-windows": "package-system/ISPCTexComp-windows",
"libsamplerate-0.2.1-rev2-android": "package-system/libsamplerate-android",
Expand All @@ -96,6 +102,7 @@
"lz4-1.9.4-rev1-windows": "package-system/lz4/temp/lz4-windows",
"Lua-5.4.4-rev1-android": "package-system/Lua/temp/Lua-android",
"Lua-5.4.4-rev1-windows": "package-system/Lua/temp/Lua-windows",
"Lua-5.4.4-rev1-emscripten": "package-system/Lua/temp/Lua-emscripten",
"lux_core-2.2-rev5-multiplatform": "package-system/luxcore-multiplatform",
"mcpp-2.7.2_az.2-rev1-windows": "package-system/mcpp-windows",
"md5-2.0-multiplatform": "package-system/md5-multiplatform",
Expand Down Expand Up @@ -135,6 +142,7 @@
"xxhash-0.7.4-rev1-multiplatform": "package-system/xxhash-multiplatform",
"zlib-1.2.11-rev5-android": "package-system/zlib-android",
"zlib-1.2.11-rev5-windows": "package-system/zlib-windows",
"zlib-1.2.11-rev5-emscripten": "package-system/zlib-emscripten",
"zstd-1.35-multiplatform": "package-system/zstd-multiplatform"
}
}
Loading