Skip to content

ClangImporter: setup macros for WinSDK import #21735

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 11, 2019

Conversation

compnerd
Copy link
Member

@compnerd compnerd commented Jan 9, 2019

Windows SDK requires that the platform target is identified.
Unfortunately, cl does not specify the value, so we cannot actually
specify the value in the clang frontend. Specify this in the swift
frontend as this obscures the clang invocation.

Replace this paragraph with a description of your changes and rationale. Provide links to external references/discussions if appropriate.

Resolves SR-NNNN.

@compnerd
Copy link
Member Author

compnerd commented Jan 9, 2019

@swift-ci please test

@compnerd
Copy link
Member Author

compnerd commented Jan 9, 2019

CC: @jrose-apple

@swift-ci
Copy link
Contributor

swift-ci commented Jan 9, 2019

Build failed
Swift Test Linux Platform
Git Sha - f94d07b17c346c04da3f5f6cb73cb667ca5827d5

@swift-ci
Copy link
Contributor

swift-ci commented Jan 9, 2019

Build failed
Swift Test OS X Platform
Git Sha - f94d07b17c346c04da3f5f6cb73cb667ca5827d5

@@ -541,6 +541,23 @@ getNormalInvocationArguments(std::vector<std::string> &invocationArgStrs,
});
}

if (triple.isOSWindows()) {
Copy link
Contributor

Choose a reason for hiding this comment

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

This will also kick in for Cygwin. Is that desired?

@jrose-apple
Copy link
Contributor

Also, worth writing a test for with a manual target triple!

@compnerd
Copy link
Member Author

compnerd commented Jan 9, 2019

@jrose-apple - yeah, this definitely needs a test. I think that Cygwin also needs these macros defined. IIRC, @tinysun212 had done the cygwin port in the 3.0 timeframe?

@compnerd compnerd force-pushed the windows-target-macros branch from f94d07b to 9e52cef Compare January 9, 2019 19:14
@compnerd
Copy link
Member Author

compnerd commented Jan 9, 2019

@swift-ci please test and merge

@slavapestov
Copy link
Contributor

You might also consider defining WIN32_LEAN_AND_MEAN

@compnerd
Copy link
Member Author

@slavapestov I don't think that defining WIN32_LEAN_AND_MEAN is correct, because there may be cases where you want the extended types.

@compnerd
Copy link
Member Author

@swift-ci please test

@swift-ci
Copy link
Contributor

Build failed
Swift Test Linux Platform
Git Sha - f94d07b17c346c04da3f5f6cb73cb667ca5827d5

@swift-ci
Copy link
Contributor

Build failed
Swift Test OS X Platform
Git Sha - f94d07b17c346c04da3f5f6cb73cb667ca5827d5

@compnerd compnerd force-pushed the windows-target-macros branch from 9e52cef to a969f6a Compare January 10, 2019 22:31
@compnerd
Copy link
Member Author

@swift-ci please test and merge

Windows SDK requires that the platform target is identified.
Unfortunately, `cl` does not specify the value, so we cannot actually
specify the value in the clang frontend.  Specify this in the swift
frontend as this obscures the clang invocation.
@compnerd compnerd force-pushed the windows-target-macros branch from a969f6a to e012dc7 Compare January 11, 2019 00:58
@compnerd
Copy link
Member Author

@swift-ci please test and merge

@swift-ci swift-ci merged commit 2672acb into swiftlang:master Jan 11, 2019
@compnerd compnerd deleted the windows-target-macros branch January 11, 2019 05:25
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.

5 participants