From 11a391a88ff9e59136f5cee82c647dc1b4a63be0 Mon Sep 17 00:00:00 2001 From: Tiago Koji Castro Shibata Date: Fri, 1 Oct 2021 13:06:43 -0700 Subject: [PATCH] Port ARM64x support (#9230) --- cmake/winml.cmake | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) diff --git a/cmake/winml.cmake b/cmake/winml.cmake index 4efc6fa628..6e429e01df 100644 --- a/cmake/winml.cmake +++ b/cmake/winml.cmake @@ -845,3 +845,28 @@ endif() # However, there are no cuda imports in winml_dll, and the linker throws the 4199 warning. # This is needed to allow winml_dll build with cuda enabled. target_link_options(winml_dll PRIVATE /ignore:4199) + +if (winml_is_inbox) + # 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_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}) + target_link_options(${new_target} PRIVATE ${link_options}) + endfunction() + + if (WAI_ARCH STREQUAL x64 OR WAI_ARCH STREQUAL arm64) + duplicate_shared_library(winml_dll Windows_AI_MachineLearning_${WAI_ARCH}) + target_compile_features(Windows_AI_MachineLearning_${WAI_ARCH} PRIVATE cxx_std_17) + endif() +endif()