-
-
Notifications
You must be signed in to change notification settings - Fork 6.7k
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
pkgconfig: Fix path relocation for mingw #3248
Conversation
Just separate the path to prefix and includedir variables.
@doronbehar Is this allowed according to the rules? |
Thanks for your contribution! Is this also related to #2907? |
I am not sure if this change is related to that issue. I can not reproduce that issue in my Arch installation. But I would not like to ruin it 😅 I can wait for their comments @dvzrv @eli-schwartz This change is for msys2/mingw environment. For example, with the prefix variable, pkgconfig automatically changes/relocates |
As I have no experience with pkgconfig, but see several issues on this: is there a way I can test this in the CI? We are using mingw in GitHub Actions. |
I am not sure what to test. But with this change, the output of a command will be like this:
Without this change, output is nothing. |
Do I need to install anything before this? |
This change is generally speaking correct. Although the When configured via
But this will be wrong in the case of
Cmake doesn't have a way of correctly handling this. Meson has This PR is to my knowledge the best way to handle the issue in cmake, and perfect is the enemy of the good, so... It looks good to me. |
It is NOT related to the other issue. The other issue is a problem where running the testsuite will (somehow) cause the nlohmann_json project options (specifically, the prefix and includedir) to be overwritten by the testsuite's project options. |
At first, I thought about this
But in the previous commit, it was changed to CMAKE_INSTALL_FULL_INCLUDEDIR by @doronbehar. So, I assume full includedir is the rule. |
Right, and it links to https://github.com/jtojnar/cmake-snips#assuming-cmake_install_dir-is-relative-path which is really just another way of examining what I just mentioned. In fact, right below that is https://github.com/jtojnar/cmake-snips#concatenating-paths-when-building-pkg-config-files which offers a cmake module reimplementing meson's built-in |
OK, understood. |
Hmm? Can't you just update this PR to switch to the other method? :) Why did you close it? |
I am not sure if that method is perfect in every case. |
It should be, but either that or this PR in its current state would be useful improvements over the status quo. The perfect is the enemy of the good, hence this PR in its current state could still be merged. |
Just separate the path to prefix and includedir variables.
Pull request checklist
Read the Contribution Guidelines for detailed information.
include/nlohmann
directory, runmake amalgamate
to create the single-header filesingle_include/nlohmann/json.hpp
. The whole process is described here.