I am using the
SPMUtility library as a command line parser.
.package(url: "https://github.com/apple/swift-package-manager.git", from: "0.5.0")
So far so good it all works. When I create the - to be distributed - binary using:
swift build --build-path "./.build-macos" -c release
(I am using different build directories for Linux versus macOS) the application is created as expected.
Swift-5.0 we should be able to rely on the libraries that are part of the distribution and the created library should be runnable without any further dependencies.
However when I check which dynamic libraries are part of my application:
otool -L .build-macos/release/overrideResolveDotConf .build-macos/release/overrideResolveDotConf: /usr/lib/libobjc.A.dylib (compatibility version 1.0.0, current version 228.0.0) /usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current version 1281.0.0) xxxxxx/.build-macos/x86_64-apple-macosx/release/libSwiftPM.dylib (compatibility version 0.0.0, current version 0.0.0) /System/Library/Frameworks/CoreFoundation.framework/Versions/A/CoreFoundation (compatibility version 150.0.0, current version 1673.126.0) /System/Library/Frameworks/Foundation.framework/Versions/C/Foundation (compatibility version 300.0.0, current version 1673.126.0) @rpath/libswiftCore.dylib (compatibility version 1.0.0, current version 1100.8.255) @rpath/libswiftDarwin.dylib (compatibility version 1.0.0, current version 0.0.0) @rpath/libswiftDispatch.dylib (compatibility version 1.0.0, current version 0.0.0) @rpath/libswiftFoundation.dylib (compatibility version 1.0.0, current version 0.0.0) @rpath/libswiftObjectiveC.dylib (compatibility version 1.0.0, current version 0.0.0)
I notice that there is a reference to a dynamic library inside the
.build-macos directory. (I replaced the leading path with
So I have a couple of questions:
SPMUtilitynot intended for distribution? If so I have to create my own command line parser I guess. If it can be used I think there should also be a non-dynamic library in the build process.
- Is it possible to add some flags to the compilation so that this library actually gets created and or linked into the library?
Any advise would be appreciated.