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

[SR-6430] [SwiftPM] Build error passing invalid C standard to a C source file #4914

Closed
ddunbar opened this issue Nov 18, 2017 · 3 comments
Closed
Labels

Comments

@ddunbar
Copy link
Member

ddunbar commented Nov 18, 2017

Previous ID SR-6430
Radar rdar://problem/35782488
Original Reporter @ddunbar
Type Bug
Status Resolved
Resolution Done
Additional Detail from JIRA
Votes 0
Component/s Package Manager
Labels Bug
Assignee None
Priority Medium

md5: d3941d6d3d807f3debd3b3b6b3efdd39

Issue Description:

SwiftPM is passing the wrong language standard option, when the C++ language version is overridden:

ddunbar@ozzy-5:foo$ find .
.
./.gitignore
./Package.swift
./README.md
./Sources
./Sources/foo
./Sources/foo/a.c
./Sources/foo/a.cpp

$ cat Package.swift 
// swift-tools-version:4.0

import PackageDescription

let package = Package(
  name: "foo",
  targets: [
    .target(
      name: "foo",
      dependencies: []),
    ],
  cxxLanguageStandard: .cxx14
)

$ swift build
warning: no include directory found for target 'foo'; libraries cannot be imported without public headersCompile foo a.cpp
Compile foo a.c
error: invalid argument '-std=c++14' not allowed with 'C'
error: terminated(1): /Xcode/Edge9E57a/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/swift-build-tool -f /private/tmp/foo/.build/debug.yaml main
@ddunbar
Copy link
Member Author

ddunbar commented Nov 18, 2017

/cc @aciidb0mb3r

@ankitspd
Copy link
Member

@swift-ci create

@ankitspd
Copy link
Member

#1404

--

commit 90abb3c (g/master, master)
Author: Ankit Aggarwal <ankit_aggarwal@apple.com>
Date: Thu Nov 30 14:55:37 2017 -0800

[Build] Add lang std flag per source file

We were adding language standard flag per target which is wrong because
a Clang target can contain mixed C and C++ files.

@swift-ci swift-ci transferred this issue from apple/swift-issues Apr 25, 2022
@shahmishal shahmishal transferred this issue from apple/swift May 4, 2022
This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants