-
Notifications
You must be signed in to change notification settings - Fork 5
add pkg-config support #4
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
|
I'm a bit reluctant to add a lot more config to the library-level CMakeLists.txt files (i.e replicated across many repos) unless it aids the default way to build, with tools available by default, on both Linux and Windows. For example, the top-level fpgalink project builds on a vanilla Windows machine with VS2017 installed. With the change to get Linux libraries installed in |
|
For example with libusbwrap: gwe@x230 $ pkg-config --cflags libusbwrap
-I/usr/include -I/usr/include/libusb-1.0
gwe@x230 $ pkg-config --libs libusbwrap
-L/usr/local/fpgalink/lib64 -lerror -lusb-1.0So just with libusbwrap I everything required (libusbwrap AND libusb1) to build an application using this library. |
|
I don't want to support any build tool except cmake. Otherwise where does it stop? Someone wants Bazel support, someone else wants NMAKE support, Premake support, Ninja support, or whatever. Could you create a separate repo which has git submodules for libfpgalink and its dependencies, which installs the pkgconfig stuff you need? |
@makestuff I beg to disagree, as I find these two sentences contradictory between them, and with the licensing of this project. VS2017 is not available by default on Windows; AFAIAA it cannot be freely downloaded and installed; and it is not free or open source software. On the other hand, MSYS2 is the most used environment for providing open source EDA tooling on Windows, either explicitly or implicitly. The MSYS2 installer takes 90 MB and it can be freely downloaded. MSYS2 is free and open source software. Binaries built on MSYS2 are native Windows binaries/DLLs so it's possible to distribute the tools to be used outside of MSYS2. That is the case of https://github.com/YosysHQ/fpga-toolchain.
In MSYS2, there is an standard location for libraries Overall, I think it is legit to support a single build procedure in some project. At the same time, I must say I didn't dive deeply into the set of changes that will be required in newer versions of openFPGALoader. However, it feels to me that the modifications in this PR are not related to how to build this project, but about how to use it after it is installed. Since it is a library, I would expect making it easier for other projects to link against it.
I don't think this is desirable as a general approach. Build sources are typically located either within the project repository, or in package recipes (which might include patches). Therefore, suggesting to create a separate repo implies suggesting that each packager for each distribution might need to repeat the same fixes. It is sensible to evaluate when changes are specific to one packaging system or when can be used by many. Nevertheless, I'm not sure about this PR being useful in the given state. It seems that it only contains default locations, and the only additional option is |
|
@umarcor I'm totally agree. Having to create and maintain a more or less a fork of the answer is because libftdi needs libusb To be able to link an application to |
|
@trabucayre, thanks for clarifying the usefulness of |
|
My goal with this PR (and similars PR in others repositories) is not specifically dedicated to my need ( |
One classic way to detect and to obtain required parameters at build time requirements, to use a library, is through
pkg-config.This approach allows to fill FLAGS and LIBS with respect of dependencies (in this specific case
liberror,commonandlibusb1)This approach is Linux and msys2 compatible.
This PR add a pc.in file filled with prefix and all required informations, this one is installed in
${CMAKE_INSTALL_LIBDIR}/pkgconfig