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

[stackwalker] add new port #30909

Merged
merged 3 commits into from
Apr 21, 2023
Merged
Show file tree
Hide file tree
Changes from all 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
23 changes: 23 additions & 0 deletions ports/stackwalker/fix-build.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
diff --git "a/Main/StackWalker/StackWalker.h" "b/Main/StackWalker/StackWalker.h"
index 67eb90575..e906dbc26 100644
--- "a/Main/StackWalker/StackWalker.h"
+++ "b/Main/StackWalker/StackWalker.h"
@@ -229,13 +229,11 @@ protected:
{ \
memset(&c, 0, sizeof(CONTEXT)); \
c.ContextFlags = contextFlags; \
- __asm { \
- call x \
- x: pop eax \
- mov c.Eip, eax \
- mov c.Ebp, ebp \
- mov c.Esp, esp \
- }; \
+ __asm call x \
+ __asm x: pop eax \
+ __asm mov c.Eip, eax \
+ __asm mov c.Ebp, ebp \
+ __asm mov c.Esp, esp \
} while (0);
// clang-format on
#endif
28 changes: 28 additions & 0 deletions ports/stackwalker/fix-exports.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
diff --git "a/CMakeLists.txt" "b/CMakeLists.txt"
index 82f0206a2..8160fd789 100644
--- "a/CMakeLists.txt"
+++ "b/CMakeLists.txt"
@@ -79,12 +79,13 @@ add_library(${TARGET_StackWalker} STATIC
Main/StackWalker/StackWalker.cpp)
target_include_directories(${TARGET_StackWalker} PUBLIC
$<BUILD_INTERFACE:${CMAKE_SOURCE_DIR}/Main/StackWalker>
+ $<INSTALL_INTERFACE:include>
)

-install(TARGETS "${TARGET_StackWalker}"
- ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}
- LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}
- RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}
+install(TARGETS "${TARGET_StackWalker}" EXPORT stackwalker-config
+ ARCHIVE DESTINATION lib
+ LIBRARY DESTINATION lib
+ RUNTIME DESTINATION bin
)

install(FILES "${CMAKE_SOURCE_DIR}/Main/StackWalker/StackWalker.h"
@@ -114,3 +115,5 @@ else()

add_test(NAME ${TARGET_StackWalker_tests} COMMAND ${TARGET_StackWalker_tests})
endif()
+
+install(EXPORT stackwalker-config NAMESPACE unofficial::stackwalker:: DESTINATION share/stackwalker)
29 changes: 29 additions & 0 deletions ports/stackwalker/portfile.cmake
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
vcpkg_check_linkage(ONLY_STATIC_LIBRARY)

vcpkg_from_github(
OUT_SOURCE_PATH SOURCE_PATH
REPO JochenKalmbach/StackWalker
REF "${VERSION}"
SHA512 ce4004f114400ff66e25d7403c52ed4798a0e94d529335995df525f37d4238c750c8b1ee5801f71bd7128d39baa9af18e546a49da8587976720df6e9b372b851
HEAD_REF master
PATCHES
fix-build.patch # https://github.com/JochenKalmbach/StackWalker/commit/97965daed94f1d859fff691e6ba28759db0f179f
fix-exports.patch
AenBleidd marked this conversation as resolved.
Show resolved Hide resolved
)

vcpkg_cmake_configure(
SOURCE_PATH "${SOURCE_PATH}"
OPTIONS
${options}
-DStackWalker_DISABLE_TESTS=OFF
)

vcpkg_cmake_install()

vcpkg_copy_pdbs()

vcpkg_cmake_config_fixup()

file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/include")

vcpkg_install_copyright(FILE_LIST "${SOURCE_PATH}/LICENSE")
17 changes: 17 additions & 0 deletions ports/stackwalker/vcpkg.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
{
"name": "stackwalker",
"version": "1.20",
"description": "StackWalker - Walking the callstack.",
"license": "BSD-2-Clause",
"supports": "windows & !arm & !uwp",
"dependencies": [
{
"name": "vcpkg-cmake",
"host": true
},
{
"name": "vcpkg-cmake-config",
"host": true
}
]
}
4 changes: 4 additions & 0 deletions versions/baseline.json
Original file line number Diff line number Diff line change
Expand Up @@ -7620,6 +7620,10 @@
"baseline": "1.5.1",
"port-version": 1
},
"stackwalker": {
"baseline": "1.20",
"port-version": 0
},
"starlink-ast": {
"baseline": "9.2.7",
"port-version": 3
Expand Down
9 changes: 9 additions & 0 deletions versions/s-/stackwalker.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
{
"versions": [
{
"git-tree": "31a65d527a4476b3ababfd0ec1b9bb78371900ca",
"version": "1.20",
"port-version": 0
}
]
}