@@ -27,6 +27,20 @@ if(WIN32)
27
27
Sources /SwiftInspectClient/SwiftInspectClient.cpp )
28
28
target_link_libraries (SwiftInspectClient PRIVATE
29
29
SwiftInspectClientInterface )
30
+ elseif (LINUX )
31
+ string (APPEND CMAKE_Swift_FLAGS " -Xcc -D_GNU_SOURCE" )
32
+ add_library (SwiftInspectLinux STATIC
33
+ Sources /SwiftInspectLinux/ElfFile.swift
34
+ Sources /SwiftInspectLinux/LinkMap.swift
35
+ Sources /SwiftInspectLinux/MemoryMap.swift
36
+ Sources /SwiftInspectLinux/Process.swift
37
+ Sources /SwiftInspectLinux/ProcFS.swift
38
+ Sources /SwiftInspectLinux/SymbolCache.swift )
39
+ target_link_libraries (SwiftInspectLinux PRIVATE
40
+ LinuxSystemHeaders )
41
+ add_library (LinuxSystemHeaders INTERFACE )
42
+ target_include_directories (LinuxSystemHeaders INTERFACE
43
+ Sources /SwiftInspectLinux/SystemHeaders )
30
44
endif ()
31
45
32
46
add_executable (swift-inspect
@@ -38,6 +52,7 @@ add_executable(swift-inspect
38
52
Sources /swift-inspect/Operations/DumpRawMetadata.swift
39
53
Sources /swift-inspect/Backtrace.swift
40
54
Sources /swift-inspect/DarwinRemoteProcess.swift
55
+ Sources /swift-inspect/LinuxRemoteProcess.swift
41
56
Sources /swift-inspect/main.swift
42
57
Sources /swift-inspect/Process.swift
43
58
Sources /swift-inspect/RemoteMirror+Extensions.swift
@@ -54,6 +69,11 @@ target_link_libraries(swift-inspect PRIVATE
54
69
if (WIN32 )
55
70
target_link_libraries (swift-inspect PRIVATE
56
71
SwiftInspectClientInterface )
72
+ elseif (LINUX )
73
+ target_link_libraries (swift-inspect PRIVATE
74
+ SwiftInspectLinux )
75
+ target_link_libraries (swift-inspect PRIVATE
76
+ LinuxSystemHeaders )
57
77
endif ()
58
78
59
79
install (TARGETS swift-inspect
0 commit comments