[OpenMP] FIx omp_lib.mod compilation for the GPU (#201377)

This commit is contained in:
Joseph Huber 2026-06-03 10:00:30 -05:00 committed by GitHub
parent 5816ef1560
commit aa8e38f4f8
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -26,6 +26,12 @@ if (CMAKE_Fortran_COMPILER_ID STREQUAL "GNU")
target_compile_options(libomp-mod PRIVATE -fno-range-check)
endif ()
if ("${LLVM_DEFAULT_TARGET_TRIPLE}" MATCHES "^amdgcn|^nvptx")
target_compile_options(libomp-mod PRIVATE
$<$<COMPILE_LANGUAGE:Fortran>:-nogpulib -flto>
)
endif ()
flang_module_target(libomp-mod PUBLIC)
add_dependencies(libomp-mod ${RUNTIMES_FORTRAN_BUILD_DEPS})