[plibsys] Update to 0.0.5 and fix CMake export (#42518)

This commit is contained in:
MonicaLiu 2024-12-05 14:37:00 -08:00 committed by GitHub
parent 11fc04c9dc
commit 04e2fbc675
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
7 changed files with 58 additions and 54 deletions

View File

@ -1,8 +1,8 @@
diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt
index 343e3d2..aff7929 100644
index 12cad07..cda9f76 100644
--- a/src/CMakeLists.txt
+++ b/src/CMakeLists.txt
@@ -785,18 +785,18 @@ if (PLIBSYS_PLATFORM_DEFINES)
@@ -827,10 +827,10 @@ if (PLIBSYS_PLATFORM_DEFINES)
endif()
# Add targets
@ -14,18 +14,41 @@ index 343e3d2..aff7929 100644
+ add_library (plibsys SHARED ${PLIBSYS_SRCS} ${PLIBSYS_PLATFORM_SRCS} ${PLIBSYS_PUBLIC_HDRS} ${PLIBSYS_PRIVATE_HDRS})
endif()
# Prepare installation dirs
@@ -838,6 +838,10 @@ if (NOT CMAKE_INSTALL_LIBDIR)
set (CMAKE_INSTALL_LIBDIR "lib")
endif()
+if (NOT CMAKE_INSTALL_BINDIR)
+ set (CMAKE_INSTALL_BINDIR "bin")
+endif()
+
if (NOT CMAKE_INSTALL_INCLUDEDIR)
set (CMAKE_INSTALL_INCLUDEDIR "include")
endif()
@@ -846,16 +850,16 @@ set (PLIBSYS_INCL_INSTALL_DIR ${CMAKE_INSTALL_INCLUDEDIR}/plibsys)
# Add include directories
if (COMMAND target_include_directories)
- target_include_directories (plibsys PUBLIC ${PLIBSYS_INCLUDE_DIRS})
- target_include_directories (plibsys PUBLIC
- "$<BUILD_INTERFACE:${PLIBSYS_INCLUDE_DIRS}>"
- "$<INSTALL_INTERFACE:${PLIBSYS_INCL_INSTALL_DIR}>"
- )
-
if (PLIBSYS_BUILD_STATIC)
target_include_directories (plibsysstatic PUBLIC ${PLIBSYS_INCLUDE_DIRS})
target_include_directories (plibsysstatic PUBLIC
"$<BUILD_INTERFACE:${PLIBSYS_INCLUDE_DIRS}>"
"$<INSTALL_INTERFACE:${PLIBSYS_INCL_INSTALL_DIR}>"
)
+ else()
+ target_include_directories (plibsys PUBLIC ${PLIBSYS_INCLUDE_DIRS})
+ target_include_directories (plibsys PUBLIC
+ "$<BUILD_INTERFACE:${PLIBSYS_INCLUDE_DIRS}>"
+ "$<INSTALL_INTERFACE:${PLIBSYS_INCL_INSTALL_DIR}>"
+ )
endif()
else()
include_directories (${PLIBSYS_INCLUDE_DIRS})
@@ -804,15 +804,16 @@ endif()
@@ -863,15 +867,16 @@ endif()
# Add compile definitions
if (COMMAND target_compile_definitions)
@ -44,7 +67,7 @@ index 343e3d2..aff7929 100644
set_target_properties (plibsys PROPERTIES RUNTIME_OUTPUT_DIRECTORY ${OUTPUT_DIR})
set_target_properties (plibsys PROPERTIES LIBRARY_OUTPUT_DIRECTORY ${OUTPUT_DIR})
set_target_properties (plibsys PROPERTIES ARCHIVE_OUTPUT_DIRECTORY ${OUTPUT_DIR})
@@ -820,6 +821,7 @@ set_target_properties (plibsys PROPERTIES ARCHIVE_OUTPUT_DIRECTORY ${OUTPUT_DIR}
@@ -884,6 +889,7 @@ endif()
if (NOT PLIBSYS_TARGET_OS STREQUAL os2 AND NOT PLIBSYS_TARGET_OS STREQUAL amigaos)
set_target_properties (plibsys PROPERTIES SOVERSION ${PLIBSYS_SOVERSION})
endif()
@ -52,7 +75,7 @@ index 343e3d2..aff7929 100644
if (PLIBSYS_BUILD_STATIC)
set_target_properties (plibsysstatic PROPERTIES ARCHIVE_OUTPUT_DIRECTORY ${OUTPUT_DIR})
@@ -834,10 +836,10 @@ if (PLIBSYS_PLATFORM_CFLAGS)
@@ -898,10 +904,10 @@ if (PLIBSYS_PLATFORM_CFLAGS)
set (PLIBSYS_PLATFORM_CFLAGS_STR "${PLIBSYS_PLATFORM_CFLAGS_STR} ${PLATFORM_CFLAG}")
endforeach()
@ -65,7 +88,7 @@ index 343e3d2..aff7929 100644
endif()
endif()
@@ -846,29 +848,30 @@ if (PLIBSYS_PLATFORM_LDFLAGS)
@@ -910,29 +916,29 @@ if (PLIBSYS_PLATFORM_LDFLAGS)
set (PLIBSYS_PLATFORM_LDFLAGS_STR "${PLIBSYS_PLATFORM_LDFLAGS_STR} ${PLATFORM_LDFLAG}")
endforeach()
@ -79,12 +102,11 @@ index 343e3d2..aff7929 100644
endif()
-target_link_libraries (plibsys ${PLIBSYS_PLATFORM_LINK_LIBRARIES})
-
if (PLIBSYS_BUILD_STATIC)
- target_link_libraries (plibsysstatic ${PLIBSYS_PLATFORM_LINK_LIBRARIES})
+ target_link_libraries (plibsysstatic ${PLIBSYS_PLATFORM_LINK_LIBRARIES})
target_link_libraries (plibsysstatic ${PLIBSYS_PLATFORM_LINK_LIBRARIES})
+else()
+ target_link_libraries (plibsys ${PLIBSYS_PLATFORM_LINK_LIBRARIES})
+ target_link_libraries (plibsys ${PLIBSYS_PLATFORM_LINK_LIBRARIES})
endif()
if (PLIBSYS_BUILD_STATIC)
@ -103,7 +125,7 @@ index 343e3d2..aff7929 100644
COMPONENT Core
)
@@ -878,11 +881,6 @@ if (PLIBSYS_NATIVE_WINDOWS)
@@ -942,11 +948,6 @@ if (PLIBSYS_NATIVE_WINDOWS)
set (CMAKE_INSTALL_SYSTEM_RUNTIME_LIBS_SKIP TRUE)
include (InstallRequiredSystemLibraries)
@ -114,20 +136,11 @@ index 343e3d2..aff7929 100644
- )
endif()
# Prepare installation dirs
@@ -890,18 +888,18 @@ if (NOT CMAKE_INSTALL_LIBDIR)
set (CMAKE_INSTALL_LIBDIR "lib")
endif()
set (PLIBSYS_EXPORT_NAME plibsys-targets)
@@ -974,13 +975,9 @@ endif()
+if (NOT CMAKE_INSTALL_BINDIR)
+ set (CMAKE_INSTALL_BINDIR "bin")
+endif()
+
if (NOT CMAKE_INSTALL_INCLUDEDIR)
set (CMAKE_INSTALL_INCLUDEDIR "include")
endif()
install (TARGETS ${PLIBSYS_INSTALL_TARGETS} EXPORT plibsys-targets
install (TARGETS ${PLIBSYS_INSTALL_TARGETS}
EXPORT ${PLIBSYS_EXPORT_NAME}
- DESTINATION ${CMAKE_INSTALL_LIBDIR}
- LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}
- COMPONENT Core

View File

@ -1,8 +1,8 @@
vcpkg_from_github(
OUT_SOURCE_PATH SOURCE_PATH
REPO saprykin/plibsys
REF 0.0.4
SHA512 61957666fb454469e1ff68435463eaf426e960caed33540dbb495e1aa7c446c9803d100f33f1a6ea70d5f2ee2d0d19ec315f3a8c651747f65a186ad061c05e51
REF "${VERSION}"
SHA512 ccc4dd0e54d69121542f4ddec319ec9fd2069866a93135acb87fe564c7bd067a218038dfaa4ddda4debcd897975c016165cbe3d41af6c2149d2b49fbe52f8fbb
HEAD_REF master
PATCHES
fix_configuration.patch
@ -17,14 +17,14 @@ vcpkg_cmake_configure(
-DPLIBSYS_COVERAGE=OFF
-DPLIBSYS_BUILD_DOC=OFF
-DPLIBSYS_BUILD_STATIC=${PLIBSYS_STATIC}
-DPLIBSYS_WRITE_PACKAGE=TRUE
)
vcpkg_cmake_install()
file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/include")
vcpkg_cmake_config_fixup(CONFIG_PATH lib/cmake/plibsys)
vcpkg_copy_pdbs()
configure_file("${CMAKE_CURRENT_LIST_DIR}/vcpkg-cmake-wrapper.cmake" "${CURRENT_PACKAGES_DIR}/share/${PORT}/vcpkg-cmake-wrapper.cmake" @ONLY)
file(INSTALL "${CMAKE_CURRENT_LIST_DIR}/usage"DESTINATION "${CURRENT_PACKAGES_DIR}/share/${PORT}")
file(INSTALL "${SOURCE_PATH}/COPYING" DESTINATION "${CURRENT_PACKAGES_DIR}/share/${PORT}" RENAME copyright)
file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/include")
vcpkg_install_copyright(FILE_LIST "${SOURCE_PATH}/COPYING")

View File

@ -1,5 +0,0 @@
The package plibsys provides CMake targets:
find_package(plibsys CONFIG REQUIRED)
target_include_directories(main PRIVATE ${PLIBSYS_INCLUDE_DIRS})
target_link_libraries(main PRIVATE ${PLIBSYS_LIBRARIES})

View File

@ -1,12 +0,0 @@
include(FindPackageHandleStandardArgs)
include(SelectLibraryConfigurations)
find_path(PLIBSYS_INCLUDE_DIR NAMES plibsys.h HINTS ${_VCPKG_INSTALLED_DIR}/${VCPKG_TARGET_TRIPLET} PATH_SUFFIXES plibsys)
find_library(PLIBSYS_LIBRARY_DEBUG NAMES plibsys plibsysstatic libplibsys NAMES_PER_DIR PATH_SUFFIXES lib PATHS "${_VCPKG_INSTALLED_DIR}/${VCPKG_TARGET_TRIPLET}/debug" NO_DEFAULT_PATH REQUIRED)
find_library(PLIBSYS_LIBRARY_RELEASE NAMES plibsys plibsysstatic libplibsys NAMES_PER_DIR PATH_SUFFIXES lib PATHS "${_VCPKG_INSTALLED_DIR}/${VCPKG_TARGET_TRIPLET}" NO_DEFAULT_PATH REQUIRED)
select_library_configurations(PLIBSYS)
set(PLIBSYS_INCLUDE_DIRS ${PLIBSYS_INCLUDE_DIR})
set(PLIBSYS_LIBRARIES ${PLIBSYS_LIBRARY})

View File

@ -1,7 +1,6 @@
{
"name": "plibsys",
"version": "0.0.4",
"port-version": 7,
"version": "0.0.5",
"description": "Highly portable C system library: threads and synchronization, sockets, IPC, data structures and more.",
"homepage": "https://github.com/saprykin/plibsys",
"supports": "!uwp",
@ -9,6 +8,10 @@
{
"name": "vcpkg-cmake",
"host": true
},
{
"name": "vcpkg-cmake-config",
"host": true
}
]
}

View File

@ -7069,8 +7069,8 @@
"port-version": 8
},
"plibsys": {
"baseline": "0.0.4",
"port-version": 7
"baseline": "0.0.5",
"port-version": 0
},
"plog": {
"baseline": "1.1.10",

View File

@ -1,5 +1,10 @@
{
"versions": [
{
"git-tree": "fd135be00a7b86144ec0fc7a067a3e6d543a725c",
"version": "0.0.5",
"port-version": 0
},
{
"git-tree": "9640c4c329d7aa6e7cf09a193f621750ea2d02bd",
"version": "0.0.4",