-
Notifications
You must be signed in to change notification settings - Fork 344
[clang] Add deployment target env vars to features.json #4803
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
Would you mind cherry-picking this to stable/20220421 in addition to any other cherry-pick you do, as well as cherry-picking the corresponding swift change to rebranch? Ideally merge the swift change a little before this one so that we don't have any erroneous failures. |
de4e222
to
5e59bb1
Compare
5cf312a
to
d5fb71c
Compare
clang/tools/driver/CMakeLists.txt
Outdated
${features_file_src} | ||
${features_file_dest} | ||
DEPENDS ${features_file_src}) | ||
configure_file(${features_file_src} ${features_file_dest}) |
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.
To be safer for the substitutions, I tend to use the @ONLY
option so that we can mark the substitutions as @NAME@
where NAME
is a define that we control and specify the value using add_definitions
or set_soureces_properties
.
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.
I can put @ONLY
in this PR.
We only need a variable in a downstream repo, so I'll try to make it work there.
Can you show me an example of configure_file
using add_definitions
and set_source_files_properties
? The following doesn't work (using @FOO
in the source file):
set(FOO "x")
configure_file(${features_file_src} ${features_file_dest} @ONLY)
set_source_files_properties(${features_file_src} PROPERTIES BAR "${FOO}")
Does this mechanism hide variables not explicitly set through set_source_files_properties
or add_definitions
?
@swift-ci please test |
d5fb71c
to
d392845
Compare
@swift-ci please test |
d392845
to
0872120
Compare
@swift-ci please test |
Error seems unrelated, but I'm unable to merge 🤷
|
I believe that's fixed now |
@swift-ci please test macOS platform |
This adds new entry to the
features.json
file with list of environment variables used when deciding the deployment target. To be able to make these values depend on#ifdef
directives, we run the file through the preprocessor instead of simple copy.rdar://91377604