Skip to content

use fpm to fill the gap between gcc macros and gfortran to enable seamless cpp preprocessing #1084

Open
@jalvesz

Description

@jalvesz

Description

Hi, I would like to propose that fpm fills in the gap left between gcc and gfortran where all defined macros are not available from gfortran without using CMake.

While there are many discussions about preprocessors, most of the defacto preprocessing is being done using cpp/fpp. Simple tasks such as determining on which OS a program is running (which can be set at compile time) either rely on C preprocessing or having to use get_environment_variable at runtime.

Possible Solution

One idea would be to make it such that fpm catches the list of macros from gcc by running (if using gfortran) the commands:
Linux

gcc -dM -E - < /dev/null

Windows

gcc -dM -E - <NUL:

And pass them through the preprocess.cpp mechanism by default.

Additional Information

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions