Index: lldb/trunk/cmake/LLDBDependencies.cmake =================================================================== --- lldb/trunk/cmake/LLDBDependencies.cmake +++ lldb/trunk/cmake/LLDBDependencies.cmake @@ -104,13 +104,6 @@ # 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 Index: lldb/trunk/source/API/CMakeLists.txt =================================================================== --- lldb/trunk/source/API/CMakeLists.txt +++ lldb/trunk/source/API/CMakeLists.txt @@ -67,7 +67,6 @@ 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 @@ ) 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}) Index: lldb/trunk/source/CMakeLists.txt =================================================================== --- lldb/trunk/source/CMakeLists.txt +++ lldb/trunk/source/CMakeLists.txt @@ -14,10 +14,33 @@ ) 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) Index: lldb/trunk/tools/lldb-server/CMakeLists.txt =================================================================== --- lldb/trunk/tools/lldb-server/CMakeLists.txt +++ lldb/trunk/tools/lldb-server/CMakeLists.txt @@ -34,14 +34,8 @@ 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