Skip to content

NAG-Fortran: Fix compilation flags and improve compatibility with Ninja

Simon Märtens requested to merge ACSimon33/cmake:nagfor_compiler_flags into master

Fixes:

  • The configuration of the NAG Fortran compiler missed the standard flags for debug, release and the other build types.
  • CMAKE_Fortran_PREPROCESS_SOURCE variable was missing, causing the configuration using the Ninja generator to fail.
  • The -fpp flag was added by default on Apple due to its case-insensitive file system. If we use the ninja without setting CMAKE_Fortran_PREPROCESS=OFF, we already preprocess the files before compiling them. Compiling already preprocessed files again with the -fpp causes problems for the NAG Fortran compiler.
  • The CMAKE_SHARED_MODULE_CREATE_Fortran_FLAGS is now correctly passing the -bundle flag to the underlying host compiler. Before, it was passed directly to the NAG Fortran compiler, which doesn't support this flag.

Fixes: #21398 (closed)
Issue: #25900
Topic-rename: nag-fortran-ninja

Edited by Brad King

Merge request reports