1include_directories(.) 2 3if ( CMAKE_SYSTEM_NAME MATCHES "Linux" ) 4include_directories( 5 Plugins/Process/Linux 6 Plugins/Process/POSIX 7 ) 8endif () 9 10if ( CMAKE_SYSTEM_NAME MATCHES "FreeBSD" ) 11include_directories( 12 Plugins/Process/FreeBSD 13 Plugins/Process/POSIX 14 ) 15endif () 16 17if ( CMAKE_SYSTEM_NAME MATCHES "NetBSD" ) 18include_directories( 19 Plugins/Process/POSIX 20 ) 21endif () 22 23 24set(lldbBase_SOURCES 25 lldb.cpp 26 ) 27 28foreach(file 29 "${LLDB_SOURCE_DIR}/.git/logs/HEAD" # Git 30 "${LLDB_SOURCE_DIR}/.svn/wc.db" # SVN 1.7 31 "${LLDB_SOURCE_DIR}/.svn/entries" # SVN 1.6 32 ) 33 if(EXISTS "${file}") 34 set(lldb_vc "${file}") 35 break() 36 endif() 37endforeach() 38 39if(DEFINED lldb_vc) 40 set(version_inc "${CMAKE_CURRENT_BINARY_DIR}/SVNVersion.inc") 41 set(get_svn_script "${LLVM_CMAKE_PATH}/GetSVN.cmake") 42 43 # Create custom target to generate the VC revision include. 44 add_custom_command(OUTPUT "${version_inc}" 45 DEPENDS "${lldb_vc}" "${get_svn_script}" 46 COMMAND 47 ${CMAKE_COMMAND} "-DFIRST_SOURCE_DIR=${LLDB_SOURCE_DIR}" 48 "-DFIRST_NAME=LLDB" 49 "-DHEADER_FILE=${version_inc}" 50 -P "${get_svn_script}") 51 52 # Mark the generated header as being generated. 53 set_source_files_properties("${version_inc}" 54 PROPERTIES GENERATED TRUE 55 HEADER_FILE_ONLY TRUE) 56 57 # Tell Version.cpp that it needs to build with -DHAVE_SVN_VERSION_INC. 58 set_property(SOURCE lldb.cpp APPEND PROPERTY 59 COMPILE_DEFINITIONS "HAVE_SVN_VERSION_INC") 60 list(APPEND lldbBase_SOURCES ${version_inc}) 61endif() 62 63if(APPLE) 64 set(apple_version_inc "${CMAKE_CURRENT_BINARY_DIR}/AppleVersion.inc") 65 set(apple_version_script "${LLDB_SOURCE_DIR}/cmake/modules/EmbedAppleVersion.cmake") 66 set(info_plist ${LLDB_SOURCE_DIR}/resources/LLDB-Info.plist) 67 68 # Create custom target to generate the VC revision include. 69 add_custom_command(OUTPUT "${apple_version_inc}" 70 DEPENDS "${apple_version_script}" "${info_plist}" 71 COMMAND 72 ${CMAKE_COMMAND} "-DLLDB_INFO_PLIST=${info_plist}" 73 "-DHEADER_FILE=${apple_version_inc}" 74 -P "${apple_version_script}") 75 76 # Mark the generated header as being generated. 77 set_source_files_properties("${apple_version_inc}" 78 PROPERTIES GENERATED TRUE 79 HEADER_FILE_ONLY TRUE) 80 81 # Tell Version.cpp that it needs to build with -DHAVE_SVN_VERSION_INC. 82 set_property(SOURCE lldb.cpp APPEND PROPERTY 83 COMPILE_DEFINITIONS "HAVE_APPLE_VERSION_INC") 84 list(APPEND lldbBase_SOURCES ${apple_version_inc}) 85elseif(LLDB_VERSION_STRING) 86 set_property(SOURCE lldb.cpp APPEND PROPERTY 87 COMPILE_DEFINITIONS "LLDB_VERSION_STRING=${LLDB_VERSION_STRING}") 88endif() 89 90add_lldb_library(lldbBase 91 ${lldbBase_SOURCES} 92 ) 93 94add_subdirectory(Breakpoint) 95add_subdirectory(Commands) 96add_subdirectory(Core) 97add_subdirectory(DataFormatters) 98add_subdirectory(Expression) 99add_subdirectory(Host) 100add_subdirectory(Initialization) 101add_subdirectory(Interpreter) 102add_subdirectory(Plugins) 103add_subdirectory(Symbol) 104add_subdirectory(Target) 105add_subdirectory(Utility) 106 107# Build API last. Since liblldb needs to link against every other target, it needs 108# those targets to have already been created. 109add_subdirectory(API) 110