This is an archive of the discontinued LLVM Phabricator instance.

Only pass -UNDEBUG when compiling C/C++
ClosedPublic

Authored by etcwilde on Feb 1 2020, 2:41 AM.

Details

Summary

This patch limits adding -UNDEBUG to C and C++ files so that projects can include files compiled with compilers that don't recognize this argument (Swift e.g.).

add_definitions does not expand generators, hence the change from add_definitions to add_compile_options.

Diff Detail

Event Timeline

etcwilde created this revision.Feb 1 2020, 2:41 AM
Herald added a project: Restricted Project. · View Herald TranscriptFeb 1 2020, 2:41 AM
compnerd accepted this revision.Feb 1 2020, 9:41 AM
This revision is now accepted and ready to land.Feb 1 2020, 9:41 AM

Thanks for the review. Could you land this for me? I don't have commit privileges yet. Thanks.

This is causing build failures for me with CMake 3.10, also see https://github.com/llvm/llvm-project/commit/9b84dabc5f36f7e027c62b5c00ea97e21cfcacdd#commitcomment-37081955 for discussion about this issue.

This is causing build failures for me with CMake 3.10, also see https://github.com/llvm/llvm-project/commit/9b84dabc5f36f7e027c62b5c00ea97e21cfcacdd#commitcomment-37081955 for discussion about this issue.

Fix posted: https://reviews.llvm.org/D73858
I don't have commit privileges yet, so someone will have to merge it for me once approved.