Build fix: Turn off _GLIBCXX_DEBUG based on a compile check
authorNicolai Hähnle <nicolai.haehnle@amd.com>
Wed, 26 Feb 2020 18:47:14 +0000 (19:47 +0100)
committerNicolai Hähnle <nicolai.haehnle@amd.com>
Mon, 2 Mar 2020 15:16:26 +0000 (16:16 +0100)
commit1d104f75498c97cca8ed1fc068a5c359fb7276d8
tree30555ea142ff1346798644e0a6e2351b9611af62
parentf5ad93d2f71437e34f3a6303d0a474cd4d8359e1
Build fix: Turn off _GLIBCXX_DEBUG based on a compile check

Summary:
Enabling _GLIBCXX_DEBUG (implied by LLVM_ENABLE_EXPENSIVE_CHECKS) causes
std::min_element (and presumably others) to no longer be constexpr, which
in turn causes the build to fail.

This seems like a bug in the GCC STL. This change works around it.

Change-Id: I5fc471caa9c4de3ef4e87aeeac8df1b960e8e72c

Reviewers: tstellar, hans, serge-sans-paille

Differential Revision: https://reviews.llvm.org/D75199
llvm/cmake/modules/HandleLLVMOptions.cmake