1
1
# Set the correct rpath to locate libswiftCore.
2
- if (LLDB_BUILD_FRAMEWORK)
3
- get_target_property (framework_target_dir liblldb LIBRARY_OUTPUT_DIRECTORY )
4
- set (CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -Wl,-rpath \
5
- -Wl,${framework_target_dir} /LLDB.framework/Versions/${LLDB_FRAMEWORK_VERSION} /Resources/Swift/macosx" )
6
- elseif ( CMAKE_SYSTEM_NAME MATCHES "Linux" )
7
- # Set the correct rpath to locate libswiftCore
2
+ if ( CMAKE_SYSTEM_NAME MATCHES "Linux" )
8
3
if (CMAKE_HOST_SYSTEM_PROCESSOR MATCHES "ppc64le" )
9
4
set (CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} \
10
5
-Wl,-rpath,${CMAKE_BINARY_DIR} /../swift-linux-powerpc64le/lib${LLVM_LIBDIR_SUFFIX} /swift/linux/powerpc64le" )
@@ -15,7 +10,13 @@ elseif( CMAKE_SYSTEM_NAME MATCHES "Linux" )
15
10
set (CMAKE_INSTALL_RPATH "$ORIGIN/../lib/swift/linux:${CMAKE_INSTALL_RPATH} " )
16
11
endif ()
17
12
18
- add_lldb_tool(repl_swift
13
+ # Override locally, so the repl is ad-hoc signed.
14
+ set (LLVM_CODESIGNING_IDENTITY "-" )
15
+
16
+ # Requires system-provided Swift libs.
17
+ set (CMAKE_OSX_DEPLOYMENT_TARGET 10.14.4)
18
+
19
+ add_lldb_tool(repl_swift ADD_TO_FRAMEWORK
19
20
main.c
20
21
)
21
22
target_link_libraries (repl_swift PRIVATE ${CMAKE_DL_LIBS} )
@@ -24,10 +25,6 @@ if(CMAKE_SYSTEM_NAME STREQUAL Windows)
24
25
WIN32_EXECUTABLE TRUE )
25
26
endif ()
26
27
27
- if (LLDB_BUILD_FRAMEWORK)
28
- lldb_add_to_framework(repl_swift)
29
- endif ()
30
-
31
28
# The dummy repl executable is a C program, but we always look for a mangled
32
29
# swift symbol (corresponding to main). If we build the repl with debug info,
33
30
# the debugger looks at the frame language (looking up the compile unit) and gets
@@ -40,3 +37,25 @@ else()
40
37
set_target_properties (repl_swift PROPERTIES
41
38
COMPILE_FLAGS "-g0" )
42
39
endif ()
40
+
41
+ if (APPLE )
42
+ # Set the RPATHs to locate libswiftCore. Prefer the just-built one.
43
+ set (swift_buildtree ${LLDB_PATH_TO_SWIFT_BUILD} /lib/swift/macosx)
44
+ set (system_libs /usr/lib/swift)
45
+
46
+ if (LLDB_BUILD_FRAMEWORK)
47
+ get_target_property (framework_build_dir liblldb LIBRARY_OUTPUT_DIRECTORY )
48
+ set (lldb_buildtree {framework_build_dir}/LLDB.framework /Versions/${LLDB_FRAMEWORK_VERSION} /Resources/Swift/macosx)
49
+ set (lldb_installtree Swift/macosx) # repl_swift is installed to framework Resources
50
+ endif ()
51
+
52
+ lldb_setup_rpaths(repl_swift
53
+ BUILD_RPATH
54
+ ${swift_buildtree}
55
+ ${lldb_buildtree}
56
+ ${system_libs}
57
+ INSTALL_RPATH
58
+ ${lldb_installtree}
59
+ ${system_libs}
60
+ )
61
+ endif ()
0 commit comments