summaryrefslogtreecommitdiffstats
path: root/lldb
diff options
context:
space:
mode:
authorBruce Mitchener <bruce.mitchener@gmail.com>2015-10-09 03:40:55 +0000
committerBruce Mitchener <bruce.mitchener@gmail.com>2015-10-09 03:40:55 +0000
commit6ec5d61bdae112ef079f1c101bd50a26ffaeb0d3 (patch)
tree0ac8d8a66b618060a7ad47307872eb189acbb4f8 /lldb
parent1825fac3c914ad555f87e8995cdb7d92c33fb55e (diff)
downloadbcm5719-llvm-6ec5d61bdae112ef079f1c101bd50a26ffaeb0d3.tar.gz
bcm5719-llvm-6ec5d61bdae112ef079f1c101bd50a26ffaeb0d3.zip
Fix handling of LLDB_VERS_GENERATED_FILE.
Summary: This is Darwin only. The symbol defined by ${LLDB_VERS_GENERATED_FILE} is used by source/lldb.cpp, so anything that uses lldb.cpp (which is in lldbBase) should also have the generated symbol. This means that the entire process can be centralized within source/CMakeLists.txt where lldbBase is constructed. Additionally, the custom command should have dependencies on the project file as well as the generation script so that if either changes, the version file is correctly re-generated and everything is re-linked appropriately. * cmake/LLDBDependencies.cmake: Remove everything related to the generated version file from here. * source/CMakeLists.txt: On Darwin, add the generated version file to the sources that make up lldbBase. Also, create a custom target and make lldbBase depend on it to re-generate the generated file as needed. * source/API/CMakeLists.txt: Don't need to build the generated version file here or use it to control linking against swig_wrapper. * tools/lldb-server/CMakeLists.txt: Likewise. Reviewers: dawn, sas, clayborg, zturner Subscribers: lldb-commits Differential Revision: http://reviews.llvm.org/D13552 llvm-svn: 249806
Diffstat (limited to 'lldb')
-rw-r--r--lldb/cmake/LLDBDependencies.cmake7
-rw-r--r--lldb/source/API/CMakeLists.txt3
-rw-r--r--lldb/source/CMakeLists.txt25
-rw-r--r--lldb/tools/lldb-server/CMakeLists.txt6
4 files changed, 25 insertions, 16 deletions
diff --git a/lldb/cmake/LLDBDependencies.cmake b/lldb/cmake/LLDBDependencies.cmake
index 57bea2d9fce..d984b22e042 100644
--- a/lldb/cmake/LLDBDependencies.cmake
+++ b/lldb/cmake/LLDBDependencies.cmake
@@ -104,13 +104,6 @@ endif ()
# 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
diff --git a/lldb/source/API/CMakeLists.txt b/lldb/source/API/CMakeLists.txt
index ef901c18042..271afa9c9a8 100644
--- a/lldb/source/API/CMakeLists.txt
+++ b/lldb/source/API/CMakeLists.txt
@@ -67,7 +67,6 @@ add_lldb_library(liblldb SHARED
SBUnixSignals.cpp
SystemInitializerFull.cpp
${LLDB_WRAP_PYTHON}
- ${LLDB_VERS_GENERATED_FILE}
)
# This should not be part of LLDBDependencies.cmake, because we don't
@@ -99,7 +98,7 @@ else()
)
endif()
-if (LLDB_WRAP_PYTHON OR LLDB_VERS_GENERATED_FILE)
+if (LLDB_WRAP_PYTHON)
add_dependencies(liblldb swig_wrapper)
endif()
target_link_libraries(liblldb ${cmake_2_8_12_PRIVATE} ${LLDB_SYSTEM_LIBS})
diff --git a/lldb/source/CMakeLists.txt b/lldb/source/CMakeLists.txt
index 5a4057abde0..8a2aba24767 100644
--- a/lldb/source/CMakeLists.txt
+++ b/lldb/source/CMakeLists.txt
@@ -14,10 +14,33 @@ include_directories(
)
endif ()
+set(lldbBase_SOURCES
+ lldb.cpp
+ )
+
+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}
+ DEPENDS ${LLDB_SOURCE_DIR}/scripts/generate-vers.pl
+ ${LLDB_SOURCE_DIR}/lldb.xcodeproj/project.pbxproj)
+ set_source_files_properties(${LLDB_VERS_GENERATED_FILE} PROPERTIES GENERATED 1)
+ # Add this to lldbBase since lldb.cpp uses the symbol defined here.
+ list(APPEND lldbBase_SOURCES ${LLDB_VERS_GENERATED_FILE})
+ add_custom_target(lldbGeneratedVersion
+ DEPENDS ${LLDB_VERS_GENERATED_FILE})
+endif()
+
add_lldb_library(lldbBase
- lldb.cpp
+ ${lldbBase_SOURCES}
)
+if (CMAKE_SYSTEM_NAME MATCHES "Darwin")
+ add_dependencies(lldbBase lldbGeneratedVersion)
+endif()
+
add_subdirectory(Breakpoint)
add_subdirectory(Commands)
add_subdirectory(Core)
diff --git a/lldb/tools/lldb-server/CMakeLists.txt b/lldb/tools/lldb-server/CMakeLists.txt
index d8f0fcad18c..f8d2e0ecb16 100644
--- a/lldb/tools/lldb-server/CMakeLists.txt
+++ b/lldb/tools/lldb-server/CMakeLists.txt
@@ -34,14 +34,8 @@ else()
lldb-platform.cpp
lldb-server.cpp
LLDBServerUtilities.cpp
- ../../source/lldb.cpp
- ${LLDB_VERS_GENERATED_FILE}
)
- 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
OpenPOWER on IntegriCloud