Skip to content

Commit b781282

Browse files
committed
[vcpkg.json] Add my new libbsd port (on Linux) ; [acquire/CMakeLists.txt] Fix libbsd resolution ; [acquire/acquire_string_extras.h] Fix double-definition warning
1 parent 70bff44 commit b781282

File tree

3 files changed

+13
-3
lines changed

3 files changed

+13
-3
lines changed

acquire/CMakeLists.txt

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -266,7 +266,13 @@ else ()
266266
if (NOT BSD)
267267
find_package(LibBSD)
268268
if (LibBSD_FOUND)
269-
target_link_directories("${LIBRARY_NAME}_lib" PUBLIC "${BSD_LIBRARY}")
269+
if (NOT DEFINED LibBSD_LIBRARIES)
270+
set(LibBSD_LIBRARIES "${BSD_LIBRARY}")
271+
endif (NOT DEFINED LibBSD_LIBRARIES)
272+
target_link_directories("${LIBRARY_NAME}_lib" PUBLIC "${LibBSD_LIBRARIES}")
273+
if (DEFINED LibBSD_INCLUDEDIR)
274+
target_include_directories("${LIBRARY_NAME}_lib" PUBLIC "${LibBSD_INCLUDEDIR}")
275+
endif (DEFINED LibBSD_INCLUDEDIR)
270276
target_compile_definitions("${LIBRARY_NAME}_lib" PUBLIC HAVE_STRNSTR=1)
271277
target_compile_definitions("${LIBRARY_NAME}_lib" PUBLIC HAVE_LIBBSD=1)
272278
endif (LibBSD_FOUND)

acquire/acquire_string_extras.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ extern "C" {
6161
#endif /* defined(__APPLE__) && defined(__MACH__) */
6262

6363
#if defined(BSD) && (BSD >= 199306) && !defined(__linux__) && \
64-
!defined(linux) && !defined(__linux)
64+
!defined(linux) && !defined(__linux) && !defined(HAVE_STRNSTR)
6565
#define HAVE_STRNSTR
6666
#endif /* defined(BSD) && (BSD >= 199306) && !defined(__linux__) && \
6767
!defined(linux) && !defined(__linux) */

vcpkg.json

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,10 @@
33
"version-string": "0.0.1",
44
"dependencies": [
55
"libarchive",
6-
"rhash"
6+
"rhash",
7+
{
8+
"name": "libbsd",
9+
"platform": "linux"
10+
}
711
]
812
}

0 commit comments

Comments
 (0)