Skip to content

Commit e18f166

Browse files
authored
Merge pull request swiftlang#28850 from gottesmm/pr-1632740d4d2400f5193382e8403bc7c29a02d5d0
[cmake] Add support for exporting frameworks/libraries into cmake export files.
2 parents a9c9f26 + 8d712af commit e18f166

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)