[PATCH] D142279: [cmake] Use LLVM_ENABLE_ASSERTIONS to enable assertions in libstdc++
Chris Bieneman via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Mon Feb 6 10:05:23 PST 2023
beanz added a comment.
In D142279#4106708 <https://reviews.llvm.org/D142279#4106708>, @foad wrote:
> @beanz FYI - I think I heard you were a cmake expert!
I'll never admit this. You can't make me admit it. No amount of torture will surpass the pain of admitting this....
I digress...
Unfortunately because of the way we bake compilation flags into llvm-config, you can't use generator expressions for global compiler definition. Someday we should kill llvm-config and fix that.
One thing you could do is have a check like:
check_cxx_source_compiles("
#include <iosfwd>
#if !defined(__GLIBCXX__)
#error Not using libstcxx
#endif
int main() { return 0; }
"
USING_LIBSTDCXX)
This would allow you to detect if you're building against libstcxx or another c++ library. Then you could only add the define if this sets `USING_LIBSTDCXX` to true.
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D142279/new/
https://reviews.llvm.org/D142279
More information about the llvm-commits
mailing list