mirror of
https://github.com/saymrwulf/onnxruntime.git
synced 2026-06-22 02:30:26 +00:00
update
This commit is contained in:
parent
db5a3768d2
commit
c2cebbe963
3 changed files with 69 additions and 5 deletions
32
cmake/vcpkg-triplets/default/wasm32-emscripten.cmake
Normal file
32
cmake/vcpkg-triplets/default/wasm32-emscripten.cmake
Normal file
|
|
@ -0,0 +1,32 @@
|
|||
# Copyright (c) Microsoft Corporation. All rights reserved.
|
||||
# Licensed under the MIT License.
|
||||
set(VCPKG_ENV_PASSTHROUGH_UNTRACKED EMSCRIPTEN_ROOT EMSDK PATH)
|
||||
|
||||
if(NOT DEFINED ENV{EMSCRIPTEN_ROOT})
|
||||
find_path(EMSCRIPTEN_ROOT "emcc")
|
||||
else()
|
||||
set(EMSCRIPTEN_ROOT "$ENV{EMSCRIPTEN_ROOT}")
|
||||
endif()
|
||||
|
||||
if(NOT EMSCRIPTEN_ROOT)
|
||||
if(NOT DEFINED ENV{EMSDK})
|
||||
message(FATAL_ERROR "The emcc compiler not found in PATH")
|
||||
endif()
|
||||
set(EMSCRIPTEN_ROOT "$ENV{EMSDK}/upstream/emscripten")
|
||||
endif()
|
||||
|
||||
if(NOT EXISTS "${EMSCRIPTEN_ROOT}/cmake/Modules/Platform/Emscripten.cmake")
|
||||
message(FATAL_ERROR "Emscripten.cmake toolchain file not found")
|
||||
endif()
|
||||
|
||||
set(VCPKG_CRT_LINKAGE dynamic)
|
||||
set(VCPKG_LIBRARY_LINKAGE static)
|
||||
set(VCPKG_CMAKE_SYSTEM_NAME Emscripten)
|
||||
set(VCPKG_CHAINLOAD_TOOLCHAIN_FILE "${EMSCRIPTEN_ROOT}/cmake/Modules/Platform/Emscripten.cmake")
|
||||
set(VCPKG_TARGET_ARCHITECTURE wasm32)
|
||||
set(VCPKG_C_FLAGS "-ffunction-sections -fdata-sections -msimd128 -pthread -Wno-pthreads-mem-growth")
|
||||
set(VCPKG_CXX_FLAGS "/MP /DWIN32 /D_WINDOWS /DWINAPI_FAMILY=100 /DWINVER=0x0A00 /D_WIN32_WINNT=0x0A00 /DNTDDI_VERSION=0x0A000000 /Zc:__cplusplus /GR- /we4541")
|
||||
set(VCPKG_C_FLAGS_RELEASE "-DNDEBUG -O3")
|
||||
set(VCPKG_CXX_FLAGS_RELEASE "-DNDEBUG -O3")
|
||||
set(VCPKG_C_FLAGS_RELWITHDEBINFO "-DNDEBUG -O3")
|
||||
set(VCPKG_C_FLAGS_RELWITHDEBINFO "-DNDEBUG -O3")
|
||||
32
cmake/vcpkg-triplets/default/wasm64-emscripten.cmake
Normal file
32
cmake/vcpkg-triplets/default/wasm64-emscripten.cmake
Normal file
|
|
@ -0,0 +1,32 @@
|
|||
# Copyright (c) Microsoft Corporation. All rights reserved.
|
||||
# Licensed under the MIT License.
|
||||
set(VCPKG_ENV_PASSTHROUGH_UNTRACKED EMSCRIPTEN_ROOT EMSDK PATH)
|
||||
|
||||
if(NOT DEFINED ENV{EMSCRIPTEN_ROOT})
|
||||
find_path(EMSCRIPTEN_ROOT "emcc")
|
||||
else()
|
||||
set(EMSCRIPTEN_ROOT "$ENV{EMSCRIPTEN_ROOT}")
|
||||
endif()
|
||||
|
||||
if(NOT EMSCRIPTEN_ROOT)
|
||||
if(NOT DEFINED ENV{EMSDK})
|
||||
message(FATAL_ERROR "The emcc compiler not found in PATH")
|
||||
endif()
|
||||
set(EMSCRIPTEN_ROOT "$ENV{EMSDK}/upstream/emscripten")
|
||||
endif()
|
||||
|
||||
if(NOT EXISTS "${EMSCRIPTEN_ROOT}/cmake/Modules/Platform/Emscripten.cmake")
|
||||
message(FATAL_ERROR "Emscripten.cmake toolchain file not found")
|
||||
endif()
|
||||
|
||||
set(VCPKG_CRT_LINKAGE dynamic)
|
||||
set(VCPKG_LIBRARY_LINKAGE static)
|
||||
set(VCPKG_CMAKE_SYSTEM_NAME Emscripten)
|
||||
set(VCPKG_CHAINLOAD_TOOLCHAIN_FILE "${EMSCRIPTEN_ROOT}/cmake/Modules/Platform/Emscripten.cmake")
|
||||
set(VCPKG_TARGET_ARCHITECTURE wasm64)
|
||||
set(VCPKG_C_FLAGS "-ffunction-sections -fdata-sections -msimd128 -pthread -Wno-pthreads-mem-growth -sMEMORY64")
|
||||
set(VCPKG_CXX_FLAGS "/MP /DWIN32 /D_WINDOWS /DWINAPI_FAMILY=100 /DWINVER=0x0A00 /D_WIN32_WINNT=0x0A00 /DNTDDI_VERSION=0x0A000000 /Zc:__cplusplus /GR- /we4541")
|
||||
set(VCPKG_C_FLAGS_RELEASE "-DNDEBUG -O3")
|
||||
set(VCPKG_CXX_FLAGS_RELEASE "-DNDEBUG -O3")
|
||||
set(VCPKG_C_FLAGS_RELWITHDEBINFO "-DNDEBUG -O3")
|
||||
set(VCPKG_C_FLAGS_RELWITHDEBINFO "-DNDEBUG -O3")
|
||||
|
|
@ -1105,10 +1105,7 @@ def generate_build_tree(
|
|||
cmake_extra_args,
|
||||
):
|
||||
log.info("Generating CMake build tree")
|
||||
if args.build_wasm:
|
||||
# No custom triplet for the wasm builds yet
|
||||
args.use_vcpkg = False
|
||||
elif args.minimal_build is not None:
|
||||
if args.minimal_build is not None:
|
||||
# Minimal build uses a custom ONNX cmake file. Don't know how to deal with it yet
|
||||
args.use_vcpkg = False
|
||||
elif args.ios or args.macos == "Catalyst":
|
||||
|
|
@ -1272,7 +1269,10 @@ def generate_build_tree(
|
|||
# Choose the cmake triplet
|
||||
triplet = None
|
||||
if args.build_wasm:
|
||||
triplet = "wasm32-emscripten"
|
||||
if args.enable_wasm_memory64:
|
||||
triplet = "wasm64-emscripten"
|
||||
else:
|
||||
triplet = "wasm32-emscripten"
|
||||
elif args.android:
|
||||
if args.android_abi == "armeabi-v7a":
|
||||
triplet = "arm-neon-android"
|
||||
|
|
|
|||
Loading…
Reference in a new issue