Skip to content

Commit 71f4218

Browse files
authored
Add -lkstat to the .pc for Solaris (#1801)
* Add -lkstat to the .pc for Solaris This fixes linking for projects that rely on pkg-config to generate the link line on Solaris. Test plan: Built the project locally on Solaris and verified -kstat appears in the .pc file ``` $ cat lib/pkgconfig/benchmark.pc | grep Libs.private Libs.private: -lpthread -lkstat ``` * Use BENCHMARK_PRIVATE_LINK_LIBRARIES
1 parent c214639 commit 71f4218

File tree

2 files changed

+2
-1
lines changed

2 files changed

+2
-1
lines changed

cmake/benchmark.pc.in

+1-1
Original file line numberDiff line numberDiff line change
@@ -8,5 +8,5 @@ Description: Google microbenchmark framework
88
Version: @VERSION@
99

1010
Libs: -L${libdir} -lbenchmark
11-
Libs.private: -lpthread
11+
Libs.private: -lpthread @BENCHMARK_PRIVATE_LINK_LIBRARIES@
1212
Cflags: -I${includedir}

src/CMakeLists.txt

+1
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,7 @@ endif()
6464
# We need extra libraries on Solaris
6565
if(${CMAKE_SYSTEM_NAME} MATCHES "SunOS")
6666
target_link_libraries(benchmark PRIVATE kstat)
67+
set(BENCHMARK_PRIVATE_LINK_LIBRARIES -lkstat)
6768
endif()
6869

6970
if (NOT BUILD_SHARED_LIBS)

0 commit comments

Comments
 (0)