-
Notifications
You must be signed in to change notification settings - Fork 10.4k
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
[cmake] Provide private extension points to the build #77507
[cmake] Provide private extension points to the build #77507
Conversation
Adding a macro to tie non-boolean variables into the defaulting mechanism.
Adding documentation on the behavior of the `defaulted_option` and `defaulted_set` macros.
@swift-ci please test |
Runtimes/Core/CMakeLists.txt
Outdated
# Allowed extension points: | ||
# - DefaultSettings.cmake | ||
# - Settings.cmake | ||
set(SwiftCore_PRIVATE_MODULE_DIR "${SwiftCore_CMAKE_MODULES_DIR}/private" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What do you think of SwiftCore_VENDOR_MODULE_DIR
? This is the vendor specific settings and makes it clear when you concatenate them even if you don't know what it is (e.g. ${SwiftCore_VENDOR_MODULE_DIR}/DefaultSettings.cmake
vs ${SwiftCore_PRIVATE_MODULE_DIR}/DefaultSettings.cmake
).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sure, sounds good to me
Adding vendor-specific extension points to the build system, giving vendors a place to put their internal settings and defaults, without having to modify the build directly. This helps reduce the chances of merge conflicts and public changes breaking internal settings. The location of the macros are set with `SwiftCore_PRIVATE_MODULE_DIR`, so vendors can keep their private extensions in a separate location if desired. Otherwise, it defaults to `cmake/modules/private`, which intentionally does not exist at this time. Currently, we have extensions for the default settings and global settings.
eb80255
to
2df8a18
Compare
@swift-ci please smoke test |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Excellent!
@swift-ci please smoke test Linux |
This patch provides extension points on the build system so that vendors can keep vendor-specific build system settings private, without having to worry about merge conflicts haunting them for the rest of time.
The location of the extension modules is set with the
SwiftCore_PRIVATE_MODULE_DIR
variable. If it is not specified, the default location is undercmake/modules/private
.Currently, there are extension points for the default settings, and for the global settings.