pkg-config: Remove pthread link flag from Cflags

Remove the threads link library variable references from the pkg-config
Cflags: field, removing -lpthread(s) from the compile flags.

"-l*" linker flags should only be part of the Libs: section and should
not be part of the Cflags: section in pkg-config files.

This was first suggested in
https://github.com/google/googletest/pull/2006 and further discussed in
https://github.com/google/googletest/pull/2483 .
This commit is contained in:
Martin Erik Werner 2019-10-19 19:37:16 +02:00
parent 72adf7a415
commit 6caa879a42
4 changed files with 4 additions and 4 deletions

View File

@ -8,4 +8,4 @@ Version: @PROJECT_VERSION@
URL: https://github.com/google/googletest
Requires: gtest
Libs: -L${libdir} -lgmock @CMAKE_THREAD_LIBS_INIT@
Cflags: -I${includedir} @GTEST_HAS_PTHREAD_MACRO@ @CMAKE_THREAD_LIBS_INIT@
Cflags: -I${includedir} @GTEST_HAS_PTHREAD_MACRO@

View File

@ -8,4 +8,4 @@ Version: @PROJECT_VERSION@
URL: https://github.com/google/googletest
Requires: gmock
Libs: -L${libdir} -lgmock_main @CMAKE_THREAD_LIBS_INIT@
Cflags: -I${includedir} @GTEST_HAS_PTHREAD_MACRO@ @CMAKE_THREAD_LIBS_INIT@
Cflags: -I${includedir} @GTEST_HAS_PTHREAD_MACRO@

View File

@ -7,4 +7,4 @@ Description: GoogleTest (without main() function)
Version: @PROJECT_VERSION@
URL: https://github.com/google/googletest
Libs: -L${libdir} -lgtest @CMAKE_THREAD_LIBS_INIT@
Cflags: -I${includedir} @GTEST_HAS_PTHREAD_MACRO@ @CMAKE_THREAD_LIBS_INIT@
Cflags: -I${includedir} @GTEST_HAS_PTHREAD_MACRO@

View File

@ -8,4 +8,4 @@ Version: @PROJECT_VERSION@
URL: https://github.com/google/googletest
Requires: gtest
Libs: -L${libdir} -lgtest_main @CMAKE_THREAD_LIBS_INIT@
Cflags: -I${includedir} @GTEST_HAS_PTHREAD_MACRO@ @CMAKE_THREAD_LIBS_INIT@
Cflags: -I${includedir} @GTEST_HAS_PTHREAD_MACRO@