File tree Expand file tree Collapse file tree 2 files changed +7
-6
lines changed Expand file tree Collapse file tree 2 files changed +7
-6
lines changed Original file line number Diff line number Diff line change @@ -20,17 +20,18 @@ target_link_libraries(repl_swift PRIVATE ${CMAKE_DL_LIBS})
20
20
if (CMAKE_SYSTEM_NAME STREQUAL Windows)
21
21
set_target_properties (repl_swift PROPERTIES
22
22
WIN32_EXECUTABLE TRUE )
23
- elseif (CMAKE_SYSTEM_NAME STREQUAL Linux)
23
+ elseif (CMAKE_SYSTEM_NAME MATCHES "Linux|Android|OpenBSD|FreeBSD" )
24
+ string (TOLOWER "${CMAKE_SYSTEM_NAME} " platform)
24
25
if (CMAKE_SYSTEM_PROCESSOR MATCHES ppc64le)
25
26
set_target_properties (repl_swift PROPERTIES
26
- BUILD_RPATH ${SWIFT_LIBRARY_DIR} /swift/linux /powerpc64le)
27
+ BUILD_RPATH " ${SWIFT_LIBRARY_DIR} /swift/${platform} /powerpc64le" )
27
28
else ()
28
29
set_target_properties (repl_swift PROPERTIES
29
- BUILD_RPATH ${SWIFT_LIBRARY_DIR} /swift/linux )
30
+ BUILD_RPATH " ${SWIFT_LIBRARY_DIR} /swift/${platform} " )
30
31
endif ()
31
32
set_target_properties (repl_swift PROPERTIES
32
33
BUILD_WITH_INSTALL_RPATH NO
33
- INSTALL_RPATH "$ORIGIN/../lib/swift/linux " )
34
+ INSTALL_RPATH "$ORIGIN/../lib/swift/${platform} " )
34
35
endif ()
35
36
36
37
# The dummy repl executable is a C program, but we always look for a mangled
Original file line number Diff line number Diff line change 15
15
#include <dlfcn.h>
16
16
#endif
17
17
18
- #if defined(__linux__ )
18
+ #if defined(__linux__ ) || defined( __FreeBSD__ )
19
19
#include <dlfcn.h>
20
20
#endif
21
21
@@ -60,7 +60,7 @@ int main() {
60
60
// We load the system's libswiftCore, but this is overriden on tests to
61
61
// use the just built one by setting DYLD_LIBRARY_PATH.
62
62
dlopen ("/usr/lib/swift/libswiftCore.dylib" , RTLD_LAZY );
63
- #elif defined(__linux__ )
63
+ #elif defined(__linux__ ) || defined( __FreeBSD__ )
64
64
dlopen ("libswiftCore.so" , RTLD_LAZY );
65
65
#elif defined(_WIN32 )
66
66
HMODULE hModule = LoadLibraryW (L"swiftCore.dll" );
You can’t perform that action at this time.
0 commit comments