|
| 1 | +cmake_minimum_required(VERSION 3.28) |
| 2 | + |
| 3 | +project(swift-inspect |
| 4 | + LANGUAGES CXX Swift) |
| 5 | + |
| 6 | +# Set C++ standard |
| 7 | +set(CMAKE_CXX_STANDARD 17) |
| 8 | +set(CMAKE_CXX_STANDARD_REQUIRED ON) |
| 9 | +set(CMAKE_CXX_EXTENSIONS OFF) |
| 10 | + |
| 11 | +set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/lib) |
| 12 | +set(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/lib) |
| 13 | +set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin) |
| 14 | + |
| 15 | +find_package(ArgumentParser CONFIG REQUIRED) |
| 16 | + |
| 17 | +add_library(SymbolicationShims INTERFACE) |
| 18 | +target_include_directories(SymbolicationShims INTERFACE |
| 19 | + Sources/SymbolicationShims) |
| 20 | + |
| 21 | +if(WIN32) |
| 22 | + add_library(SwiftInspectClientInterface INTERFACE) |
| 23 | + target_include_directories(SwiftInspectClientInterface INTERFACE |
| 24 | + Sources/SwiftInspectClientInterface) |
| 25 | + |
| 26 | + add_library(SwiftInspectClient SHARED |
| 27 | + Sources/SwiftInspectClient/SwiftInspectClient.cpp) |
| 28 | + target_link_libraries(SwiftInspectClient PRIVATE |
| 29 | + SwiftInspectClientInterface) |
| 30 | +endif() |
| 31 | + |
| 32 | +add_executable(swift-inspect |
| 33 | + Sources/swift-inspect/Operations/DumpArray.swift |
| 34 | + Sources/swift-inspect/Operations/DumpCacheNodes.swift |
| 35 | + Sources/swift-inspect/Operations/DumpConcurrency.swift |
| 36 | + Sources/swift-inspect/Operations/DumpConformanceCache.swift |
| 37 | + Sources/swift-inspect/Operations/DumpGenericMetadata.swift |
| 38 | + Sources/swift-inspect/Operations/DumpRawMetadata.swift |
| 39 | + Sources/swift-inspect/Backtrace.swift |
| 40 | + Sources/swift-inspect/DarwinRemoteProcess.swift |
| 41 | + Sources/swift-inspect/main.swift |
| 42 | + Sources/swift-inspect/Process.swift |
| 43 | + Sources/swift-inspect/RemoteMirror+Extensions.swift |
| 44 | + Sources/swift-inspect/RemoteProcess.swift |
| 45 | + Sources/swift-inspect/String+Extensions.swift |
| 46 | + Sources/swift-inspect/Symbolication+Extensions.swift |
| 47 | + Sources/swift-inspect/WindowsRemoteProcess.swift |
| 48 | + Sources/swift-inspect/WinSDK+Extentions.swift) |
| 49 | +target_compile_options(swift-inspect PRIVATE |
| 50 | + -parse-as-library) |
| 51 | +target_link_libraries(swift-inspect PRIVATE |
| 52 | + ArgumentParser |
| 53 | + swiftRemoteMirror) |
| 54 | +if(WIN32) |
| 55 | + target_link_libraries(swift-inspect PRIVATE |
| 56 | + SwiftInspectClientInterface) |
| 57 | +endif() |
| 58 | + |
| 59 | +install(TARGETS swift-inspect |
| 60 | + DESTINATION bin) |
| 61 | +if(WIN32) |
| 62 | + install(TARGETS SwiftInspectClient |
| 63 | + RUNTIME DESTINATION bin) |
| 64 | +endif() |
0 commit comments