Skip to content
Open
Show file tree
Hide file tree
Changes from 1 commit
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
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
10 changes: 9 additions & 1 deletion package-system/Lua/build_config.json
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,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 +77,7 @@
"-DCMAKE_BUILD_TYPE=Release"
]
},
"Linux-aarch64": "@Linux"
"Linux-aarch64": "@Linux"
}
}
}
2 changes: 2 additions & 0 deletions package_build_list_host_windows.json
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@
"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 @@ -96,6 +97,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
Loading