mirror of https://github.com/microsoft/vcpkg.git
49 lines
1.4 KiB
Diff
49 lines
1.4 KiB
Diff
diff --git a/CMakeLists.txt b/CMakeLists.txt
|
|
index 152273d..b90ede6 100644
|
|
--- a/CMakeLists.txt
|
|
+++ b/CMakeLists.txt
|
|
@@ -113,6 +113,31 @@ if(${ZLIB_FOUND})
|
|
else()
|
|
set(PC_REQUIRES_PRIVATE_ZLIB "")
|
|
endif()
|
|
+
|
|
+if(HDR_HISTOGRAM_BUILD_STATIC)
|
|
+ set(PROJECT_LIB_FILE_NAME "${PROJECT_NAME}_static")
|
|
+else()
|
|
+ set(PROJECT_LIB_FILE_NAME "${PROJECT_NAME}")
|
|
+endif()
|
|
+
|
|
+set(PKGCONFIG_LIBS_PRIVATE)
|
|
+if(WIN32)
|
|
+ string(APPEND PKGCONFIG_LIBS_PRIVATE " -lws2_32")
|
|
+else()
|
|
+ find_package(Threads REQUIRED)
|
|
+ string(APPEND PKGCONFIG_LIBS_PRIVATE " -pthread")
|
|
+
|
|
+ check_library_exists(rt clock_gettime "" HAVE_LIBRT)
|
|
+ if(HAVE_LIBRT)
|
|
+ string(APPEND PKGCONFIG_LIBS_PRIVATE " -lrt")
|
|
+ endif()
|
|
+
|
|
+ check_library_exists(m pow "" HAVE_LIBM)
|
|
+ if(HAVE_LIBM)
|
|
+ string(APPEND PKGCONFIG_LIBS_PRIVATE " -lm")
|
|
+ endif()
|
|
+endif()
|
|
+
|
|
configure_file(
|
|
${CMAKE_CURRENT_SOURCE_DIR}/${PROJECT_NAME}.pc.in
|
|
${CMAKE_CURRENT_BINARY_DIR}/${PROJECT_NAME}.pc
|
|
diff --git a/hdr_histogram.pc.in b/hdr_histogram.pc.in
|
|
index 1151ab3..1249178 100644
|
|
--- a/hdr_histogram.pc.in
|
|
+++ b/hdr_histogram.pc.in
|
|
@@ -8,5 +8,5 @@ URL: @CMAKE_PROJECT_HOMEPAGE_URL@
|
|
Version: @PROJECT_VERSION@
|
|
Requires.private: @PC_REQUIRES_PRIVATE_ZLIB@
|
|
Cflags: -I${includedir}
|
|
-Libs: -L${libdir} -l@PROJECT_NAME@
|
|
-Libs.private: -pthread -lm -lrt -L${libdir}
|
|
+Libs: -L${libdir} -l@PROJECT_LIB_FILE_NAME@
|
|
+Libs.private: @PKGCONFIG_LIBS_PRIVATE@ -L${libdir}
|