-
Notifications
You must be signed in to change notification settings - Fork 98
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
cmake: build fails due to semicolons in CMAKE_C_FLAGS set by custom pcscd.cmake & openssl.cmake #474
Comments
Both `openssl.cmake` and `pcscd.cmake` use FindPkgConfig to retrieve the required CFLAGS and LDFLAGS. However FindPkgConfig returns lists [1], which are stored as semicolon-separated strings in CMake. This breaks the build when there's more than one flag in any of those variables. Fixes Yubico#474
Both `openssl.cmake` and `pcscd.cmake` use FindPkgConfig to retrieve the required CFLAGS and LDFLAGS. However FindPkgConfig returns lists, which are stored as semicolon-separated strings in CMake. This breaks the build when there's more than one flag in any of those variables. Fixes Yubico#474
Thank you for bringing this issue to our attention and providing the PR to fix. However, we still aim to have yubico-piv-tool build on older Linux platforms that do not support cmake version newer than 3.5 so this PR will be breaking building on those platforms. Now that we know about this issue though, we'll be looking into finding a way to fix it without having to use a newer cmake version. Thank you again for the PR, it is highly appreciate it. |
yubico-piv-tool fails to build on a current openSUSE Tumbleweed (cmake version 3.28.1).
Symptom
Input:
Output:
This semicolon breaks the build:
-DOPENSSL_LOAD_CONF;-I/usr/include
.Cause
As far as I can see, the root cause lies in the supplied custom modules
pcscd.cmake
andopenssl.cmake
. Both are using FindPkgConfig to retrieve the required CFLAGS and LDFLAGS. However FindPkgConfig returns lists, which are stored as semicolon-separated strings in CMake.Example:
Output:
I assume the developer of these custom modules was using a system where PCSC_CFLAGS and friends only contain one value and thus no semicolons.
Fix
The proper way to convert lists to strings in modern CMake is list(JOIN ...).
I will submit a PR shortly to address this bug in
cmake/pcscd.cmake
andcmake/openssl.cmake
.The text was updated successfully, but these errors were encountered: