vknabel / vscode-swift-development-environment

New home of Swift Development Environment for VS Code
https://marketplace.visualstudio.com/items?itemName=vknabel.vscode-swift-development-environment
Apache License 2.0
175 stars 14 forks source link

resolve -XSwiftc flag error #56

Closed haifengkao closed 5 years ago

haifengkao commented 5 years ago

-XSwiftc will take double quote as the part of argument, but nodejs needs shell: true to support it (https://github.com/nodejs/node/issues/10461)

my settings.json needs to pass -target to swift compiler by

    "sde.swiftBuildingParams" : [
        "build",
        "-Xswiftc",
        "\"-target\"",
        "-Xswiftc",
        "\"x86_64-apple-ios12.1-simulator\"",
        "-Xswiftc",
        "\"-sdk\"",
        "-Xswiftc",
        "\"/Applications/Xcode-beta.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.0.sdk\""
     ]

The double quote\" is not correctly handled without shell: true close #55

vknabel commented 5 years ago

Thank you very much for your contribution!

This won't fix #55 alone, but combined with a fix of me (SDE was confused if Sources were mentioned in config-targets and Package.swift-sources).