Open Feuermurmel opened 6 years ago
I don't have experience with pkgConfig and to use it would require knowing it well enough to support Linux (major distros) and macOS (brew & macports) since SwiftGL supports both platforms. Also I'm not sure how it handles stuff like "-dev" packages on Linux. Lastly the current release version of GLFW has bugs in keyboard input that I ran into easily so I've been using a manually compiled 3.3 version which fixes those and I would recommend against not using the 3.2.1 version.
So the downside ends up being the time needed to learn pkgconfig, test and support all platforms, and still manage to use the 3.3 GLFW code which isn't installed by most package managers by default and usually has to be compiled and installed manually.
I have been working on this project to upgrade it to new versions of Swift as they are released and don't have much time for the integration side of things, so any help in that regard would be welcome. The newness of Swift Package Manager and the difficulties of cross platform develop make things hard unfortunately.
I tried to run the
hello-window-1
example from the examples repository by naively typingswift run
but got the following error:I installed
glfw
using MacPorts. Adding the include and library directories on the command line solves the problem and let's the example run without modification:swift run -Xswiftc -I/opt/local/include -Xlinker -L/opt/local/lib
. But this kinda sucks because I have to remember adding those options whenever I want to build or run my projects and Xcode does not automatically know about those directories either and I have to configure it there too.I'm a complete novice when it comes to Swift package management but I noticed that adding
pkgConfig: "glfw3"
toCGLFW3
'sPackage.swift
allows me to run the example with justswift run
and from within the generated Xcode project without any adjustments.Is there any downside to this? Otherwise it would IMHO greatly improve the experience of using this library on macOS.