This is an archive of the discontinued LLVM Phabricator instance.

[cmake] Fix _GNU_SOURCE being added unconditionally
ClosedPublic

Authored by Trass3r on Nov 13 2022, 3:18 PM.

Diff Detail

Event Timeline

Trass3r created this revision.Nov 13 2022, 3:18 PM
Herald added a project: Restricted Project. · View Herald TranscriptNov 13 2022, 3:18 PM
Trass3r requested review of this revision.Nov 13 2022, 3:18 PM
Herald added projects: Restricted Project, Restricted Project. · View Herald TranscriptNov 13 2022, 3:18 PM
Trass3r added inline comments.
clang/CMakeLists.txt
417

Found when building with clang-cl. It's already handled correctly in the llvm config file.

I think this looks OK. What kind of errors were you seeing before this fix?

I only came across it when testing a PCH build.
https://github.com/Trass3r/llvm-project/actions/runs/3423679621/jobs/5702548183

Warning: <built-in>(1,9): warning: definition of macro '_GNU_SOURCE' does not match definition in precompiled header [-Wclang-cl-pch]

It was set for clang but not for llvm when building with clang-cl.

tstellar accepted this revision.Nov 14 2022, 7:01 AM
This revision is now accepted and ready to land.Nov 14 2022, 7:01 AM

Thanks could you also commit it?

Thanks could you also commit it?

Sure, what name and email should I use for you when committing?

This comment was removed by Trass3r.
This revision was automatically updated to reflect the committed changes.