build: silence GCC warning on Linux
authorSaleem Abdulrasool <compnerd@compnerd.org>
Mon, 21 Jul 2014 18:18:52 +0000 (18:18 +0000)
committerSaleem Abdulrasool <compnerd@compnerd.org>
Mon, 21 Jul 2014 18:18:52 +0000 (18:18 +0000)
LLDWrapPython.cpp is a generated file.  This contains a double assignment to the
same value, which causes GCC to emit a warning about sequence point evaluation
causing a use-before-init.  Simply silence the warning.

llvm-svn: 213575

lldb/source/CMakeLists.txt

index 309288a..b8b4d0a 100644 (file)
@@ -199,8 +199,14 @@ set( LLVM_LINK_COMPONENTS
 
 
 if ( NOT LLDB_DISABLE_PYTHON )
-  set_source_files_properties(${LLDB_BINARY_DIR}/scripts/LLDBWrapPython.cpp PROPERTIES GENERATED 1)
   set(LLDB_WRAP_PYTHON ${LLDB_BINARY_DIR}/scripts/LLDBWrapPython.cpp)
+
+  set_source_files_properties(${LLDB_WRAP_PYTHON} PROPERTIES GENERATED 1)
+  if (LLVM_COMPILER_IS_GCC_COMPATIBLE AND
+      NOT "${CMAKE_SYSTEM_NAME}" MATCHES "Darwin")
+    set_property(SOURCE ${LLDB_WRAP_PYTHON}
+                 APPEND_STRING PROPERTY COMPILE_FLAGS " -Wno-sequence-point")
+  endif ()
 endif()
 set(SHARED_LIBRARY 1)