[flang-dev] CMake standalone and compile flags

Timothy Keith via flang-dev flang-dev at lists.llvm.org
Mon May 4 10:36:15 PDT 2020


I find out-of-tree builds useful so I can build multiple flangs without having to build multiple llvms.

Tim

From: flang-dev <flang-dev-bounces at lists.llvm.org> on behalf of Mehdi AMINI via flang-dev <flang-dev at lists.llvm.org>
Reply-To: Mehdi AMINI <joker.eph at gmail.com>
Date: Monday, May 4, 2020 at 10:31 AM
To: David Truby <David.Truby at arm.com>
Cc: Flang Development List <flang-dev at lists.llvm.org>
Subject: Re: [flang-dev] CMake standalone and compile flags

External email: Use caution opening links or attachments



On Mon, May 4, 2020 at 10:17 AM David Truby <David.Truby at arm.com<mailto:David.Truby at arm.com>> wrote:
Hi Mehdi,

That branch enables out of tree builds; I believe there are people that still rely on those which is why we added that branch in when rewriting the CMake infrastructure.

I assume that folks were relying on this before the merge in the monorepo, but are there still reason to maintain this from now on? Can we put an end-date on it?
I'm trying to figure out if this is just a transition thing or if this is really something useful on the long run (and why).

There's an open review to fix a similar issue as is reported in the discussion you linked but it seems to have stalled on a discussion about whether to continue to force Werror on, perhaps you could take a look at that and comment there if it fixes this issue or not?

The review is at https://reviews.llvm.org/D78306

Thanks, that was roughly what I was about to start doing!
In general I think we should avoid doing directly `set(CMAKE_CXX_FLAGS ...` and instead use the `add_flag_if_supported` macros provided by LLVM, e.g.: https://github.com/llvm/llvm-project/blob/master/mlir/lib/CMakeLists.txt#L2

Werror is always difficult to maintain because different compilers (and compiler versions) have different handling (possibly even opposite!) warnings. It is a good thing to have for developers, but it may be a bit hostile to users to have it on by default.

--
Mehdi




Thanks
David Truby
________________________________
From: flang-dev <flang-dev-bounces at lists.llvm.org<mailto:flang-dev-bounces at lists.llvm.org>> on behalf of Mehdi AMINI via flang-dev <flang-dev at lists.llvm.org<mailto:flang-dev at lists.llvm.org>>
Sent: 04 May 2020 18:12
To: Flang Development List <flang-dev at lists.llvm.org<mailto:flang-dev at lists.llvm.org>>
Subject: [flang-dev] CMake standalone and compile flags

Hi,

I was looking into fixing this error that someone has when building flang: https://llvm.discourse.group/t/error-when-building-with-cmake/935

Then I noticed that flang/CMakeLists.txt still has this branch: https://github.com/llvm/llvm-project/blob/master/flang/CMakeLists.txt#L42 ; is there anyone that relies on it or can we simplify this file and the way the options are setup?

Thanks,

--
Mehdi


-----------------------------------------------------------------------------------
This email message is for the sole use of the intended recipient(s) and may contain
confidential information.  Any unauthorized review, use, disclosure or distribution
is prohibited.  If you are not the intended recipient, please contact the sender by
reply email and destroy all copies of the original message.
-----------------------------------------------------------------------------------
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/flang-dev/attachments/20200504/7cf25bb4/attachment.html>


More information about the flang-dev mailing list