Skip to content
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

fix: Use -fPIC #85

Closed
wants to merge 1 commit into from
Closed

fix: Use -fPIC #85

wants to merge 1 commit into from

Conversation

SuperH-0630
Copy link

In order for pcre2 to be linked by some dynamic libraries, the -fPIC option should be enabled.
为了pcre2能够被部分动态库链接,应启用-fPIC选项。

@jwsblokland
Copy link

Hello SuperH-0630,

Looking at your pull request, I am a bit puzzled about it. As far as I can see, the original CMakeLists.txt has all the options to build PCRE2 with -fPIC if needed. For example,

cmake -DBUILD_SHARED_LIBS=ON ...

builds a shared library of the selected components of the PCRE2 library. If you need a static version which has been build with -fPIC you need to run the following cmake command:

cmake -DBUILD_STATIC_LIBS=ON -DPCRE2_STATIC_PIC=ON ...

The latter one, I have used myself and I can without any problem create a dynamic library which makes used of static version of PCRE2 library.

@PhilipHazel
Copy link
Collaborator

I am not a Windows user, and I know very little about CMake; the contents of CMakeLists.txt are what people have advised over the years. As there seems to be disagreement here, I am not going do do anything with this pull request. Also, there are some strange Unicode characters in it.

@SuperH-0630
Copy link
Author

Hello SuperH-0630,

Looking at your pull request, I am a bit puzzled about it. As far as I can see, the original CMakeLists.txt has all the options to build PCRE2 with -fPIC if needed. For example,

cmake -DBUILD_SHARED_LIBS=ON ...

builds a shared library of the selected components of the PCRE2 library. If you need a static version which has been build with -fPIC you need to run the following cmake command:

cmake -DBUILD_STATIC_LIBS=ON -DPCRE2_STATIC_PIC=ON ...

The latter one, I have used myself and I can without any problem create a dynamic library which makes used of static version of PCRE2 library.

Thank your suggestion. I misunderstood some usage.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants