Skip to content

[5.2][cmake] Add support for exporting frameworks/libraries into cmake exp… #29282

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jan 29, 2020
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 15 additions & 1 deletion tools/SourceKit/cmake/modules/AddSwiftSourceKit.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -198,6 +198,13 @@ macro(add_sourcekit_library name)
COMPONENT "${SOURCEKITLIB_INSTALL_IN_COMPONENT}")
set_target_properties(${name} PROPERTIES FOLDER "SourceKit libraries")
add_sourcekit_default_compiler_flags("${name}")

swift_is_installing_component("${SOURCEKITLIB_INSTALL_IN_COMPONENT}" is_installing)
if(NOT is_installing)
set_property(GLOBAL APPEND PROPERTY SWIFT_BUILDTREE_EXPORTS ${name})
else()
set_property(GLOBAL APPEND PROPERTY SWIFT_EXPORTS ${name})
endif()
endmacro()

# Add a new SourceKit executable.
Expand Down Expand Up @@ -324,7 +331,6 @@ macro(add_sourcekit_framework name)
endif()
endif()


if (SOURCEKIT_DEPLOYMENT_OS MATCHES "^macosx")
set_output_directory(${name}
BINARY_DIR ${SOURCEKIT_RUNTIME_OUTPUT_INTDIR}
Expand Down Expand Up @@ -374,6 +380,14 @@ macro(add_sourcekit_framework name)
COMMAND ${CMAKE_COMMAND} -E copy "${hdr}" "${framework_location}/Headers/${hdrname}")
endforeach()
endif()

swift_is_installing_component("${SOURCEKITFW_INSTALL_IN_COMPONENT}" is_installing)
if(NOT is_installing)
set_property(GLOBAL APPEND PROPERTY SWIFT_BUILDTREE_EXPORTS ${name})
else()
set_property(GLOBAL APPEND PROPERTY SWIFT_EXPORTS ${name})
endif()

add_sourcekit_default_compiler_flags("${name}")
endmacro(add_sourcekit_framework)

Expand Down