-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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
MDEV-29955: add ${PCRE_LIBRARY_PATH} to link directories #3225
base: 10.6
Are you sure you want to change the base?
Conversation
Commit 3a33ae8 uses pkg-config to find the location of PCRE library. However when a user installs the library in non-standard location (/workspace/mylib for example), it's also recommended to use the '-Wl,-rpath -Wl,LIBDIR' linker flag to point the build system to where the library installed. All new code of the whole pull request, including one or several files that are either new files or modified ones, are contributed under the BSD-new license. I am contributing on behalf of my employer Amazon Web Services.
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks like a good catch to me.
@@ -85,6 +85,7 @@ MACRO (CHECK_PCRE) | |||
PKG_CHECK_MODULES(PCRE libpcre2-8) | |||
# in case pkg-config or libpcre2-8.pc is not installed: | |||
CHECK_LIBRARY_EXISTS(pcre2-8 pcre2_match_8 "${PCRE_LIBRARY_DIRS}" HAVE_PCRE2_MATCH_8) | |||
link_directories(${PCRE_LIBRARY_DIRS}) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
does it work "in case pkg-config or libpcre2-8.pc is not installed" ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
When pkg-config
is not available CMake configuration prints out
-- Could NOT find PkgConfig (missing: PKG_CONFIG_EXECUTABLE)
and many libraries won't work.
And when libpcre2-8.pc
is not available the variable ${PCRE_LIBRARY_DIR}
is empty because it relies on PKG_CHECK_MODULES()
at line 85 to set the variable, but I think in this case there's not much we can do if a user also uses a non-standard path for library.
I think the first case is not in the scope of this PR, but for second case I can't think of a good approach to handle this (besides add CMake options for user to set the path manually).
Description
Commit 3a33ae8 uses pkg-config to find the location of PCRE library.
However when a user installs the library in non-standard location
(/workspace/mylib for example), it's also recommended to use the
'-Wl,-rpath -Wl,LIBDIR' linker flag to point the build system to where
the library installed.
How can this PR be tested?
Manual checks:
Basing the PR against the correct MariaDB version
PR quality check