Skip to content

Commit 488ce75

Browse files
committed
Enable the use of LIBCUDACXX for non-ptx too
1 parent 4b65d4b commit 488ce75

File tree

2 files changed

+6
-4
lines changed

2 files changed

+6
-4
lines changed

flang-rt/cmake/modules/AddFlangRTOffload.cmake

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -54,8 +54,10 @@ macro(enable_cuda_compilation name files)
5454
# When using libcudacxx headers files, we have to use them
5555
# for all files of Flang-RT.
5656
if (EXISTS "${FLANG_RT_LIBCUDACXX_PATH}/include")
57-
target_include_directories(obj.${name}PTX AFTER PRIVATE "${FLANG_RT_LIBCUDACXX_PATH}/include")
58-
target_compile_definitions(obj.${name}PTX PRIVATE RT_USE_LIBCUDACXX=1)
57+
foreach (tgt IN ITEMS "${name}" "obj.${name}PTX")
58+
target_include_directories(${tgt} AFTER PRIVATE "${FLANG_RT_LIBCUDACXX_PATH}/include")
59+
target_compile_definitions(${tgt} PRIVATE RT_USE_LIBCUDACXX=1)
60+
endforeach ()
5961
endif ()
6062
endif()
6163
endmacro()

flang-rt/lib/flang_rt/CMakeLists.txt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -134,8 +134,8 @@ if (NOT WIN32)
134134
ADDITIONAL_HEADERS ${public_headers} ${private_headers}
135135
)
136136

137-
enable_cuda_compilation(flang_rt.static "${supported_sources}")
138-
enable_omp_offload_compilation(flang_rt.static "${supported_sources}")
137+
enable_cuda_compilation(flang_rt "${supported_sources}")
138+
enable_omp_offload_compilation(flang_rt "${supported_sources}")
139139

140140
# For unittests that depend on flang_rt. Should link to the static version
141141
# of the library.

0 commit comments

Comments
 (0)