Skip to content

[Build System: CMake] Always copy the apinotes into the build directory when the apinotes directory is included via SWIFT_INCLUDE_APINOTES. #24527

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
May 6, 2019
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
2 changes: 1 addition & 1 deletion apinotes/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ add_custom_command(
COMMAND
"${CMAKE_COMMAND}" "-E" "copy_if_different" ${inputs} "${output_dir}/")

add_custom_target("copy_apinotes"
add_custom_target("copy_apinotes" ALL
DEPENDS "${outputs}" "${output_dir}"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Question. Why are we adding add_custom_command here? Shouldn't we be using add_custom_command_target? That caused weird dependency issues for us before.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not sure about the history of this file, I didn't write this copy logic myself. We just need this target to be added to the default build target if this directory is included. This is mostly for the standalone overlay builds.

I wasn't intending to drastically change the structure for this PR as I need it to unblock some other work, but I'd be happy to discuss a more comprehensive change in the future.

Copy link
Member

@compnerd compnerd May 6, 2019

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is only adding the target, not an associated command, so this is fine as is. I had a change that replaced this with a add_custom_command_target but would lose the ability to create the symlink (and instead always copy). I think that is generally better, but, I don't know if that will create a problem for Apple's distribution.

COMMENT "Copying API notes to ${output_dir}"
SOURCES "${sources}")
Expand Down