Skip to content

Commit

Permalink
Restore arm64x onnxruntime binaries (microsoft#9950)
Browse files Browse the repository at this point in the history
  • Loading branch information
jstoecker authored Dec 7, 2021
1 parent 5e4d58a commit 63c8889
Showing 1 changed file with 26 additions and 0 deletions.
26 changes: 26 additions & 0 deletions cmake/onnxruntime.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -215,6 +215,32 @@ if (WINDOWS_STORE)
target_link_options(onnxruntime PRIVATE /DELAYLOAD:api-ms-win-core-libraryloader-l1-2-1.dll)
endif()

if (winml_is_inbox)
# Apply linking flags required by inbox static analysis tools
target_link_options(onnxruntime PRIVATE ${os_component_link_flags_list})
# Link *_x64/*_arm64 DLLs for the ARM64X forwarder
function(duplicate_shared_library target new_target)
get_target_property(sources ${target} SOURCES)
get_target_property(compile_definitions ${target} COMPILE_DEFINITIONS)
get_target_property(compile_options ${target} COMPILE_OPTIONS)
get_target_property(include_directories ${target} INCLUDE_DIRECTORIES)
get_target_property(link_libraries ${target} LINK_LIBRARIES)
get_target_property(link_flags ${target} LINK_FLAGS)
get_target_property(link_options ${target} LINK_OPTIONS)
add_library(${new_target} SHARED ${sources})
add_dependencies(${target} ${new_target})
target_compile_definitions(${new_target} PRIVATE ${compile_definitions})
target_compile_options(${new_target} PRIVATE ${compile_options})
target_include_directories(${new_target} PRIVATE ${include_directories})
target_link_libraries(${new_target} PRIVATE ${link_libraries})
set_property(TARGET ${new_target} PROPERTY LINK_FLAGS "${link_flags}")
target_link_options(${new_target} PRIVATE ${link_options})
endfunction()
if (WAI_ARCH STREQUAL x64 OR WAI_ARCH STREQUAL arm64)
duplicate_shared_library(onnxruntime onnxruntime_${WAI_ARCH})
endif()
endif()

# Assemble the Apple static framework (iOS and macOS)
if(onnxruntime_BUILD_APPLE_FRAMEWORK)
set(STATIC_LIB_DIR ${CMAKE_CURRENT_BINARY_DIR}/static_libraries)
Expand Down

0 comments on commit 63c8889

Please sign in to comment.