Add SwiftPM support #575
No reviewers
Labels
No labels
bug
duplicate
enhancement
feature
help wanted
improve API
invalid
needs documentation
not-planned
rtfm
stale
support
wishlist
No milestone
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
gh-libtom/libtomcrypt!575
Loading…
Reference in a new issue
No description provided.
Delete branch "cntrump/pr_swiftpm_support"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Checklist
Build library with libtommath:
Run Swift Unit tests:
Depend on https://github.com/libtom/libtommath/pull/518
@ -0,0 +1,4 @@module libtomcrypt [extern_c] {header "../src/headers/tomcrypt.h"If libtom/libtommath#518 is really the right way to do stuff, it would also mean that this should be changed to allow using ltc in other modules or not?
@ -0,0 +1,4 @@module libtomcrypt [extern_c] {header "../src/headers/tomcrypt.h"Yes, should be changed. if a C package depend on libtomcrypt. because C use
#include <tomcrypt.h>in source.No, if a Swift/ObjC package depend on libtomcyrpt. swift/objc use
import libtomcryptin source.@ -0,0 +1,4 @@module libtomcrypt [extern_c] {header "../src/headers/tomcrypt.h"but it would make sense to support both (C and Swift/ObjC packages depending on this) or not?
@ -0,0 +1,4 @@module libtomcrypt [extern_c] {header "../src/headers/tomcrypt.h"Swift and ObjC can import package as module, module name defined in
module.modulemapBut C is not support import module, so use
#include <xx>syntax import symbols.@ -0,0 +1,4 @@module libtomcrypt [extern_c] {header "../src/headers/tomcrypt.h"Run
swift build -vheader search path in log:
Open
Package.swiftin Xcode and build, header search path in log:@ -0,0 +1,4 @@module libtomcrypt [extern_c] {header "../src/headers/tomcrypt.h"github.com/libtom/libtommath@2cec6addaf/Package.swift (L29)I'm not sure if this is correct or should instead state
publicHeadersPath: "."Like that you would also not need libtom/libtommath#518
@ -0,0 +1,4 @@module libtomcrypt [extern_c] {header "../src/headers/tomcrypt.h"It is challenged.
Set
publicHeadersPath: "."path same assources: ["."]and use-fmodule-map-file=modulemap/module.modulemap.It is not work:
@ -0,0 +1,4 @@module libtomcrypt [extern_c] {header "../src/headers/tomcrypt.h"OK, but you shouldn't build
mtestin the first place ... also let's move this discussion back to libtom/libtommath#518View command line instructions
Checkout
From your project repository, check out a new branch and test the changes.Merge
Merge the changes and update on Forgejo.Warning: The "Autodetect manual merge" setting is not enabled for this repository, you will have to mark this pull request as manually merged afterwards.