Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
second attempt. Remove -g flag for flang from now, it's not really useful for our...
authorAugustin Degomme <adegomme@users.noreply.github.com>
Sun, 27 Oct 2019 14:47:29 +0000 (15:47 +0100)
committerAugustin Degomme <adegomme@users.noreply.github.com>
Sun, 27 Oct 2019 14:47:29 +0000 (15:47 +0100)
tools/cmake/Flags.cmake

index cb7a0c2..e752365 100644 (file)
@@ -49,8 +49,11 @@ if(enable_compile_warnings)
 
   if(CMAKE_Fortran_COMPILER_ID MATCHES "GCC|PGI")
     set(CMAKE_Fortran_FLAGS "${CMAKE_Fortran_FLAGS} -Wall")
-  endif()
-  if(CMAKE_Fortran_COMPILER_ID MATCHES "Intel")
+  elseif(CMAKE_Fortran_COMPILER_ID MATCHES "Flang")
+    # flang >= 7 has a bug with common and debug flags. Ignore cmake-added -g in this case.
+    # https://github.com/flang-compiler/flang/issues/671
+    set(CMAKE_Fortran_FLAGS "-Wall")
+  elseif(CMAKE_Fortran_COMPILER_ID MATCHES "Intel")
     set(CMAKE_Fortran_FLAGS "${CMAKE_Fortran_FLAGS} -warn all")
   endif()
   set(CMAKE_JAVA_COMPILE_FLAGS "-Xlint")