presets: Require hostTargetTriple macro expansion in CMakePresets.json
Some cross-platform workflows are not possible in cmake because of the unavailability of target triple in CMakePresets.json.
For example when finding the emsdk for the current host platform, we are currently specifying
${sourceDir}/out/.sysroot/x86_64-apple-darwin/lib/emsdk/upstream/emscripten/cmake/Modules/Platform/Emscripten.cmake
and for M1, we are changing the x86_64
part to arm64
everytime in the CMakePresets.json itself.
This can have been simplified if something like ${hostTargetTriple}
is available.
${sourceDir}/out/.sysroot/${hostTargetTriple}/lib/emsdk/upstream/emscripten/cmake/Modules/Platform/Emscripten.cmake
If target triple is not a style of CMake, then the following should do the trick to find the path of emsdk, but unfortunately there is no macro expansion for hostSystemArchitecture
and hostVendorName
${hostSystemArchitecture}-${hostVendorName}-${hostSystemName}