Skip to content

[CMake] Update MinSizeRel configuration for Apple platforms... #78667

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

Conversation

edymtt
Copy link
Contributor

@edymtt edymtt commented Jan 15, 2025

...and use it as a default for one of them.

Also preserve the behaviour introduced in #33444 to avoid a binary increase in this configuration.

Addresses rdar://142820419

...and use it as a default for one of them.

Addresses rdar://142820419
This preserves the behaviour introduced in swiftlang#33444.

Addresses rdar://142820419
@edymtt
Copy link
Contributor Author

edymtt commented Jan 15, 2025

@swift-ci please smoke test

@edymtt edymtt changed the title CMake] Update MinSizeRel configuration for Apple platforms... [CMake] Update MinSizeRel configuration for Apple platforms... Jan 15, 2025

if(NOT "${CMAKE_BUILD_TYPE}" STREQUAL "MinSizeRel")
# Using these in MinSizeRel would result in a 15% increase in the binary size
target_compile_options(swiftCore PRIVATE
Copy link
Member

Choose a reason for hiding this comment

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

We could probably keep these in the target_compile_options above and let generator expressions handle the condition like so:

"$<$<AND:$<COMPILE_LANGUAGE:Swift>,$<NOT:$<CONFIG:MinSizeRel>>>:SHELL:-Xllvm -sil-inline-generics>"
"$<$<AND:$<COMPILE_LANGUAGE:Swift>,$<NOT:$<CONFIG:MinSizeRel>>>:SHELL:-Xllvm -sil-partial-specialization>"

But I'm also not going to require that.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Thanks for the pointer -- I searched for CMAKE_BUILD_TYPE in the documentation of the generator expressions, and I assumed it was not supported.

@edymtt edymtt merged commit cb47eb1 into swiftlang:main Jan 16, 2025
3 checks passed
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.

4 participants