set_cpp_preprocessor_flags Subroutine

public pure subroutine set_cpp_preprocessor_flags(id, flags)

Modify the flag_cpp_preprocessor on the basis of the compiler.


Type IntentOptional Attributes Name
integer(kind=compiler_enum), intent(in) :: id
character(len=:), intent(inout), allocatable :: flags



Type Visibility Attributes Name Initial
character(len=:), public, allocatable :: flag_cpp_preprocessor

Source Code

pure subroutine set_cpp_preprocessor_flags(id, flags)
    integer(compiler_enum), intent(in) :: id
    character(len=:), allocatable, intent(inout) :: flags
    character(len=:), allocatable :: flag_cpp_preprocessor

    !> Modify the flag_cpp_preprocessor on the basis of the compiler.
    select case(id)
    case default
        flag_cpp_preprocessor = ""
    case(id_caf, id_gcc, id_f95, id_nvhpc)
        flag_cpp_preprocessor = "-cpp"
    case(id_intel_classic_windows, id_intel_llvm_windows)
        flag_cpp_preprocessor = "/fpp"
    case(id_intel_classic_nix, id_intel_classic_mac, id_intel_llvm_nix, id_nag)
        flag_cpp_preprocessor = "-fpp"
        flag_cpp_preprocessor = "--cpp"
    end select

    flags = flag_cpp_preprocessor// flags

end subroutine set_cpp_preprocessor_flags