Skip to content

Commit 51cfcec

Browse files
committed
Build fix compining with OpenMP
1 parent 17faf35 commit 51cfcec

File tree

1 file changed

+10
-10
lines changed

1 file changed

+10
-10
lines changed

flang-rt/cmake/modules/AddFlangRTOffload.cmake

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -88,16 +88,16 @@ macro(enable_omp_offload_compilation name files)
8888
"${FLANG_RT_DEVICE_ARCHITECTURES}"
8989
)
9090

91-
set(OMP_COMPILE_OPTIONS
92-
-fopenmp
93-
-fvisibility=hidden
94-
-fopenmp-cuda-mode
95-
--offload-arch=${compile_for_architectures}
96-
# Force LTO for the device part.
97-
-foffload-lto
98-
)
99-
set_source_files_properties(${files} PROPERTIES COMPILE_OPTIONS
100-
"${OMP_COMPILE_OPTIONS}"
91+
set(OMP_COMPILE_OPTIONS $<$<COMPILE_LANGUAGE:C,CXX>:
92+
-fopenmp -fvisibility=hidden -fopenmp-cuda-mode --offload-arch=${compile_for_architectures}
93+
# Force LTO for the device part.
94+
-foffload-lto
95+
>)
96+
#set_source_files_properties(${files} PROPERTIES COMPILE_OPTIONS
97+
# "${OMP_COMPILE_OPTIONS}"
98+
# )
99+
set_property(SOURCE ${files} APPEND
100+
PROPERTY COMPILE_DEFINITIONS ${OMP_COMPILE_OPTIONS}
101101
)
102102
target_link_options(${name}.static PUBLIC ${OMP_COMPILE_OPTIONS})
103103

0 commit comments

Comments
 (0)