Skip to content

Commit dbf62ad

Browse files
committed
do not use vcpkg for emscripten
1 parent 8bd92cb commit dbf62ad

File tree

3 files changed

+47
-49
lines changed

3 files changed

+47
-49
lines changed

cmake/external/onnxruntime_external_deps.cmake

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -616,9 +616,13 @@ endif()
616616

617617

618618
if (onnxruntime_USE_WEBGPU)
619-
if (onnxruntime_USE_VCPKG)
619+
if (onnxruntime_USE_VCPKG AND NOT CMAKE_SYSTEM_NAME STREQUAL "Emscripten")
620+
# vcpkg does not support Emscripten yet
620621
find_package(dawn REQUIRED)
621622
else()
623+
#
624+
# Please keep the following in sync with cmake/vcpkg-ports/dawn/portfile.cmake
625+
#
622626
set(DAWN_BUILD_SAMPLES OFF CACHE BOOL "" FORCE)
623627
set(DAWN_ENABLE_NULL OFF CACHE BOOL "" FORCE)
624628
set(DAWN_FETCH_DEPENDENCIES ON CACHE BOOL "" FORCE)

cmake/vcpkg-ports/dawn/portfile.cmake

Lines changed: 36 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
# The following function call ensures BUILD_SHARED_LIBS is set to OFF.
1717
vcpkg_check_linkage(ONLY_STATIC_LIBRARY)
1818

19-
if(CMAKE_SYSTEM_NAME STREQUAL "Emscripten")
19+
if(VCPKG_TARGET_IS_EMSCRIPTEN)
2020
message(FATAL_ERROR "This port is currently not supported on Emscripten.")
2121
endif()
2222

@@ -32,40 +32,44 @@ list(APPEND onnxruntime_vcpkg_DAWN_OPTIONS
3232

3333
-DDAWN_BUILD_SAMPLES=OFF
3434
-DDAWN_ENABLE_NULL=OFF
35-
3635
-DDAWN_BUILD_TESTS=OFF
37-
38-
-DDAWN_BUILD_MONOLITHIC_LIBRARY=ON
39-
-DDAWN_ENABLE_INSTALL=ON
40-
41-
-DDAWN_ENABLE_DESKTOP_GL=OFF
42-
-DDAWN_ENABLE_OPENGLES=OFF
43-
-DDAWN_SUPPORTS_GLFW_FOR_WINDOWING=OFF
44-
-DDAWN_USE_GLFW=OFF
45-
-DDAWN_USE_WINDOWS_UI=OFF
46-
-DTINT_BUILD_GLSL_WRITER=OFF
47-
-DTINT_BUILD_GLSL_VALIDATOR=OFF
48-
49-
-DDAWN_DXC_ENABLE_ASSERTS_IN_NDEBUG=OFF
50-
-DDAWN_USE_X11=OFF
51-
52-
-DTINT_BUILD_TESTS=OFF
53-
-DTINT_BUILD_CMD_TOOLS=OFF
54-
-DTINT_BUILD_IR_BINARY=OFF
55-
-DTINT_BUILD_SPV_READER=OFF
56-
-DTINT_BUILD_WGSL_WRITER=ON
57-
58-
-DDAWN_ENABLE_SPIRV_VALIDATION=OFF
59-
60-
# explicitly set the jinja2 and markupsafe directories to empty strings
61-
# when they are empty, the python script will import them from the system
62-
#
63-
# pip install jinja2 markupsafe
64-
#
65-
-DDAWN_JINJA2_DIR=
66-
-DDAWN_MARKUPSAFE_DIR=
6736
)
6837

38+
if (NOT VCPKG_TARGET_IS_EMSCRIPTEN)
39+
list(APPEND onnxruntime_vcpkg_DAWN_OPTIONS
40+
41+
-DDAWN_BUILD_MONOLITHIC_LIBRARY=ON
42+
-DDAWN_ENABLE_INSTALL=ON
43+
44+
-DDAWN_ENABLE_DESKTOP_GL=OFF
45+
-DDAWN_ENABLE_OPENGLES=OFF
46+
-DDAWN_SUPPORTS_GLFW_FOR_WINDOWING=OFF
47+
-DDAWN_USE_GLFW=OFF
48+
-DDAWN_USE_WINDOWS_UI=OFF
49+
-DTINT_BUILD_GLSL_WRITER=OFF
50+
-DTINT_BUILD_GLSL_VALIDATOR=OFF
51+
52+
-DDAWN_DXC_ENABLE_ASSERTS_IN_NDEBUG=OFF
53+
-DDAWN_USE_X11=OFF
54+
55+
-DTINT_BUILD_TESTS=OFF
56+
-DTINT_BUILD_CMD_TOOLS=OFF
57+
-DTINT_BUILD_IR_BINARY=OFF
58+
-DTINT_BUILD_SPV_READER=OFF
59+
-DTINT_BUILD_WGSL_WRITER=ON
60+
61+
-DDAWN_ENABLE_SPIRV_VALIDATION=OFF
62+
63+
# explicitly set the jinja2 and markupsafe directories to empty strings
64+
# when they are empty, the python script will import them from the system
65+
#
66+
# pip install jinja2 markupsafe
67+
#
68+
-DDAWN_JINJA2_DIR=
69+
-DDAWN_MARKUPSAFE_DIR=
70+
)
71+
endif()
72+
6973
if(VCPKG_TARGET_IS_WINDOWS)
7074
# feature detection on Windows
7175
vcpkg_check_features(OUT_FEATURE_OPTIONS FEATURE_OPTIONS

cmake/vcpkg.json

Lines changed: 6 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -77,33 +77,23 @@
7777
"features": {
7878
"tests": {
7979
"description": "Build ONNXRuntime unit tests",
80-
"dependencies": [
81-
"gtest"
82-
]
80+
"dependencies": ["gtest"]
8381
},
8482
"xnnpack-ep": {
8583
"description": "Build with XNNPack EP",
86-
"dependencies": [
87-
"xnnpack"
88-
]
84+
"dependencies": ["xnnpack"]
8985
},
9086
"coreml-ep": {
9187
"description": "Build with CoreML EP",
92-
"dependencies": [
93-
"fp16"
94-
]
88+
"dependencies": ["fp16"]
9589
},
9690
"dml-ep": {
97-
"description": "Build with CoreML EP",
98-
"dependencies": [
99-
"directx-headers"
100-
]
91+
"description": "Build with DirectML EP",
92+
"dependencies": ["directx-headers"]
10193
},
10294
"webgpu-ep": {
10395
"description": "Build with WebGPU EP",
104-
"dependencies": [
105-
"dawn"
106-
]
96+
"dependencies": [{ "name": "dawn", "platform": "!emscripten" }]
10797
}
10898
},
10999
"overrides": [

0 commit comments

Comments
 (0)