Merge release-4-6 into release-5-0
[alexxy/gromacs.git] / cmake / gmxManageNvccConfig.cmake
index a0b3028c925502fce18ce309b603aee4e9564cbc..e0a7728221a600049d7990b5f1f8b892ddf952de 100644 (file)
@@ -125,6 +125,12 @@ if (NOT DEFINED CUDA_NVCC_FLAGS_SET)
         mark_as_advanced(CUDA_HOST_COMPILER CUDA_HOST_COMPILER_OPTIONS)
     endif()
 
+    if(APPLE AND CMAKE_C_COMPILER_ID MATCHES "GNU")
+        # Some versions of gcc-4.8 and gcc-4.9 produce errors (in particular on OS X)
+        # if we do not use -D__STRICT_ANSI__. It is harmless, so we might as well add it for all versions.
+        set(CUDA_HOST_COMPILER_OPTIONS "${CUDA_HOST_COMPILER_OPTIONS}-D__STRICT_ANSI__;")
+    endif()
+
     # on Linux we need to add -fPIC when building shared gmx libs
     # Note: will add -fPIC for any compiler that supports it as it shouldn't hurt
     if(BUILD_SHARED_LIBS)