Skip to content

Commit

Permalink
[stackwalker] add new port
Browse files Browse the repository at this point in the history
Signed-off-by: Vitalii Koshura <[email protected]>
  • Loading branch information
AenBleidd committed Apr 17, 2023
1 parent 501db0f commit f78a99d
Show file tree
Hide file tree
Showing 6 changed files with 110 additions and 0 deletions.
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
fix-exports.patch
)

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 @@ -7616,6 +7616,10 @@
"baseline": "1.5.1",
"port-version": 1
},
"stackwalker": {
"baseline": "1.20",
"port-version": 0
},
"starlink-ast": {
"baseline": "9.2.7",
"port-version": 2
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": "8cc3f001440d05d7247fb7e04c58a99002ed0054",
"version": "1.20",
"port-version": 0
}
]
}

0 comments on commit f78a99d

Please sign in to comment.