Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[nsync] Export cmake targets #23811

Merged
merged 6 commits into from
Mar 28, 2022
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 26 additions & 0 deletions ports/nsync/export-targets.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 328f9b6..4b964db 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -399,14 +399,19 @@ endif ()
# By default, install nsync always
# set (CMAKE_SKIP_INSTALL_ALL_DEPENDENCY ON)

-install (TARGETS nsync
+install (TARGETS nsync EXPORT unofficial-nsyncConfig
LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} COMPONENT RuntimeLibraries
ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR} COMPONENT Development)

-install (TARGETS nsync_cpp OPTIONAL
+install (TARGETS nsync_cpp OPTIONAL EXPORT unofficial-nsyncConfig
LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} COMPONENT RuntimeLibraries
ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR} COMPONENT Development)

+install(EXPORT unofficial-nsyncConfig
+ NAMESPACE unofficial::nsync::
+ DESTINATION share/unofficial-nsync
+)
+
set (NSYNC_INCLUDES
"public/nsync.h"
"public/nsync_atomic.h"
13 changes: 7 additions & 6 deletions ports/nsync/portfile.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -12,14 +12,15 @@ vcpkg_from_github(
fix-install.patch
)

vcpkg_configure_cmake(
SOURCE_PATH ${SOURCE_PATH}
PREFER_NINJA
vcpkg_cmake_configure(
SOURCE_PATH "${SOURCE_PATH}"
OPTIONS
-DNSYNC_ENABLE_TESTS=OFF
)
vcpkg_install_cmake()
vcpkg_cmake_install()
vcpkg_copy_pdbs()

file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/include)
file(INSTALL ${SOURCE_PATH}/LICENSE DESTINATION ${CURRENT_PACKAGES_DIR}/share/${PORT} RENAME copyright)
vcpkg_cmake_config_fixup(PACKAGE_NAME unofficial-nsync CONFIG_PATH share/unofficial-nsync)

file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/include")
file(INSTALL "${SOURCE_PATH}/LICENSE" DESTINATION "${CURRENT_PACKAGES_DIR}/share/${PORT}" RENAME copyright)
14 changes: 13 additions & 1 deletion ports/nsync/vcpkg.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,18 @@
{
"name": "nsync",
"version": "1.24.0",
"port-version": 1,
"description": "nsync is a C library that exports various synchronization primitives, such as mutexes",
"homepage": "https://github.com/google/nsync"
"homepage": "https://github.com/google/nsync",
"license": "Apache-2.0",
"dependencies": [
{
"name": "vcpkg-cmake",
"host": true
},
{
"name": "vcpkg-cmake-config",
"host": true
}
]
}
2 changes: 1 addition & 1 deletion versions/baseline.json
Original file line number Diff line number Diff line change
Expand Up @@ -4862,7 +4862,7 @@
},
"nsync": {
"baseline": "1.24.0",
"port-version": 0
"port-version": 1
},
"nt-wrapper": {
"baseline": "2019-08-10",
Expand Down
5 changes: 5 additions & 0 deletions versions/n-/nsync.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
{
"versions": [
{
"git-tree": "e3fec28b4c45e704172be70782a7127dfb47fc06",
"version": "1.24.0",
"port-version": 1
},
{
"git-tree": "65f07dbc95a609c95de7befffbf37da598652cee",
"version": "1.24.0",
Expand Down