diff --git a/Package.swift b/Package.swift index 54a195b7..26030c19 100644 --- a/Package.swift +++ b/Package.swift @@ -4,7 +4,7 @@ import PackageDescription let package = Package( - name: "tommath", + name: "TomMath", platforms: [ .macOS(.v10_10), .iOS(.v9), .tvOS(.v9) ], @@ -12,7 +12,7 @@ let package = Package( // Products define the executables and libraries a package produces, and make them visible to other packages. .library( name: "libtommath", - targets: ["libtommath"]) + targets: [ "libtommath" ]) ], dependencies: [ // Dependencies declare other packages that this package depends on. @@ -30,10 +30,10 @@ let package = Package( cSettings: [ .unsafeFlags(["-flto=thin"]) // for Dead Code Elimination ]), - .testTarget(name: "TommathTests", - dependencies: ["libtommath"], + .testTarget(name: "TomMathTests", + dependencies: [ "libtommath" ], path: "demo", - sources: ["tommath_tests.swift"]) + sources: [ "tommath_tests.swift" ]) ], cLanguageStandard: .gnu11, cxxLanguageStandard: .gnucxx14 diff --git a/demo/tommath_tests.swift b/demo/tommath_tests.swift index fd254da3..3312787b 100644 --- a/demo/tommath_tests.swift +++ b/demo/tommath_tests.swift @@ -14,7 +14,7 @@ func mp_get_u32(_ a: UnsafePointer) -> UInt32 { return UInt32(bitPattern: mp_get_i32(a)) } -class LibTommathTests: XCTestCase { +class TomMathTests: XCTestCase { override func setUpWithError() throws { // Put setup code here. This method is called before the invocation of each test method in the class. diff --git a/modulemap/module.modulemap b/modulemap/module.modulemap index 7280be7e..e5900708 100644 --- a/modulemap/module.modulemap +++ b/modulemap/module.modulemap @@ -1,4 +1,4 @@ module libtommath [extern_c] { - header "../tommath.h" + header "tommath.h" export * } diff --git a/modulemap/tommath.h b/modulemap/tommath.h new file mode 100644 index 00000000..487da053 --- /dev/null +++ b/modulemap/tommath.h @@ -0,0 +1,9 @@ +/* +* It's necessary for targets which come from package dependencies (C libraries). +* an additional header search path argument `-I /path/to/this/directory` +* will automatically added to the include directory. +* +* This allows projects to use #include syntax which are not within the package. +*/ + +#include "../tommath.h"