diff --git a/runtime/flangrti/CMakeLists.txt b/runtime/flangrti/CMakeLists.txt index 6c72f0701ae2..cd5a35f7d79f 100644 --- a/runtime/flangrti/CMakeLists.txt +++ b/runtime/flangrti/CMakeLists.txt @@ -81,11 +81,16 @@ endif() # Import OpenMP if (NOT DEFINED LIBOMP_EXPORT_DIR) - find_library( - FLANG_LIBOMP - libomp.so - HINTS ${CMAKE_BINARY_DIR}/lib) - target_link_libraries(flangrti_shared ${FLANG_LIBOMP}) + # OpenMP is not supported on Windows on ARM yet, use ompstub for linking by default + if(NOT (MSVC AND ${TARGET_ARCHITECTURE} STREQUAL "aarch64")) + find_library( + FLANG_LIBOMP + NAMES omp libomp + HINTS ${CMAKE_BINARY_DIR}/lib) + target_link_libraries(flangrti_shared PRIVATE ${FLANG_LIBOMP}) + else() + target_link_libraries(flangrti_shared PRIVATE ompstub_shared) + endif() endif() find_library(