-
Notifications
You must be signed in to change notification settings - Fork 7.5k
[wincpp] Add new port #51062
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
base: master
Are you sure you want to change the base?
[wincpp] Add new port #51062
Changes from all commits
425e1cc
a3b9213
a126908
92866af
f9540c3
5d84008
57ec7b1
dd26340
f048da4
add0d18
fb7ae38
98891bf
a1c9453
6ed04eb
963dae7
3556d92
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,106 @@ | ||
| diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt | ||
| index 9d5adce..eff939d 100644 | ||
| --- a/src/CMakeLists.txt | ||
| +++ b/src/CMakeLists.txt | ||
| @@ -1,5 +1,5 @@ | ||
| cmake_path(SET include_dir "${CMAKE_CURRENT_SOURCE_DIR}/../include") | ||
| - | ||
| +include(GNUInstallDirs) | ||
| # Add the header files to the project | ||
| set(header_files | ||
| "${include_dir}/wincpp/process.hpp" | ||
| @@ -36,21 +36,21 @@ set(header_files | ||
|
|
||
| # Add the library to the project | ||
| add_library(_wincpp_core INTERFACE) | ||
| - | ||
| # Add the include directory to the project | ||
| -target_sources(_wincpp_core INTERFACE ${header_files}) | ||
| +target_sources(_wincpp_core INTERFACE $<BUILD_INTERFACE:${header_files}>) | ||
|
|
||
| # Add the include directories | ||
| target_include_directories(_wincpp_core SYSTEM INTERFACE | ||
| $<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/../include> | ||
| - $<INSTALL_INTERFACE:${CMAKE_INSTALL_INCLUDEDIR}> | ||
| + $<INSTALL_INTERFACE:${CMAKE_INSTALL_INCLUDEDIR}/wincpp> | ||
| ) | ||
|
|
||
| # Add the library to the project | ||
| -add_library(wincpp STATIC) | ||
| +add_library(wincpp) | ||
| +set_target_properties(wincpp PROPERTIES WINDOWS_EXPORT_ALL_SYMBOLS ON) | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Reminder, this is not accepted in vcpkg.
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Note that you can use |
||
|
|
||
| # Link the library to the core | ||
| -target_link_libraries(wincpp INTERFACE _wincpp_core) | ||
| +target_link_libraries(wincpp PUBLIC _wincpp_core) | ||
|
|
||
| # Add the source files to the project | ||
| target_sources(wincpp PRIVATE | ||
| @@ -89,3 +89,38 @@ target_sources(wincpp PRIVATE | ||
|
|
||
| # Add the include directory to the project | ||
| target_include_directories(wincpp PRIVATE ${include_dir}) | ||
| + | ||
| +# Install wincpp library | ||
| +install(TARGETS wincpp _wincpp_core EXPORT wincpp-export | ||
| + ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR} | ||
| + LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} | ||
| + RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} | ||
| + INCLUDES DESTINATION ${CMAKE_INSTALL_INCLUDEDIR} | ||
| +) | ||
| + | ||
| +install(DIRECTORY "${CMAKE_CURRENT_LIST_DIR}/../include/wincpp" DESTINATION "${CMAKE_INSTALL_INCLUDEDIR}") | ||
| + | ||
| +include(CMakePackageConfigHelpers) | ||
| +write_basic_package_version_file( | ||
| + "${CMAKE_CURRENT_BINARY_DIR}/wincppConfigVersion.cmake" | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Do we need a vcpkg_cmake_config_fixup call for this? |
||
| + VERSION 1.5.3.6 | ||
| + COMPATIBILITY AnyNewerVersion | ||
| +) | ||
| + | ||
| +file(WRITE "${CMAKE_CURRENT_BINARY_DIR}/wincppConfig.cmake" | ||
| + "include(\${CMAKE_CURRENT_LIST_DIR}/wincppTargets.cmake)\n" | ||
| +) | ||
| + | ||
| +set(wincpp_CONFFILE_DEST "${CMAKE_INSTALL_DATAROOTDIR}/wincpp") | ||
| + | ||
| +install(FILES | ||
| + "${CMAKE_CURRENT_BINARY_DIR}/wincppConfig.cmake" | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Reminder, the "unofficial" prefix must be used for config and targets unless provided officially by upstream. |
||
| + "${CMAKE_CURRENT_BINARY_DIR}/wincppConfigVersion.cmake" | ||
| + DESTINATION ${wincpp_CONFFILE_DEST} | ||
| +) | ||
| + | ||
| +install(EXPORT wincpp-export | ||
| + FILE wincppTargets.cmake | ||
| + NAMESPACE wincpp:: | ||
| + DESTINATION ${wincpp_CONFFILE_DEST} | ||
| +) | ||
| diff --git a/src/memory_factory.cpp b/src/memory_factory.cpp | ||
| index 50cd83d..82c1474 100644 | ||
| --- a/src/memory_factory.cpp | ||
| +++ b/src/memory_factory.cpp | ||
| @@ -24,7 +24,7 @@ namespace wincpp | ||
| } | ||
| case wincpp::memory_type::remote_t: | ||
| { | ||
| - std::size_t read; | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Can you explain what this is doing and/or submit it upstream? |
||
| + SIZE_T read; | ||
|
|
||
| if ( !ReadProcessMemory( p->handle->native, reinterpret_cast< void* >( address ), buffer, size, &read ) || read != size ) | ||
| return false; | ||
| @@ -61,7 +61,7 @@ namespace wincpp | ||
| } | ||
| case wincpp::memory_type::remote_t: | ||
| { | ||
| - std::size_t written; | ||
| + SIZE_T written; | ||
|
|
||
| WriteProcessMemory( p->handle->native, reinterpret_cast< void* >( address ), buffer, size, &written ); | ||
| return written; | ||
| @@ -201,4 +201,4 @@ namespace wincpp | ||
|
|
||
| return nullptr; | ||
| } | ||
| -} // namespace wincpp | ||
| \ No newline at end of file | ||
| +} // namespace wincpp | ||
| Original file line number | Diff line number | Diff line change | ||||||||
|---|---|---|---|---|---|---|---|---|---|---|
| @@ -0,0 +1,22 @@ | ||||||||||
| vcpkg_from_github( | ||||||||||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Please change this file to LF line endings. |
||||||||||
| OUT_SOURCE_PATH SOURCE_PATH | ||||||||||
| REPO atrexus/wincpp | ||||||||||
| REF "v${VERSION}" | ||||||||||
| SHA512 43674f7e899ce1d4088ad76f4f224c8202aa6af508211cbbae69366ca6467cf61520e0c65d852d0ad805045e9b3d69d414b6ba434d4c8b64becac120d28df294 | ||||||||||
| HEAD_REF main | ||||||||||
| PATCHES | ||||||||||
| fix-install-and-w32.patch | ||||||||||
| ) | ||||||||||
|
|
||||||||||
| vcpkg_cmake_configure( | ||||||||||
| SOURCE_PATH "${SOURCE_PATH}" | ||||||||||
| OPTIONS | ||||||||||
| -DBUILD_EXAMPLES=OFF | ||||||||||
| -DBUILD_PACKAGE=OFF | ||||||||||
|
Comment on lines
+14
to
+15
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||||||
| ) | ||||||||||
|
|
||||||||||
| vcpkg_cmake_install() | ||||||||||
|
|
||||||||||
| file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/include" "${CURRENT_PACKAGES_DIR}/debug/share") | ||||||||||
|
|
||||||||||
| vcpkg_install_copyright(FILE_LIST "${SOURCE_PATH}/LICENSE") | ||||||||||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,13 @@ | ||
| { | ||
| "name": "wincpp", | ||
| "version": "1.5.3.6", | ||
| "description": "A fully featured Win32 wrapper written in modern C++", | ||
| "license": "MIT", | ||
| "supports": "windows", | ||
| "dependencies": [ | ||
| { | ||
| "name": "vcpkg-cmake", | ||
| "host": true | ||
| } | ||
| ] | ||
| } |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,9 @@ | ||
| { | ||
| "versions": [ | ||
| { | ||
| "git-tree": "b68b4c8b039836d63d3092c3c1545b90ae3400a4", | ||
| "version": "1.5.3.6", | ||
| "port-version": 0 | ||
| } | ||
| ] | ||
| } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hm, what did upstream want to achieve? Is it still achieved after this change? Do we need a test port?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
To the best of my understanding this doesn't actually do anything? INTERFACE says only applies to linkers but BUILD_INTERFACE says only applies during build...