This is an archive of the discontinued LLVM Phabricator instance.

[compiler-rt][CMake] Filter MSVC-specific warning flags from CMAKE_*_FLAGS when building with clang.exe
AbandonedPublic

Authored by gbedwell on Mar 13 2015, 11:58 AM.

Details

Reviewers
kcc
samsonov
rnk
Summary

This fixes a compiler-rt build failure introduced by r231924 (temporarily reverted in r231925 pending this fix).
r231924 modified HandleLLVMOptions.cmake to pass in MSVC warning promotion/suppression flags as flags rather than as definitions ( see http://reviews.llvm.org/D8188 ). This meant that under the (MSVC) condition in CMake, we'd get new flags in the form /wNNNN, /wdNNNN and /weNNNN within CMAKE_*_FLAGS. These are not accepted by clang.exe resulting in an error building compiler-rt within the context of an MSVC build.

I found the existing code that converts from the '/flag' form to the '-flag' form when building with clang.exe under the (MSVC) condition and extended it to remove the above flags entirely.

Thanks,

Greg Bedwell
SN Systems Ltd - Sony Computer Entertainment Group

Diff Detail

Event Timeline

gbedwell updated this revision to Diff 21938.Mar 13 2015, 11:58 AM
gbedwell retitled this revision from to [compiler-rt][CMake] Filter MSVC-specific warning flags from CMAKE_*_FLAGS when building with clang.exe.
gbedwell updated this object.
gbedwell edited the test plan for this revision. (Show Details)
gbedwell added reviewers: kcc, samsonov.
gbedwell added a subscriber: Unknown Object (MLST).
gbedwell added a subscriber: rnk.Mar 13 2015, 1:14 PM
rnk edited edge metadata.Mar 13 2015, 2:08 PM

I'm testing an alternative similar to this right now. It'll be easier to write and test it rather than try to get you to write it through code review. :)

I'm testing an alternative similar to this right now. It'll be easier to write and test it rather than try to get you to write it through code review. :)

No problem! I shall look forward to it :)

rnk added a comment.Mar 13 2015, 2:42 PM

Should be fixed in r232219.

gbedwell abandoned this revision.Mar 13 2015, 2:49 PM

Brilliant. I'll give that a go now!