Skip to content

[CMake] Propagate header changes to pure Swift modules #70859

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 12, 2024

Conversation

rintaro
Copy link
Member

@rintaro rintaro commented Jan 11, 2024

Changes to the headers imported by Swift files aren't not correctly propagated in CMake/Ninja. So Modifying C/C++ headers didn't rebuild ASTGen modules. Move the similar hack from SwiftCompilerSources and use it in ASTGen as well.

rdar://120863405

Changes to the headers imported by Swift files aren't not correctly
propagated in CMake/Ninja. So changes to C/C++ headers didn't rebuild
ASTGen modules. Move the similar hack from SwiftCompilerSources and use
it in ASTGen as well.

rdar://120863405
@rintaro rintaro requested a review from eeckstein as a code owner January 11, 2024 22:46
cmake_parse_arguments(ARGS "PUBLIC;PRIVATE;INTERFACE" "" "" ${ARGN})
foreach(DEPENDENCY ${ARGS_UNPARSED_ARGUMENTS})
function(force_add_dependencies TARGET)
foreach(DEPENDENCY ${ARGN})
Copy link
Member Author

Choose a reason for hiding this comment

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

Split force_target_link_libraries so that we can just add dependencies without linking.

#
# TODO: generate this dynamically through the modulemap; this cannot use `sed`
# as that is not available on all platforms (e.g. Windows).
file(GENERATE
Copy link
Member Author

Choose a reason for hiding this comment

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

file(GENERATE only updates the file when the content has changed. We don't need the .tmp/add_custom_command hack.

@rintaro
Copy link
Member Author

rintaro commented Jan 11, 2024

@swift-ci Please smoke test

@rintaro rintaro requested review from bnbarham and etcwilde January 11, 2024 22:49
@rintaro rintaro merged commit c8fe36d into swiftlang:main Jan 12, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants