File tree Expand file tree Collapse file tree 7 files changed +49
-23
lines changed
Expand file tree Collapse file tree 7 files changed +49
-23
lines changed Original file line number Diff line number Diff line change @@ -773,29 +773,7 @@ if(OCOS_ENABLE_C_API)
773773endif ()
774774
775775if (CMAKE_SYSTEM_NAME STREQUAL "Emscripten" )
776- if (NOT OCOS_ENABLE_STATIC_LIB)
777- # Emscripten does not support building a shared library with custom ops.
778- # and backward compatible with the previous version, we silently turn off the shared library build.
779- set (OCOS_BUILD_SHARED_LIB OFF CACHE INTERNAL "" FORCE)
780- add_executable (ortcustomops ${_TARGET_LIB_SRC} )
781- set_target_properties (ortcustomops PROPERTIES LINK_FLAGS " \
782- -s WASM=1 \
783- -s NO_EXIT_RUNTIME=0 \
784- -s ALLOW_MEMORY_GROWTH=1 \
785- -s SAFE_HEAP=0 \
786- -s MODULARIZE=1 \
787- -s SAFE_HEAP_LOG=0 \
788- -s STACK_OVERFLOW_CHECK=0 \
789- -s EXPORT_ALL=0 \
790- -s VERBOSE=0 \
791- --no-entry" )
792-
793- if (CMAKE_BUILD_TYPE STREQUAL "Debug" )
794- set_property (TARGET ortcustomops APPEND_STRING PROPERTY LINK_FLAGS " -s ASSERTIONS=1 -s DEMANGLE_SUPPORT=1" )
795- else ()
796- set_property (TARGET ortcustomops APPEND_STRING PROPERTY LINK_FLAGS " -s ASSERTIONS=0 -s DEMANGLE_SUPPORT=0" )
797- endif ()
798- endif ()
776+ include (ext_wasm)
799777else ()
800778 add_library (ortcustomops STATIC ${_TARGET_LIB_SRC} )
801779 if (HAS_SDL)
Original file line number Diff line number Diff line change 1+ # Copyright (c) Microsoft Corporation. All rights reserved.
2+ # Licensed under the MIT License.
3+
14if (NOT "${CMAKE_SYSTEM_NAME} " MATCHES "Darwin|iOS" )
25 message (FATAL_ERROR "Building an Apple framework can only be enabled for MacOS or iOS." )
36endif ()
Original file line number Diff line number Diff line change 1+ # Copyright (c) Microsoft Corporation. All rights reserved.
2+ # Licensed under the MIT License.
3+
14include (FindJava)
25find_package (Java REQUIRED)
36include (UseJava)
Original file line number Diff line number Diff line change 1+ # Copyright (c) Microsoft Corporation. All rights reserved.
2+ # Licensed under the MIT License.
3+
14if (_ONNXRUNTIME_EMBEDDED)
25 set (ONNXRUNTIME_INCLUDE_DIR ${CMAKE_SOURCE_DIR} /../include /onnxruntime/core/session)
36 set (ONNXRUNTIME_LIB_DIR "" )
Original file line number Diff line number Diff line change 1+ # Copyright (c) Microsoft Corporation. All rights reserved.
2+ # Licensed under the MIT License.
3+
14block(PROPAGATE Python3_FOUND)
25 set (Python3_FIND_REGISTRY NEVER)
36 # if we don't set this to NEVER (or possibly LAST) the builds of the wheel for different python versions will fail
Original file line number Diff line number Diff line change 1+ # Copyright (c) Microsoft Corporation. All rights reserved.
2+ # Licensed under the MIT License.
3+
14if (OCOS_ENABLE_SELECTED_OPLIST)
25 # currently the tests don't handle operator exclusion cleanly.
36 message (FATAL_ERROR "Due to usage of OCOS_ENABLE_SELECTED_OPLIST excluding operators the tests are unable to be built and run" )
Original file line number Diff line number Diff line change 1+ # Copyright (c) Microsoft Corporation. All rights reserved.
2+ # Licensed under the MIT License.
3+
4+ if (OCOS_ENABLE_STATIC_LIB)
5+ add_library (ortcustomops STATIC ${_TARGET_LIB_SRC} )
6+ if (HAS_SDL)
7+ target_compile_options (ortcustomops PRIVATE "/sdl" )
8+ endif ()
9+ add_library (onnxruntime_extensions ALIAS ortcustomops)
10+ standardize_output_folder(ortcustomops)
11+ else ()
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)
15+ add_executable (ortcustomops ${_TARGET_LIB_SRC} )
16+ set_target_properties (ortcustomops PROPERTIES LINK_FLAGS " \
17+ -s WASM=1 \
18+ -s NO_EXIT_RUNTIME=0 \
19+ -s ALLOW_MEMORY_GROWTH=1 \
20+ -s SAFE_HEAP=0 \
21+ -s MODULARIZE=1 \
22+ -s SAFE_HEAP_LOG=0 \
23+ -s STACK_OVERFLOW_CHECK=0 \
24+ -s EXPORT_ALL=0 \
25+ -s VERBOSE=0 \
26+ --no-entry" )
27+
28+ if (CMAKE_BUILD_TYPE STREQUAL "Debug" )
29+ set_property (TARGET ortcustomops APPEND_STRING PROPERTY LINK_FLAGS " -s ASSERTIONS=1 -s DEMANGLE_SUPPORT=1" )
30+ else ()
31+ set_property (TARGET ortcustomops APPEND_STRING PROPERTY LINK_FLAGS " -s ASSERTIONS=0 -s DEMANGLE_SUPPORT=0" )
32+ endif ()
33+ endif ()
You can’t perform that action at this time.
0 commit comments