Skip to content

Commit ca19001

Browse files
committed
build: stage the swiftmodule for build compatibility
Copy the swiftmodule and swiftdoc to the root of the build to permit building swiftpm in the swift build against the CMake build.
1 parent a055eff commit ca19001

File tree

1 file changed

+14
-0
lines changed

1 file changed

+14
-0
lines changed

CMakeLists.txt

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -94,6 +94,20 @@ add_swift_library(XCTest
9494
-I${XCTEST_PATH_TO_FOUNDATION_BUILD}/Foundation
9595
-I${XCTEST_PATH_TO_FOUNDATION_BUILD}/Foundation/usr/lib/swift)
9696

97+
# Temporary staging; the various swift projects that depend on XCTest all expect
98+
# the swiftdoc and swiftmodule to be in the top level.
99+
# So for now, make a copy so we don't have to do a coordinated commit across
100+
# all the swift projects to change this assumption.
101+
add_custom_target(TARGET
102+
XCTest
103+
POST_BUILD
104+
COMMAND
105+
${CMAKE_COMMAND} -E copy ${CMAKE_CURRENT_BINARY_DIR}/swift/XCTest.swiftdoc ${CMAKE_CURRENT_BINARY_DIR}
106+
COMMAND
107+
${CMAKE_COMMAND} -E copy ${CMAKE_CURRENT_BINARY_DIR}/swift/XCTest.swiftmodule ${CMAKE_CURRENT_BINARY_DIR}
108+
COMMENT
109+
"Copying swiftmodule/swiftdoc to build directory")
110+
97111
if(EXISTS ${LLVM_MAIN_SRC_DIR}/utils/lit/lit.py)
98112
set(LIT_COMMAND "${PYTHON_EXECUTABLE};${LLVM_MAIN_SRC_DIR}/utils/lit/lit.py"
99113
CACHE STRING "command used to spawn llvm-lit")

0 commit comments

Comments
 (0)