@@ -113,20 +113,22 @@ if (LLVM_TARGET_TRIPLE MATCHES "^ppc|^powerpc")
113113 )
114114endif ()
115115
116- list (APPEND host_sources
117- __cuda_device.f90
118- cooperative_groups.f90
119- cudadevice.f90
120- )
121-
122- # Compile as CUDA-Fortran, not directly supported by CMake
123- set_property (SOURCE
116+ if (FLANG_RT_EXPERIMENTAL_OFFLOAD_SUPPORT STREQUAL "CUDA" )
117+ list (APPEND host_sources
124118 __cuda_device.f90
125119 cooperative_groups.f90
126120 cudadevice.f90
127- APPEND PROPERTY
128- COMPILE_OPTIONS --offload-host-only -xcuda
129- )
121+ )
122+
123+ # Compile as CUDA-Fortran, not directly supported by CMake
124+ set_property (SOURCE
125+ __cuda_device.f90
126+ cooperative_groups.f90
127+ cudadevice.f90
128+ APPEND PROPERTY
129+ COMPILE_OPTIONS --offload-host-only -xcuda
130+ )
131+ endif ()
130132
131133# Sources that can be compiled directly for the GPU.
132134set (gpu_sources
@@ -215,26 +217,11 @@ endif ()
215217
216218if (LLVM_RUNTIMES_TARGET MATCHES "^amdgcn|^nvptx" )
217219 set (sources ${gpu_sources} )
218- elseif (FLANG_RT_EXPERIMENTAL_OFFLOAD_SUPPORT STREQUAL "CUDA" )
219- set (sources ${supported_sources} ${host_sources} )
220220else ()
221221 set (sources ${supported_sources} ${host_sources} ${f128_sources} )
222222endif ()
223223
224224
225- if (FORTRAN_SUPPORTS_REAL16)
226- add_compile_definitions (FLANG_SUPPORT_R16=1)
227- add_compile_options ("$<$<COMPILE_LANGUAGE:Fortran>:-cpp>" )
228- endif ()
229-
230- add_compile_options (
231- "$<$<COMPILE_LANGUAGE:Fortran>:SHELL:-mmlir;SHELL:-ignore-missing-type-desc>"
232-
233- # Flang bug workaround: Reformating of cooked token buffer causes identifier to be split between lines
234- "$<$<COMPILE_LANGUAGE:Fortran>:SHELL:-Xflang;SHELL:-fno-reformat>"
235- )
236-
237-
238225# check-flang depends on this to build intrinsic modules
239226if (NOT TARGET flang-rt-mod)
240227 add_custom_target (flang-rt-mod)
0 commit comments