Skip to content

Commit 6518123

Browse files
committed
Update github actions
1 parent bb51830 commit 6518123

8 files changed

Lines changed: 38 additions & 28 deletions

File tree

.github/workflows/multi-os-build.yml

Lines changed: 17 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ jobs:
2020
# Space-separated list of packages to install using apt-get. Will only run if on ubuntu.
2121
apt-get: libssl-dev cmake binutils-mingw-w64-i686 gcc-mingw-w64-i686 g++-mingw-w64-i686
2222
- name: Checkout with submodules
23-
uses: actions/checkout@v4
23+
uses: actions/checkout@v6
2424
- name: config shared=${{ matrix.shared }}
2525
run: >-
2626
cmake
@@ -35,30 +35,27 @@ jobs:
3535
runs-on: macos-latest
3636
steps:
3737
- name: Checkout with submodules
38-
uses: actions/checkout@v4
38+
uses: actions/checkout@v6
3939
- name: config
4040
run: >-
4141
cmake
4242
-Bbuild
4343
-DENABLE_TESTS=Off
4444
- name: Compile
4545
run: cmake --build build
46-
# - name: Compile
47-
# run: CFLAGS="-I$(brew --prefix openssl@1.1)/include/" LDFLAGS="-L$(brew --prefix openssl@1.1)/lib/" make
4846

49-
build-win64:
47+
build-win64-cygwin:
5048
runs-on: windows-latest
5149
steps:
5250
- name: Install Cygwin
5351
# You may pin to the exact commit or the version.
5452
# uses: egor-tensin/setup-cygwin@4f96f9fecb8c952fa32ff791b0a77d93d5191bb4
5553
uses: egor-tensin/setup-cygwin@v4
5654
with:
57-
platform: x64 # optional, default is x64
5855
install-dir: c:\tools\cygwin # optional, default is C:\tools\cygwin
5956
packages: gcc-core gcc-g++ binutils make ninja zip libssl-devel cmake # optional
6057
- name: Checkout with submodules
61-
uses: actions/checkout@v4
58+
uses: actions/checkout@v6
6259
- name: Config
6360
run: >-
6461
cmake
@@ -69,8 +66,17 @@ jobs:
6966
run: cmake --build build
7067
- name: Pack
7168
run: cd build && cpack -G CygwinBinary
72-
# - name: Compile
73-
# run: make
74-
# - name: Compile Windows-only tools and create a ZIP package
75-
# run: make zip
7669

70+
build-win64-msvc:
71+
runs-on: windows-latest
72+
steps:
73+
- uses: actions/checkout@v4
74+
- uses: ilammy/msvc-dev-cmd@v1
75+
- name: Install OpenSSL
76+
run: vcpkg install --triplet x64-windows
77+
- name: Build with CL.EXE
78+
run: |
79+
cmake -G "NMake Makefiles" -B build -DENABLE_TESTS=Off -DVCPKG_ROOT="C:/vcpkg"
80+
cmake --build build
81+
- name: Package
82+
run: cd build && cpack -G ZIP

CMakeLists.txt

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,10 @@ endif()
2525

2626
option(LIBPE_LINK_SSDEEP "LINK SSDEEP GPL2 code into libpe" ${DEFAULT_LINK_SSDEEP})
2727

28+
if(!VCPKG_ROOT)
29+
set(VCPKG_ROOT "$ENV{VCPKG_ROOT}")
30+
endif()
31+
2832
include(dependencies)
2933

3034
if(MSVC)
@@ -35,15 +39,11 @@ if(MSVC)
3539
if(CMAKE_HOST_SYSTEM_NAME MATCHES "Linux")
3640
include(cmake/toolchains/msvc-wine.cmake)
3741

38-
# My wine installation of msvc does not like my CRT
39-
add_definitions(
40-
-D_CRT_SECURE_NO_WARNINGS
41-
)
42-
4342
set(OPENSSL_ROOT_DIR ${VCPKG_ROOT}/installed/x64-windows)
4443
endif()
4544

4645
add_definitions(
46+
-D_CRT_SECURE_NO_WARNINGS
4747
-D_SLURP_EXECUTABLE
4848
)
4949

@@ -52,7 +52,7 @@ if(MSVC)
5252

