File tree Expand file tree Collapse file tree 2 files changed +4
-3
lines changed Expand file tree Collapse file tree 2 files changed +4
-3
lines changed Original file line number Diff line number Diff line change @@ -60,7 +60,7 @@ macro(enable_cuda_compilation name files)
6060 endif ()
6161endmacro ()
6262
63- macro (enable_omp_offload_compilation files )
63+ macro (enable_omp_offload_compilation name files )
6464 if (FLANG_RT_EXPERIMENTAL_OFFLOAD_SUPPORT STREQUAL "OpenMP" )
6565 # OpenMP offload build only works with Clang compiler currently.
6666
@@ -108,6 +108,7 @@ macro(enable_omp_offload_compilation files)
108108 set_source_files_properties (${files} PROPERTIES COMPILE_OPTIONS
109109 "${OMP_COMPILE_OPTIONS} "
110110 )
111+ target_link_options (${name} PUBLIC ${OMP_COMPILE_OPTIONS} )
111112
112113 # Enable "declare target" in the source code.
113114 set_source_files_properties (${files}
Original file line number Diff line number Diff line change @@ -123,7 +123,7 @@ if (NOT WIN32)
123123 )
124124
125125 enable_cuda_compilation(flang_rt "${supported_sources} " )
126- enable_omp_offload_compilation("${supported_sources} " )
126+ enable_omp_offload_compilation(flang_rt "${supported_sources} " )
127127
128128 # For unittests that depend on flang_rt. Should link to the static version
129129 # of the library.
@@ -148,7 +148,7 @@ else()
148148 )
149149
150150 enable_cuda_compilation(${name} "${supported_sources} " )
151- enable_omp_offload_compilation("${supported_sources} " )
151+ enable_omp_offload_compilation(${name} "${supported_sources} " )
152152 endfunction ()
153153
154154 add_win_flangrt_library(STATIC static MultiThreaded)
You can’t perform that action at this time.
0 commit comments