Skip to content

CMake: strip -l prefix on CMAKE_THREAD_LIBS_INIT#884

Merged
bradh352 merged 1 commit intoc-ares:mainfrom
bradh352:issue_883
Sep 16, 2024
Merged

CMake: strip -l prefix on CMAKE_THREAD_LIBS_INIT#884
bradh352 merged 1 commit intoc-ares:mainfrom
bradh352:issue_883

Conversation

@bradh352
Copy link
Copy Markdown
Member

As per Issue #883, an incorrect libcares.pc can be generated when CMAKE_THREAD_LIBS_INIT contains a value like -lpthread because it gets added to libcares.pc with another -l prefix. We can't control the behavior of CMAKE_THREAD_LIBS_INIT since its set by FIND_PACKAGE (Threads).

Lets strip the -l prefix from the library before adding it to CARES_DEPENDENT_LIBS which is used in the generation of libcares.pc.

Fixes #883
Reported-By: 前进,前进,进 (@leleliu008)
Fix By: Brad House (@bradh352)

@bradh352 bradh352 merged commit 79a4c63 into c-ares:main Sep 16, 2024
@bradh352 bradh352 deleted the issue_883 branch September 16, 2024 16:02
bradh352 added a commit that referenced this pull request Sep 16, 2024
As per Issue #883, an incorrect `libcares.pc` can be generated when
`CMAKE_THREAD_LIBS_INIT` contains a value like `-lpthread` because it
gets added to `libcares.pc` with another `-l` prefix. We can't control
the behavior of `CMAKE_THREAD_LIBS_INIT` since its set by `FIND_PACKAGE
(Threads)`.

Lets strip the `-l` prefix from the library before adding it to
`CARES_DEPENDENT_LIBS` which is used in the generation of `libcares.pc`.

Fixes #883 
Reported-By: 前进,前进,进 (@leleliu008)
Fix By: Brad House (@bradh352)
bradh352 added a commit that referenced this pull request Sep 16, 2024
As per Issue #883, an incorrect `libcares.pc` can be generated when
`CMAKE_THREAD_LIBS_INIT` contains a value like `-lpthread` because it
gets added to `libcares.pc` with another `-l` prefix. We can't control
the behavior of `CMAKE_THREAD_LIBS_INIT` since its set by `FIND_PACKAGE
(Threads)`.

Lets strip the `-l` prefix from the library before adding it to
`CARES_DEPENDENT_LIBS` which is used in the generation of `libcares.pc`.

Fixes #883 
Reported-By: 前进,前进,进 (@leleliu008)
Fix By: Brad House (@bradh352)
bradh352 added a commit that referenced this pull request Sep 16, 2024
As per Issue #883, an incorrect `libcares.pc` can be generated when
`CMAKE_THREAD_LIBS_INIT` contains a value like `-lpthread` because it
gets added to `libcares.pc` with another `-l` prefix. We can't control
the behavior of `CMAKE_THREAD_LIBS_INIT` since its set by `FIND_PACKAGE
(Threads)`.

Lets strip the `-l` prefix from the library before adding it to
`CARES_DEPENDENT_LIBS` which is used in the generation of `libcares.pc`.

Fixes #883 
Reported-By: 前进,前进,进 (@leleliu008)
Fix By: Brad House (@bradh352)
bradh352 added a commit that referenced this pull request Sep 16, 2024
As per Issue #883, an incorrect `libcares.pc` can be generated when
`CMAKE_THREAD_LIBS_INIT` contains a value like `-lpthread` because it
gets added to `libcares.pc` with another `-l` prefix. We can't control
the behavior of `CMAKE_THREAD_LIBS_INIT` since its set by `FIND_PACKAGE
(Threads)`.

Lets strip the `-l` prefix from the library before adding it to
`CARES_DEPENDENT_LIBS` which is used in the generation of `libcares.pc`.

Fixes #883 
Reported-By: 前进,前进,进 (@leleliu008)
Fix By: Brad House (@bradh352)
bradh352 added a commit that referenced this pull request Sep 16, 2024
As per Issue #883, an incorrect `libcares.pc` can be generated when
`CMAKE_THREAD_LIBS_INIT` contains a value like `-lpthread` because it
gets added to `libcares.pc` with another `-l` prefix. We can't control
the behavior of `CMAKE_THREAD_LIBS_INIT` since its set by `FIND_PACKAGE
(Threads)`.

