[Lldb-commits] [PATCH] D13535: Fix cmake build on OSX after r249434.

Dawn Perchik via lldb-commits lldb-commits at lists.llvm.org
Wed Oct 7 14:46:22 PDT 2015


dawn created this revision.
dawn added reviewers: sas, clayborg, zturner.
dawn added a subscriber: lldb-commits.
dawn set the repository for this revision to rL LLVM.

This fixes the cmake build on OSX when building in a new workspace.   It reverts r249434 and instead fixes the issue as proposed in lldb-dev in message 'cmake question and [PATCH] for Undefined symbol "_liblldb_coreVersionString"'.  It gets the warning:
    ninja: warning: multiple rules generate tools/lldb/source/LLDB_vers.c. builds involving this target will not be correct; continuing anyway
(which no one was able to suggest a fix for in lldb-dev), but at least it fixes the problem without breaking the entire build :)

Repository:
  rL LLVM

http://reviews.llvm.org/D13535

Files:
  cmake/LLDBDependencies.cmake
  source/CMakeLists.txt
  tools/lldb-server/CMakeLists.txt

Index: tools/lldb-server/CMakeLists.txt
===================================================================
--- tools/lldb-server/CMakeLists.txt
+++ tools/lldb-server/CMakeLists.txt
@@ -35,9 +35,14 @@
     lldb-server.cpp
     LLDBServerUtilities.cpp
     ../../source/lldb.cpp
+    ${LLDB_VERS_GENERATED_FILE}
     )
 
-  # The Darwin linker doesn't understand --start-group/--end-group.
+  if (LLDB_VERS_GENERATED_FILE)
+    add_dependencies(lldb-server swig_wrapper)
+  endif()
+
+# The Darwin linker doesn't understand --start-group/--end-group.
   if (LLDB_LINKER_SUPPORTS_GROUPS)
     target_link_libraries(lldb-server
                           -Wl,--start-group ${LLDB_USED_LIBS} -Wl,--end-group)
Index: source/CMakeLists.txt
===================================================================
--- source/CMakeLists.txt
+++ source/CMakeLists.txt
@@ -14,19 +14,8 @@
   )
 endif ()
 
-if ( CMAKE_SYSTEM_NAME MATCHES "Darwin" )
-  set(LLDB_VERS_GENERATED_FILE ${LLDB_BINARY_DIR}/source/LLDB_vers.c)
-  add_custom_command(OUTPUT ${LLDB_VERS_GENERATED_FILE}
-    COMMAND ${LLDB_SOURCE_DIR}/scripts/generate-vers.pl
-            ${LLDB_SOURCE_DIR}/lldb.xcodeproj/project.pbxproj liblldb_core
-            > ${LLDB_VERS_GENERATED_FILE})
-
-  set_source_files_properties(${LLDB_VERS_GENERATED_FILE} PROPERTIES GENERATED 1)
-endif ()
-
 add_lldb_library(lldbBase
   lldb.cpp
-   ${LLDB_VERS_GENERATED_FILE}
   )
 
 add_subdirectory(Breakpoint)
Index: cmake/LLDBDependencies.cmake
===================================================================
--- cmake/LLDBDependencies.cmake
+++ cmake/LLDBDependencies.cmake
@@ -104,6 +104,13 @@
 
 # Darwin-only libraries
 if ( CMAKE_SYSTEM_NAME MATCHES "Darwin" )
+  set(LLDB_VERS_GENERATED_FILE ${LLDB_BINARY_DIR}/source/LLDB_vers.c)
+  add_custom_command(OUTPUT ${LLDB_VERS_GENERATED_FILE}
+    COMMAND ${LLDB_SOURCE_DIR}/scripts/generate-vers.pl
+            ${LLDB_SOURCE_DIR}/lldb.xcodeproj/project.pbxproj liblldb_core
+            > ${LLDB_VERS_GENERATED_FILE})
+
+  set_source_files_properties(${LLDB_VERS_GENERATED_FILE} PROPERTIES GENERATED 1)
   list(APPEND LLDB_USED_LIBS
     lldbPluginDynamicLoaderDarwinKernel
     lldbPluginObjectFileMachO


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D13535.36798.patch
Type: text/x-patch
Size: 2196 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/lldb-commits/attachments/20151007/caa3e36f/attachment.bin>


More information about the lldb-commits mailing list