5353
# TODO: This might not work on windows
5454
install(PROGRAMS
55-
"${VCPKG_ROOT}/installed/x64-windows/bin/libcrypto-3-x64.dll"
55+
"${VCPKG_ROOT}/packages/openssl_x64-windows/bin/libcrypto-3-x64.dll"
5656
DESTINATION bin
5757
)
5858
endif()

build-msvc-wine.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -47,11 +47,11 @@ CMAKE_ARGS=(
4747
-DCMAKE_CXX_COMPILER=$BIN/cl
4848
-DCMAKE_SYSTEM_NAME=Windows
4949
-DVCPKG_TARGET_TRIPLET=x64-windows
50-
-DVCPKG_OVERLAY_TRIPLETS=./msvc-wine
50+
# -DVCPKG_OVERLAY_TRIPLETS=./msvc-wine
5151
-DVCPKG_MANIFEST_INSTALL=OFF
5252
-DVCPKG_MANIFEST_MODE=ON
5353
-DCMAKE_TOOLCHAIN_FILE=$VCPKG_ROOT/scripts/buildsystems/vcpkg.cmake
54-
-DOpenSSL_DIR=$VCPKG_ROOT/installed/x64-windows/share/openssl
54+
# -DOpenSSL_DIR=$VCPKG_ROOT/installed/x64-windows/share/openssl
5555
)
5656

5757
# Vcpkg uses pwsh and dumpbin to copy dependencies into the output directory for executables.

cmake/dependencies.cmake

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,5 +31,7 @@ list(APPEND content uthash)
3131
FetchContent_MakeAvailable(${content})
3232

3333
add_library(uthash INTERFACE)
34-
target_include_directories(uthash INTERFACE ${uthash_SOURCE_DIR}/include)
35-
34+
target_include_directories(uthash INTERFACE SYSTEM ${uthash_SOURCE_DIR}/src)
35+
set_target_properties(uthash PROPERTIES
36+
INTERFACE_SYSTEM_INCLUDE_DIRECTORIES "${uthash_SOURCE_DIR}/src"
37+
)

include/libpe/resources.h

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,9 @@ char *
8989
pe_resource_parse_string_u(pe_ctx_t *ctx, char *output, size_t output_size,
9090
const IMAGE_RESOURCE_DATA_STRING_U *data_string_ptr);
9191
void pe_resources_dealloc(pe_resources_t *obj);
92-
const VS_FIXEDFILEINFO *pe_resource_get_fixedfileinfo(const pe_ctx_t *ctx, const pe_resource_node_t *node, void **child_out);
92+
PEAPI const VS_FIXEDFILEINFO *
93+
pe_resource_get_fixedfileinfo(const pe_ctx_t *ctx,
94+
const pe_resource_node_t *node, void **child_out);
9395

9496
#ifdef __cplusplus
9597
} // extern "C"

lib/compat/asprintf.c

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -48,8 +48,6 @@
4848
#include <stdio.h>
4949
#include <stdlib.h>
5050

51-
#define USE_MY_ASPRINTF
52-
5351
#ifdef __cplusplus
5452
extern "C" {
5553
#endif

lib/libpe/CMakeLists.txt

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -60,9 +60,11 @@ if(LIBPE_LINK_SSDEEP)
6060
)
6161
endif()
6262

63-
target_include_directories(pe SYSTEM PRIVATE
64-
"${uthash_INCLUDE_DIR}"
65-
)
63+
# target_include_directories(pe SYSTEM PRIVATE
64+
# "${uthash_INCLUDE_DIR}"
65+
# "${uthash_SOURCE_DIR}/include"
66+
# )
67+
6668
target_include_directories(pe PRIVATE
6769
"${CMAKE_SOURCE_DIR}/include"
6870
)

lib/libpe/error.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -135,7 +135,7 @@ void pe_error_print(FILE *stream, pe_err_e error)
135135
#elif defined(_GNU_SOURCE) // GNU-specific
136136
const char *errmsg_ptr = strerror_r(errno, errmsg, sizeof errmsg);
137137
#elif defined(_MSC_VER) // C11
138-
int ret = strerror_s(errmsg, sizeof(errmsg), errno);
138+
/* int ret = */ strerror_s(errmsg, sizeof(errmsg), errno);
139139
const char *errmsg_ptr = errmsg;
140140
#else // Fallback to XSI-compliant
141141
/* int ret = */ strerror_r(errno, errmsg, sizeof errmsg);

0 commit comments

Comments
 (0)