Lets strip the `-l` prefix from the library before adding it to
`CARES_DEPENDENT_LIBS` which is used in the generation of `libcares.pc`.

Fixes #883 
Reported-By: 前进,前进,进 (@leleliu008)
Fix By: Brad House (@bradh352)
bradh352 added a commit that referenced this pull request Sep 16, 2024
As per Issue #883, an incorrect `libcares.pc` can be generated when
`CMAKE_THREAD_LIBS_INIT` contains a value like `-lpthread` because it
gets added to `libcares.pc` with another `-l` prefix. We can't control
the behavior of `CMAKE_THREAD_LIBS_INIT` since its set by `FIND_PACKAGE
(Threads)`.

Lets strip the `-l` prefix from the library before adding it to
`CARES_DEPENDENT_LIBS` which is used in the generation of `libcares.pc`.

Fixes #883 
Reported-By: 前进,前进,进 (@leleliu008)
Fix By: Brad House (@bradh352)
bradh352 added a commit that referenced this pull request Sep 16, 2024
As per Issue #883, an incorrect `libcares.pc` can be generated when
`CMAKE_THREAD_LIBS_INIT` contains a value like `-lpthread` because it
gets added to `libcares.pc` with another `-l` prefix. We can't control
the behavior of `CMAKE_THREAD_LIBS_INIT` since its set by `FIND_PACKAGE
(Threads)`.

Lets strip the `-l` prefix from the library before adding it to
`CARES_DEPENDENT_LIBS` which is used in the generation of `libcares.pc`.

Fixes #883 
Reported-By: 前进,前进,进 (@leleliu008)
Fix By: Brad House (@bradh352)
bradh352 added a commit that referenced this pull request Sep 16, 2024
As per Issue #883, an incorrect `libcares.pc` can be generated when
`CMAKE_THREAD_LIBS_INIT` contains a value like `-lpthread` because it
gets added to `libcares.pc` with another `-l` prefix. We can't control
the behavior of `CMAKE_THREAD_LIBS_INIT` since its set by `FIND_PACKAGE
(Threads)`.

Lets strip the `-l` prefix from the library before adding it to
`CARES_DEPENDENT_LIBS` which is used in the generation of `libcares.pc`.

Fixes #883 
Reported-By: 前进,前进,进 (@leleliu008)
Fix By: Brad House (@bradh352)
michael-dev pushed a commit to HamelinPorts/android_external_c-ares that referenced this pull request Apr 25, 2026
As per Issue c-ares#883, an incorrect `libcares.pc` can be generated when
`CMAKE_THREAD_LIBS_INIT` contains a value like `-lpthread` because it
gets added to `libcares.pc` with another `-l` prefix. We can't control
the behavior of `CMAKE_THREAD_LIBS_INIT` since its set by `FIND_PACKAGE
(Threads)`.

Lets strip the `-l` prefix from the library before adding it to
`CARES_DEPENDENT_LIBS` which is used in the generation of `libcares.pc`.

Fixes c-ares#883 
Reported-By: 前进,前进,进 (@leleliu008)
Fix By: Brad House (@bradh352)
michael-dev pushed a commit to HamelinPorts/android_external_c-ares that referenced this pull request Apr 25, 2026
As per Issue c-ares#883, an incorrect `libcares.pc` can be generated when
`CMAKE_THREAD_LIBS_INIT` contains a value like `-lpthread` because it
gets added to `libcares.pc` with another `-l` prefix. We can't control
the behavior of `CMAKE_THREAD_LIBS_INIT` since its set by `FIND_PACKAGE
(Threads)`.

Lets strip the `-l` prefix from the library before adding it to
`CARES_DEPENDENT_LIBS` which is used in the generation of `libcares.pc`.

Fixes c-ares#883 
Reported-By: 前进,前进,进 (@leleliu008)
Fix By: Brad House (@bradh352)
michael-dev pushed a commit to HamelinPorts/android_external_c-ares that referenced this pull request Apr 25, 2026
As per Issue c-ares#883, an incorrect `libcares.pc` can be generated when
`CMAKE_THREAD_LIBS_INIT` contains a value like `-lpthread` because it
gets added to `libcares.pc` with another `-l` prefix. We can't control
the behavior of `CMAKE_THREAD_LIBS_INIT` since its set by `FIND_PACKAGE
(Threads)`.

