[LLVMdev] [lldb-dev] compiler-rt's append_if definition breaks lldb build

Will Mitchell will at wmitchell.net
Tue Mar 18 13:33:14 PDT 2014


On Fri, Mar 14, 2014 at 5:02 PM, Kuba Ober <kuba at mareimbrium.org> wrote:

> In cmake projects, it seems that the scope of macros/functions is global.
> Whichever definition is seen last, wins.
>
> The incompatible assign_if definition in
> cmake/Modules/CompilerRTUtils.cmake
> breaks the lldb project, since it so happens that lldb's CMakeLists are
> processed
> after compiler_rt.
>


For reference, this was broken by r203773. The problem Kuba describes is
still present.

Until a better fix is in place, anyone else seeing this problem (which
should trigger anytime you build llvm, compiler_rt, and lldb together via
cmake) can work around it with this hack:

diff --git a/CMakeLists.txt b/CMakeLists.txt
index cf27ead..59ba634 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -129,8 +129,9 @@ endif()
 # Disable GCC warnings
 check_cxx_compiler_flag("-Wno-deprecated-declarations"
                         CXX_SUPPORTS_NO_DEPRECATED_DECLARATIONS)
-append_if(CXX_SUPPORTS_NO_DEPRECATED_DECLARATIONS
-          "-Wno-deprecated-declarations" CMAKE_CXX_FLAGS)
+if (CXX_SUPPORTS_NO_DEPRECATED_DECLARATIONS)
+  set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-deprecated-declarations")
+endif()

 # Disable Clang warnings
 check_cxx_compiler_flag("-Wno-deprecated-register"


Will
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20140318/6a67330a/attachment.html>


More information about the llvm-dev mailing list