Skip to content

Commit 259afb2

Browse files
gottesmmatrick
authored andcommitted
[cmake] Add support for exporting frameworks/libraries into cmake export files.
I think this was just an oversight. The new cmake 3.16 seems to choke if we do not add SourceKit to the exports file since there are dependencies upon it in other swift libraries. (cherry picked from commit 8d712af)
1 parent 3194881 commit 259afb2

File tree

1 file changed

+15
-1
lines changed

1 file changed

+15
-1
lines changed

tools/SourceKit/cmake/modules/AddSwiftSourceKit.cmake

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -198,6 +198,13 @@ macro(add_sourcekit_library name)
198198
COMPONENT "${SOURCEKITLIB_INSTALL_IN_COMPONENT}")
199199
set_target_properties(${name} PROPERTIES FOLDER "SourceKit libraries")
200200
add_sourcekit_default_compiler_flags("${name}")
201+
202+
swift_is_installing_component("${SOURCEKITLIB_INSTALL_IN_COMPONENT}" is_installing)
203+
if(NOT is_installing)
204+
set_property(GLOBAL APPEND PROPERTY SWIFT_BUILDTREE_EXPORTS ${name})
205+
else()
206+
set_property(GLOBAL APPEND PROPERTY SWIFT_EXPORTS ${name})
207+
endif()
201208
endmacro()
202209

203210
# Add a new SourceKit executable.
@@ -324,7 +331,6 @@ macro(add_sourcekit_framework name)
324331
endif()
325332
endif()
326333

327-
328334
if (SOURCEKIT_DEPLOYMENT_OS MATCHES "^macosx")
329335
set_output_directory(${name}
330336
BINARY_DIR ${SOURCEKIT_RUNTIME_OUTPUT_INTDIR}
@@ -374,6 +380,14 @@ macro(add_sourcekit_framework name)
374380
COMMAND ${CMAKE_COMMAND} -E copy "${hdr}" "${framework_location}/Headers/${hdrname}")
375381
endforeach()
376382
endif()
383+
384+
swift_is_installing_component("${SOURCEKITFW_INSTALL_IN_COMPONENT}" is_installing)
385+
if(NOT is_installing)
386+
set_property(GLOBAL APPEND PROPERTY SWIFT_BUILDTREE_EXPORTS ${name})
387+
else()
388+
set_property(GLOBAL APPEND PROPERTY SWIFT_EXPORTS ${name})
389+
endif()
390+
377391
add_sourcekit_default_compiler_flags("${name}")
378392
endmacro(add_sourcekit_framework)
379393

0 commit comments

Comments
 (0)