Joerg Sonnenberger | 340a175 | 2013-09-25 10:37:32 +0000 | [diff] [blame] | 1 | include_directories(.) |
| 2 | |
| 3 | if ( CMAKE_SYSTEM_NAME MATCHES "Linux" ) |
| 4 | include_directories( |
| 5 | Plugins/Process/Linux |
| 6 | Plugins/Process/POSIX |
| 7 | ) |
| 8 | endif () |
| 9 | |
| 10 | if ( CMAKE_SYSTEM_NAME MATCHES "FreeBSD" ) |
| 11 | include_directories( |
| 12 | Plugins/Process/FreeBSD |
| 13 | Plugins/Process/POSIX |
| 14 | ) |
| 15 | endif () |
| 16 | |
Bruce Mitchener | 64f74da | 2015-10-24 00:27:04 +0000 | [diff] [blame] | 17 | if ( CMAKE_SYSTEM_NAME MATCHES "NetBSD" ) |
| 18 | include_directories( |
| 19 | Plugins/Process/POSIX |
| 20 | ) |
| 21 | endif () |
| 22 | |
| 23 | |
Bruce Mitchener | 6ec5d61 | 2015-10-09 03:40:55 +0000 | [diff] [blame] | 24 | set(lldbBase_SOURCES |
| 25 | lldb.cpp |
Zachary Turner | 799770c | 2015-03-18 16:56:24 +0000 | [diff] [blame] | 26 | ) |
| 27 | |
Chris Bieneman | aa098de | 2016-09-23 23:33:52 +0000 | [diff] [blame] | 28 | foreach(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() |
| 37 | endforeach() |
| 38 | |
| 39 | if(DEFINED lldb_vc) |
| 40 | set(version_inc "${CMAKE_CURRENT_BINARY_DIR}/SVNVersion.inc") |
Michal Gorny | e2f4b25 | 2016-10-19 12:54:28 +0000 | [diff] [blame] | 41 | set(get_svn_script "${LLVM_CMAKE_PATH}/GetSVN.cmake") |
Chris Bieneman | aa098de | 2016-09-23 23:33:52 +0000 | [diff] [blame] | 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. |
Chris Bieneman | 1c9da8b | 2016-11-10 23:56:32 +0000 | [diff] [blame] | 58 | set_property(SOURCE lldb.cpp APPEND PROPERTY |
| 59 | COMPILE_DEFINITIONS "HAVE_SVN_VERSION_INC") |
Chris Bieneman | aa098de | 2016-09-23 23:33:52 +0000 | [diff] [blame] | 60 | list(APPEND lldbBase_SOURCES ${version_inc}) |
| 61 | endif() |
| 62 | |
Chris Bieneman | b92cfe6 | 2016-11-10 17:33:19 +0000 | [diff] [blame] | 63 | if(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. |
Chris Bieneman | 1c9da8b | 2016-11-10 23:56:32 +0000 | [diff] [blame] | 82 | set_property(SOURCE lldb.cpp APPEND PROPERTY |
| 83 | COMPILE_DEFINITIONS "HAVE_APPLE_VERSION_INC") |
Chris Bieneman | b92cfe6 | 2016-11-10 17:33:19 +0000 | [diff] [blame] | 84 | list(APPEND lldbBase_SOURCES ${apple_version_inc}) |
| 85 | elseif(LLDB_VERSION_STRING) |
Chris Bieneman | 1c9da8b | 2016-11-10 23:56:32 +0000 | [diff] [blame] | 86 | set_property(SOURCE lldb.cpp APPEND PROPERTY |
| 87 | COMPILE_DEFINITIONS "LLDB_VERSION_STRING=${LLDB_VERSION_STRING}") |
Chris Bieneman | b92cfe6 | 2016-11-10 17:33:19 +0000 | [diff] [blame] | 88 | endif() |
| 89 | |
Bruce Mitchener | 6ec5d61 | 2015-10-09 03:40:55 +0000 | [diff] [blame] | 90 | add_lldb_library(lldbBase |
| 91 | ${lldbBase_SOURCES} |
| 92 | ) |
| 93 | |
Joerg Sonnenberger | 340a175 | 2013-09-25 10:37:32 +0000 | [diff] [blame] | 94 | add_subdirectory(Breakpoint) |
| 95 | add_subdirectory(Commands) |
| 96 | add_subdirectory(Core) |
| 97 | add_subdirectory(DataFormatters) |
| 98 | add_subdirectory(Expression) |
| 99 | add_subdirectory(Host) |
Zachary Turner | 3a00691 | 2015-03-19 22:00:21 +0000 | [diff] [blame] | 100 | add_subdirectory(Initialization) |
Joerg Sonnenberger | 340a175 | 2013-09-25 10:37:32 +0000 | [diff] [blame] | 101 | add_subdirectory(Interpreter) |
| 102 | add_subdirectory(Plugins) |
| 103 | add_subdirectory(Symbol) |
| 104 | add_subdirectory(Target) |
| 105 | add_subdirectory(Utility) |
| 106 | |
Zachary Turner | 3a00691 | 2015-03-19 22:00:21 +0000 | [diff] [blame] | 107 | # Build API last. Since liblldb needs to link against every other target, it needs |
| 108 | # those targets to have already been created. |
Zachary Turner | 799770c | 2015-03-18 16:56:24 +0000 | [diff] [blame] | 109 | add_subdirectory(API) |