File tree Expand file tree Collapse file tree 3 files changed +10
-7
lines changed
Expand file tree Collapse file tree 3 files changed +10
-7
lines changed Original file line number Diff line number Diff line change @@ -748,6 +748,7 @@ stages:
748748 - script : |
749749 bash ./build.sh \
750750 -DCMAKE_TOOLCHAIN_FILE=$(Build.BinariesDirectory)/emsdk/upstream/emscripten/cmake/Modules/Platform/Emscripten.cmake \
751+ -DOCOS_ENABLE_STATIC_LIB=OFF \
751752 -DOCOS_ENABLE_SPM_TOKENIZER=ON \
752753 -DOCOS_BUILD_PYTHON=OFF \
753754 -DOCOS_ENABLE_VISION=OFF \
@@ -758,12 +759,12 @@ stages:
758759 - script : |
759760 bash ./build.sh \
760761 -DCMAKE_TOOLCHAIN_FILE=$(Build.BinariesDirectory)/emsdk/upstream/emscripten/cmake/Modules/Platform/Emscripten.cmake \
762+ -DOCOS_ENABLE_STATIC_LIB=ON \
761763 -DOCOS_ENABLE_SPM_TOKENIZER=ON \
762764 -DOCOS_BUILD_PYTHON=OFF \
763765 -DOCOS_ENABLE_VISION=OFF \
764766 -DOCOS_ENABLE_CTEST=OFF \
765- -DOCOS_ENABLE_C_API=ON \
766- -DOCOS_ENABLE_STATIC_LIB=ON
767+ -DOCOS_ENABLE_C_API=ON
767768 displayName: build ort-extensions as a static library
768769
769770 - stage : AndroidBuilds
Original file line number Diff line number Diff line change @@ -54,7 +54,12 @@ include(CMakeDependentOption)
5454
5555set (_ORTX_STANDALONE_PROJECT OFF )
5656if (CMAKE_CURRENT_SOURCE_DIR STREQUAL CMAKE_SOURCE_DIR )
57- set (_ORTX_STANDALONE_PROJECT ON )
57+ set (_ORTX_STANDALONE_PROJECT ON )
58+ endif ()
59+
60+ set (_ORTX_SHARED_BUILD_SUPPORTED ON )
61+ if (CMAKE_SYSTEM_NAME STREQUAL "Emscripten" )
62+ set (_ORTX_SHARED_BUILD_SUPPORTED OFF )
5863endif ()
5964
6065option (CC_OPTIMIZE "Allow compiler optimizations, Set to OFF to disable" ON )
@@ -82,7 +87,7 @@ option(OCOS_ENABLE_STATIC_LIB "Enable generating static library" OFF) # only for
8287option (OCOS_ENABLE_SELECTED_OPLIST "Enable including the selected_ops tool file" OFF )
8388option (OCOS_ENABLE_C_API "Enable building the C API" OFF )
8489
85- option (OCOS_BUILD_SHARED_LIB "Enable building the dynamic library" ON )
90+ option (OCOS_BUILD_SHARED_LIB "Enable building the dynamic library" ${_ORTX_SHARED_BUILD_SUPPORTED} )
8691option (OCOS_BUILD_PYTHON "Enable building the Python package" OFF )
8792option (OCOS_BUILD_JAVA "Enable building the Java package" OFF )
8893option (OCOS_BUILD_ANDROID "Enable building the Android package" OFF )
Original file line number Diff line number Diff line change @@ -9,9 +9,6 @@ if(OCOS_ENABLE_STATIC_LIB)
99 add_library (onnxruntime_extensions ALIAS ortcustomops)
1010 standardize_output_folder(ortcustomops)
1111else ()
12- # Emscripten does not support building a shared library with custom ops.
13- # and backward compatible with the previous version, we silently turn off the shared library build.
14- set (OCOS_BUILD_SHARED_LIB OFF CACHE INTERNAL "" FORCE)
1512 add_executable (ortcustomops ${_TARGET_LIB_SRC} )
1613 set_target_properties (ortcustomops PROPERTIES LINK_FLAGS " \
1714 -s WASM=1 \
You can’t perform that action at this time.
0 commit comments