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})
2020if (CMAKE_SYSTEM_NAME STREQUAL Windows)
2121 set_target_properties (repl_swift PROPERTIES
2222 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)
2425 if (CMAKE_SYSTEM_PROCESSOR MATCHES ppc64le)
2526 set_target_properties (repl_swift PROPERTIES
26- BUILD_RPATH ${SWIFT_LIBRARY_DIR} /swift/linux /powerpc64le)
27+ BUILD_RPATH " ${SWIFT_LIBRARY_DIR} /swift/${platform} /powerpc64le" )
2728 else ()
2829 set_target_properties (repl_swift PROPERTIES
29- BUILD_RPATH ${SWIFT_LIBRARY_DIR} /swift/linux )
30+ BUILD_RPATH " ${SWIFT_LIBRARY_DIR} /swift/${platform} " )
3031 endif ()
3132 set_target_properties (repl_swift PROPERTIES
3233 BUILD_WITH_INSTALL_RPATH NO
33- INSTALL_RPATH "$ORIGIN/../lib/swift/linux " )
34+ INSTALL_RPATH "$ORIGIN/../lib/swift/${platform} " )
3435endif ()
3536
3637# 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 1515#include <dlfcn.h>
1616#endif
1717
18- #if defined(__linux__ )
18+ #if defined(__linux__ ) || defined( __FreeBSD__ )
1919#include <dlfcn.h>
2020#endif
2121
@@ -60,7 +60,7 @@ int main() {
6060 // We load the system's libswiftCore, but this is overriden on tests to
6161 // use the just built one by setting DYLD_LIBRARY_PATH.
6262 dlopen ("/usr/lib/swift/libswiftCore.dylib" , RTLD_LAZY );
63- #elif defined(__linux__ )
63+ #elif defined(__linux__ ) || defined( __FreeBSD__ )
6464 dlopen ("libswiftCore.so" , RTLD_LAZY );
6565#elif defined(_WIN32 )
6666 HMODULE hModule = LoadLibraryW (L"swiftCore.dll" );
You can’t perform that action at this time.
0 commit comments