Lets strip the `-l` prefix from the library before adding it to
`CARES_DEPENDENT_LIBS` which is used in the generation of `libcares.pc`.

Fixes c-ares#883 
Reported-By: 前进,前进,进 (@leleliu008)
Fix By: Brad House (@bradh352)
michael-dev pushed a commit to HamelinPorts/android_external_c-ares that referenced this pull request Apr 25, 2026
As per Issue c-ares#883, an incorrect `libcares.pc` can be generated when
`CMAKE_THREAD_LIBS_INIT` contains a value like `-lpthread` because it
gets added to `libcares.pc` with another `-l` prefix. We can't control
the behavior of `CMAKE_THREAD_LIBS_INIT` since its set by `FIND_PACKAGE
(Threads)`.

Lets strip the `-l` prefix from the library before adding it to
`CARES_DEPENDENT_LIBS` which is used in the generation of `libcares.pc`.

Fixes c-ares#883 
Reported-By: 前进,前进,进 (@leleliu008)
Fix By: Brad House (@bradh352)
michael-dev pushed a commit to HamelinPorts/android_external_c-ares that referenced this pull request Apr 25, 2026
As per Issue c-ares#883, an incorrect `libcares.pc` can be generated when
`CMAKE_THREAD_LIBS_INIT` contains a value like `-lpthread` because it
gets added to `libcares.pc` with another `-l` prefix. We can't control
the behavior of `CMAKE_THREAD_LIBS_INIT` since its set by `FIND_PACKAGE
(Threads)`.

Lets strip the `-l` prefix from the library before adding it to
`CARES_DEPENDENT_LIBS` which is used in the generation of `libcares.pc`.

Fixes c-ares#883 
Reported-By: 前进,前进,进 (@leleliu008)
Fix By: Brad House (@bradh352)
michael-dev pushed a commit to HamelinPorts/android_external_c-ares that referenced this pull request Apr 25, 2026
As per Issue c-ares#883, an incorrect `libcares.pc` can be generated when
`CMAKE_THREAD_LIBS_INIT` contains a value like `-lpthread` because it
gets added to `libcares.pc` with another `-l` prefix. We can't control
the behavior of `CMAKE_THREAD_LIBS_INIT` since its set by `FIND_PACKAGE
(Threads)`.

Lets strip the `-l` prefix from the library before adding it to
`CARES_DEPENDENT_LIBS` which is used in the generation of `libcares.pc`.

Fixes c-ares#883 
Reported-By: 前进,前进,进 (@leleliu008)
Fix By: Brad House (@bradh352)
michael-dev pushed a commit to HamelinPorts/android_external_c-ares that referenced this pull request Apr 25, 2026
As per Issue c-ares#883, an incorrect `libcares.pc` can be generated when
`CMAKE_THREAD_LIBS_INIT` contains a value like `-lpthread` because it
gets added to `libcares.pc` with another `-l` prefix. We can't control
the behavior of `CMAKE_THREAD_LIBS_INIT` since its set by `FIND_PACKAGE
(Threads)`.

Lets strip the `-l` prefix from the library before adding it to
`CARES_DEPENDENT_LIBS` which is used in the generation of `libcares.pc`.

Fixes c-ares#883 
Reported-By: 前进,前进,进 (@leleliu008)
Fix By: Brad House (@bradh352)
michael-dev pushed a commit to HamelinPorts/android_external_c-ares that referenced this pull request Apr 25, 2026
As per Issue c-ares#883, an incorrect `libcares.pc` can be generated when
`CMAKE_THREAD_LIBS_INIT` contains a value like `-lpthread` because it
gets added to `libcares.pc` with another `-l` prefix. We can't control
the behavior of `CMAKE_THREAD_LIBS_INIT` since its set by `FIND_PACKAGE
(Threads)`.

Lets strip the `-l` prefix from the library before adding it to
`CARES_DEPENDENT_LIBS` which is used in the generation of `libcares.pc`.

Fixes c-ares#883 
Reported-By: 前进,前进,进 (@leleliu008)
Fix By: Brad House (@bradh352)
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.

generate a incorrect libcares.pc

1 participant