Skip to content
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

Fix merging Swift header files for Xcode 10.2 #2748

Merged
Merged
Changes from all commits
Commits
File filter...
Filter file types
Jump to…
Jump to file or symbol
Failed to load files and symbols.
+8 −1
Diff settings

Always

Just for now

@@ -362,10 +362,16 @@ private func mergeSwiftHeaderFiles(_ simulatorExecutableURL: URL,
precondition(deviceExecutableURL.isFileURL)
precondition(executableOutputURL.isFileURL)

let includeTargetConditionals = """
#ifndef TARGET_OS_SIMULATOR
#include <TargetConditionals.h>
#endif\n
"""
let conditionalPrefix = "#if TARGET_OS_SIMULATOR\n"
let conditionalElse = "\n#else\n"
let conditionalSuffix = "\n#endif"
let conditionalSuffix = "\n#endif\n"

let includeTargetConditionalsContents = includeTargetConditionals.data(using: .utf8)!
let conditionalPrefixContents = conditionalPrefix.data(using: .utf8)!
let conditionalElseContents = conditionalElse.data(using: .utf8)!
let conditionalSuffixContents = conditionalSuffix.data(using: .utf8)!
@@ -378,6 +384,7 @@ private func mergeSwiftHeaderFiles(_ simulatorExecutableURL: URL,

var fileContents = Data()

fileContents.append(includeTargetConditionalsContents)
fileContents.append(conditionalPrefixContents)
fileContents.append(simulatorHeaderContents)
fileContents.append(conditionalElseContents)
ProTip! Use n and p to navigate between commits in a pull request.
You can’t perform that action at this time.