[flang-dev] Flang + CMake

Romero, Nichols A. via flang-dev flang-dev at lists.llvm.org
Thu Jul 1 10:13:51 PDT 2021


Are we now able to clearly distinguish classic flang vs. flang with preprocessor macros?

I think that would be a pre-requisite before filing a bug report/feature request with the CMake team.

It is good to hear that they are engaged because of their involvement with ECP.

From: flang-dev <flang-dev-bounces at lists.llvm.org> on behalf of Michael Kruse via flang-dev <flang-dev at lists.llvm.org>
Reply-To: Michael Kruse <llvm at meinersbur.de>
Date: Thursday, July 1, 2021 at 10:55 AM
To: Andrzej Warzynski <andrzej.warzynski at arm.com>
Cc: via flang-dev <flang-dev at lists.llvm.org>
Subject: Re: [flang-dev] Flang + CMake

Am Do., 1. Juli 2021 um 08:20 Uhr schrieb Andrzej Warzynski
<andrzej.warzynski at arm.com<mailto:andrzej.warzynski at arm.com>>:
These upper-case predefinitions were added to CMake long before LLVM
Flang [1]. I think that it is safe to assume that they were meant for
"classic Flang" rather than LLVM Flang.

The repository linked in [1] is classic flang.


`__flang__`, `__flang_major__`, `__flang_minor__` and
`__flang_patchlevel__` are defined by the driver rather then the
preprocessor. These pre-definitions are consistent with Clang.

From the programmer's perspective there is no difference which
component defines a macro. They are expanded the same in CMake's
introspection program.
From what I have seen it seems to me that there is no version of new
flang/f18 that defined a __FLANG_MAJOR__ etc. preprocessor macro
itself. Is this wrong?

What additional macros does the preprocessor define?

Which macros should CMake use to detect new flang/f18 and distinguish
it from classic flang?

The CMake maintainers are quite responsive and have an interest in
making flang work due their involvement in ECP. I suggest to open a
bug report in the CMake bug tracker to coordinate above questions with
them.

Michael
_______________________________________________
flang-dev mailing list
flang-dev at lists.llvm.org<mailto:flang-dev at lists.llvm.org>
https://lists.llvm.org/cgi-bin/mailman/listinfo/flang-dev

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/flang-dev/attachments/20210701/3b53ed85/attachment-0001.html>


More information about the flang-dev mailing list