File tree Expand file tree Collapse file tree 1 file changed +27
-9
lines changed Expand file tree Collapse file tree 1 file changed +27
-9
lines changed Original file line number Diff line number Diff line change @@ -163,13 +163,31 @@ install(FILES
163163 ${CMAKE_CURRENT_BINARY_DIR} /swift/XCTest.swiftmodule
164164 DESTINATION
165165 ${CMAKE_INSTALL_FULL_LIBDIR} /swift/${swift_os} /${swift_host_arch} )
166- install (FILES
167- ${CMAKE_CURRENT_BINARY_DIR} /${CMAKE_SHARED_LIBRARY_PREFIX} XCTest${CMAKE_SHARED_LIBRARY_SUFFIX}
168- DESTINATION
169- ${CMAKE_INSTALL_FULL_LIBDIR} )
170- # NOTE(compnerd) stage a compatibility copy in the swift resource dir
171- install (FILES
172- ${CMAKE_CURRENT_BINARY_DIR} /${CMAKE_SHARED_LIBRARY_PREFIX} XCTest${CMAKE_SHARED_LIBRARY_SUFFIX}
173- DESTINATION
174- ${CMAKE_INSTALL_FULL_LIBDIR} /swift/${swift_os} )
175166
167+ if (BUILD_SHARED_LIBS )
168+ set (library_kind SHARED)
169+ set (swift_dir swift)
170+ else ()
171+ set (library_kind STATIC )
172+ set (swift_dir swift_static)
173+ endif ()
174+
175+ set (XCTest_OUTPUT_FILE
176+ ${CMAKE_CURRENT_BINARY_DIR} /${CMAKE_${library_kind} _LIBRARY_PREFIX}XCTest${CMAKE_${library_kind} _LIBRARY_SUFFIX})
177+
178+ if (CMAKE_SYSTEM_NAME STREQUAL Windows AND BUILD_SHARED_LIBS )
179+ install (FILES
180+ ${XCTest_OUTPUT_FILE}
181+ DESTINATION
182+ ${CMAKE_INSTALL_FULL_BINDIR} )
183+ install (FILES
184+ ${CMAKE_CURRENT_BINARY_DIR} /${CMAKE_IMPORT_LIBRARY_PREFIX} XCTest${CMAKE_IMPORT_LIBRARY_SUFFIX}
185+ DESTINATION
186+ ${CMAKE_INSTALL_FULL_LIBDIR} /${swift_dir} /${swift_os} )
187+ else ()
188+ # NOTE(compnerd) stage a compatibility copy in the swift resource dir
189+ install (FILES
190+ ${XCTest_OUTPUT_FILE}
191+ DESTINATION
192+ ${CMAKE_INSTALL_FULL_LIBDIR} /${swift_dir} /${swift_os} )
193+ endif ()
You can’t perform that action at this time.
0 commit comments