Hi swift-evolution!
Robert Widmann and I have been working on a Swift wrapper for LLVM (https://github.com/harlanhaskins/LLVMSwift\ ) and we’re lamenting the lack of C++ support in SwiftPM.
Ideally, we’d be able to write C++ files that expose C APIs for LLVM APIs that aren’t yet exposed in the llvm-c API.
Before we write a proposal for C++ files in SwiftPM targets, are there any concerns/things we should consider?
Thanks,
Harlan
1 Like
Hi Harlan,
Can you describe more about exactly what distinct problems you are running
into?
Thanks!
- Daniel
···
On Mon, Jan 16, 2017 at 10:54 AM, Ankit Agarwal via swift-build-dev < swift-build-dev@swift.org> wrote:
+ swift-build-dev
On Tue, Jan 17, 2017 at 12:03 AM, Harlan Haskins via swift-evolution < > swift-evolution@swift.org> wrote:
Hi swift-evolution!
Robert Widmann and I have been working on a Swift wrapper for LLVM (
https://github.com/harlanhaskins/LLVMSwift\ ) and we’re lamenting the lack
of C++ support in SwiftPM.
Ideally, we’d be able to write C++ files that expose C APIs for LLVM APIs
that aren’t yet exposed in the llvm-c API.
Before we write a proposal for C++ files in SwiftPM targets, are there
any concerns/things we should consider?
Thanks,
Harlan
_______________________________________________
swift-evolution mailing list
swift-evolution@swift.org
https://lists.swift.org/mailman/listinfo/swift-evolution
--
Ankit
_______________________________________________
swift-build-dev mailing list
swift-build-dev@swift.org
https://lists.swift.org/mailman/listinfo/swift-build-dev
codafi
(Robert Widmann)
January 17, 2017, 12:46am
4
One concrete problem we're running into is that we cannot specify a way to invoke clang++, which makes it rather perilous to link against anything LLVM-related on Linux.
~Robert Widmann
2017/01/16 14:51、Daniel Dunbar via swift-evolution <swift-evolution@swift.org> のメッセージ:
···
Hi Harlan,
Can you describe more about exactly what distinct problems you are running into?
Thanks!
- Daniel
On Mon, Jan 16, 2017 at 10:54 AM, Ankit Agarwal via swift-build-dev <swift-build-dev@swift.org> wrote:
+ swift-build-dev
On Tue, Jan 17, 2017 at 12:03 AM, Harlan Haskins via swift-evolution <swift-evolution@swift.org> wrote:
Hi swift-evolution!
Robert Widmann and I have been working on a Swift wrapper for LLVM (https://github.com/harlanhaskins/LLVMSwift\ ) and we’re lamenting the lack of C++ support in SwiftPM.
Ideally, we’d be able to write C++ files that expose C APIs for LLVM APIs that aren’t yet exposed in the llvm-c API.
Before we write a proposal for C++ files in SwiftPM targets, are there any concerns/things we should consider?
Thanks,
Harlan
_______________________________________________
swift-evolution mailing list
swift-evolution@swift.org
https://lists.swift.org/mailman/listinfo/swift-evolution
--
Ankit
_______________________________________________
swift-build-dev mailing list
swift-build-dev@swift.org
https://lists.swift.org/mailman/listinfo/swift-build-dev
_______________________________________________
swift-evolution mailing list
swift-evolution@swift.org
https://lists.swift.org/mailman/listinfo/swift-evolution
-swift-evolution, for now.
I’m trying to build a C++ shim around the LLVM API to create an instance of the ORCJIT, visible in this PR:
llvm-swift:master
← llvm-swift:lejit
opened 04:29AM - 11 Jan 17 UTC
This won't work for a while, not until SwiftPM gets proper support for C++ depen… dencies.
I can’t build this file without passing `-Xcc -std=c++1` to `swift build`. When I pass that (along with the necessary linker flags and include dirs):
`swift build -Xcc -std=c++11 -Xcc -I/usr/local/opt/llvm/include -Xlinker -L/usr/local/opt/llvm/lib -Xlinker -lc++ -Xlinker -lLLVM`
Then It can’t build SwiftShims:
<unknown>:0: error: could not build Objective-C module 'SwiftShims'
<unknown>:0: error: invalid argument '-std=c++11' not allowed with 'C/ObjC'
That’s the issue here — I can’t pass arguments to the C++ files without affecting the C/ObjC files.
Thanks,
Harlan
···
On Jan 16, 2017, at 4:51 PM, Daniel Dunbar via swift-build-dev <swift-build-dev@swift.org> wrote:
Hi Harlan,
Can you describe more about exactly what distinct problems you are running into?
Thanks!
- Daniel
On Mon, Jan 16, 2017 at 10:54 AM, Ankit Agarwal via swift-build-dev <swift-build-dev@swift.org <mailto:swift-build-dev@swift.org>> wrote:
+ swift-build-dev
On Tue, Jan 17, 2017 at 12:03 AM, Harlan Haskins via swift-evolution <swift-evolution@swift.org <mailto:swift-evolution@swift.org>> wrote:
Hi swift-evolution!
Robert Widmann and I have been working on a Swift wrapper for LLVM (https://github.com/harlanhaskins/LLVMSwift\ ) and we’re lamenting the lack of C++ support in SwiftPM.
Ideally, we’d be able to write C++ files that expose C APIs for LLVM APIs that aren’t yet exposed in the llvm-c API.
Before we write a proposal for C++ files in SwiftPM targets, are there any concerns/things we should consider?
Thanks,
Harlan
_______________________________________________
swift-evolution mailing list
swift-evolution@swift.org <mailto:swift-evolution@swift.org>
https://lists.swift.org/mailman/listinfo/swift-evolution
--
Ankit
_______________________________________________
swift-build-dev mailing list
swift-build-dev@swift.org <mailto:swift-build-dev@swift.org>
https://lists.swift.org/mailman/listinfo/swift-build-dev
_______________________________________________
swift-build-dev mailing list
swift-build-dev@swift.org <mailto:swift-build-dev@swift.org>
https://lists.swift.org/mailman/listinfo/swift-build-dev
1 Like
Same issue.
SwiftPM does not allows you to mix Objective-C/C/C++ code. A hack workaround is to create dummy target, like:
["MyFramework", "MyFrameworkCXX"]