Skip to content

Commit 5eee2cf

Browse files
stmontgomeryrintaro
authored andcommitted
Use the correct library name for the macro plugin on Linux
1 parent a5ffe52 commit 5eee2cf

File tree

1 file changed

+12
-1
lines changed

1 file changed

+12
-1
lines changed

Sources/CMakeLists.txt

+12-1
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,18 @@ add_subdirectory(_TestingInternals)
4848
add_subdirectory(Testing)
4949

5050
if(NOT SwiftTesting_BuildMacrosAsExecutables)
51-
install(PROGRAMS "${INSTALL_DIR}/lib/libTestingMacros.dylib"
51+
# Hardcode the known library names based on system name as a workaround since
52+
# TestingMacros uses `ExternalProject` and we cannot directly query the
53+
# properties of its targets here.
54+
if("${CMAKE_SYSTEM_NAME}" STREQUAL "Darwin")
55+
set(SwiftTesting_TestingMacrosLibraryName "libTestingMacros.dylib")
56+
elseif("${CMAKE_SYSTEM_NAME}" STREQUAL "Linux")
57+
set(SwiftTesting_TestingMacrosLibraryName "libTestingMacros.so")
58+
else()
59+
message(FATAL_ERROR "Unable to determine the library name for TestingMacros based on system name: ${CMAKE_SYSTEM_NAME}")
60+
endif()
61+
62+
install(PROGRAMS "${INSTALL_DIR}/lib/${SwiftTesting_TestingMacrosLibraryName}"
5263
# TODO: Finalize the install path
5364
DESTINATION lib/swift/host/plugins)
5465
endif()

0 commit comments

Comments
 (0)