We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 93a7b1a commit 1568681Copy full SHA for 1568681
1 file changed
src/addon/ESMX/Driver/CMakeLists.txt
@@ -160,6 +160,15 @@ foreach(ESMX_LINK_LIBRARY IN ITEMS ${ESMX_LINK_LIBRARIES})
160
endif()
161
endforeach()
162
163
+# CMake has a bug with NAG and OpenMP:
164
+# https://gitlab.kitware.com/cmake/cmake/-/issues/21280
165
+# so we work around it ... credit to https://github.com/mathomp4
166
+if (OpenMP_Fortran_FOUND AND CMAKE_Fortran_COMPILER_ID STREQUAL "NAG")
167
+ message(WARNING "NAG Fortran detected, resetting OpenMP flags to avoid CMake bug")
168
+ set_property(TARGET OpenMP::OpenMP_Fortran PROPERTY INTERFACE_LINK_LIBRARIES "")
169
+ set_property(TARGET OpenMP::OpenMP_Fortran PROPERTY INTERFACE_LINK_OPTIONS "-openmp")
170
+endif()
171
+
172
# link options
173
if(DEFINED ESMX_LINK_OPTIONS)
174
target_link_options(esmx_driver PUBLIC ${ESMX_LINK_OPTIONS})
0 commit comments