Post

Replies

Boosts

Views

Activity

Reply to How to build clang modules to work with Swift/C++ interop
Also wondering how to interop one C++ lib with another via clang modules. This document says there is no syntax for that, and that only ObjC has the "@import module" syntax. Given that it's over 4 years since C++20, and still no C++ 20 module support, I've resigned to just use clang modules. But it's unclear what they do or don't support. The docs below state that C++ is possible, and just need the "requires cplusplus" designator, but see above errrors. https://prereleases.llvm.org/18.1.0/rc3/tools/clang/docs/Modules.html
2w
Reply to How to build clang modules to work with Swift/C++ interop
I’m presuming that last bit was meant to be “Swift Xcode projects”. Yes, it's all Xcode. In a workspace, with separate swift and C++ code. The C++ is vector math and a texture encoder/decoder. The Swift is visionOS stuff, a build profiler, etc. Mostly forced into Swift use by Swift-only frameworks like SwiftUI and RealityKit. I'd like to move code off Swift and onto C++. This would primarily be Swift calling C++, and avoiding writing a bridging header. So I think I have modules for C++ building, but then get errors trying to import them into Swift. c++ module vectormath234 { // All headers are pulled in by this. requires cplusplus20 // This defaults to namespace simdk header "vectormath234.h" } Swift import vectormath234 module.modulemap:1:8 Module 'vectormath234' requires feature 'cplusplus20' MathHelpers.swift:6:8 Could not build Objective-C module 'vectormath234' I have -fmodules and -fcxx-modules set on the compile line. Thanks Quinn if you have time to address this. I really appreciate your great dev support.
2w
Reply to SwiftUI Lists down arrow handling broken
I have a profiler names alecazam/kram kram-profile. It's a SwiftUI app that does build analysis. It's not doing anything exotic with the List. The List was just broken. I finally got that app ported from Swift 5 to Swift 6, and that seems to have fixed the VStack { List } case. I can't port the other app to Swift 6 due to so many concurrency warnings. Not sure if this link will send, but this is the usage. But it's working now. I didn't change any code, just ported to Swift 6. But the tagged build isn't yet updated. https://github.com/alecazam/kram/blob/main/kram-profile/kram-profile/kram_profileApp.swift
2w
Reply to How to build clang modules to work with Swift/C++ interop
I have C++ Xcode projects and Swift projects. These only work right now with a c-style bridging header. Apple doesn’t have any sample apps that build clang modules sinice they were released many years ago. Watched the WWDC on explicit modules, but then read these don’t work with Swift interop. Have a modulemap file, -fmodules defined, but Swift still can’t see the C++ sources. one of the strengths of Apple development was ease of interop between ObjC++ and C++. Have had to wait until Swift 5/6 for something not under a C-wrapper. My code is on Swift 5 if that matters. But switching to Swift 6 is a concurrency warning flood.
2w