Skip to content

Commit

Permalink
[CP] Fix for xfgcheck and Fix WAI ARM64 build (#19634) (#19644)
Browse files Browse the repository at this point in the history
### Description
Fix WAI build by only conditionally copying linker flags



### Motivation and Context
I broke the WAI build that contains ORT on ARM64
  • Loading branch information
Jamather authored Mar 14, 2024
1 parent f42e6ad commit 18ad858
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions cmake/winml.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -827,7 +827,6 @@ if (winml_is_inbox)
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})
Expand All @@ -836,8 +835,14 @@ if (winml_is_inbox)
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})

# Attempt to copy linker flags
get_target_property(link_flags ${target} LINK_FLAGS)

if (NOT link_flags MATCHES ".*NOTFOUND")
set_property(TARGET ${new_target} PROPERTY LINK_FLAGS "${link_flags}")
endif()
endfunction()

if (WAI_ARCH STREQUAL x64 OR WAI_ARCH STREQUAL arm64)
Expand Down

0 comments on commit 18ad858

Please sign in to comment.