Minimal Swift/iOS Delivery Example?

"yacin (as yacin at defmacro dot cc)" <[email protected]>
Newsgroups gmane.lisp.lispworks.general
Message-ID <[email protected]>
howdy HUG,

does anyone have a shareable example of delivering for iOS in a SwiftUI application? i think i’ve gotten as far as i can based on the ObjC delivery LispWorks' docs and searching the internet, but i’m unable to get things properly working. i have an existing iOS app and an existing CL codebase for the backend logic that i’m trying to merge. everything builds, my library is linked, and the app launches as expected, however, Lisp initialization fails. here’s what i’ve done so far:

* build the .o files for delivery (ios-deliver.lisp is attached).
* add a bridging header that has #include “LispWorks.h”
* include the LispWorks.h file from the Othello example
* ensure the .o, LispWorks.h, and bridging header paths are included in Xcode’s build settings for Other Linking Flags, Header Search Paths and Objective-C Bridging Header settings, respectively.
* added the following Swift function to initialize Lisp and call it in the main app’s init() method.

func initializeLispWorks() {
    let result = LispWorksInitialize(CommandLine.argc, CommandLine.unsafeArgv)

    if result == 0 {
        print("LispWorks Runtime Initialized Successfully.")
    } else {
        print("Failed to initialize LispWorks Runtime.")
    }
}

the app builds successfully, and i can confirm that it is linking my delivered .o file from the build log. everything starts fine, but i see the message for failing to initialize the LispWorks runtime. any ideas? any way i can debug this more? i already have the delivery level set to 0.

note: that the delivered library originally contained a dependency on CL+SSL, which initially failed due to not being able to find libcrypto.dylib. this is only for a small piece of functionality that, for now, i can eschew, which is not brought in anymore if :IOS-DELIVER is included in *FEATURES*. once i did this, i no longer saw any errors while trying to initialize Lisp, but it still fails. if anyone has advice for including CL+SSL (in order to include DEXADOR for HTTP requests) on iOS, that would be nice, but it should be easy enough to directly do that in Swift and pass the returned HTML to Lisp to work without requiring DEXADOR.

cheers

yacin


lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.