Fix Windows CI build

This commit is contained in:
Marek Kraus 2023-01-21 15:14:50 +01:00
parent 5a6cd281c3
commit 5e09eca00d
3 changed files with 12 additions and 3 deletions

View File

@ -3,7 +3,7 @@ on: [push, pull_request]
jobs:
build-windows:
runs-on: windows-2019
runs-on: windows-2022
defaults:
run:
shell: cmd
@ -22,7 +22,7 @@ jobs:
with:
name: blisp Windows x64 build
path: |
build/tools/blisp/blisp.exe
build/tools/blisp/Release/blisp.exe
if-no-files-found: error
build-macos:

View File

@ -39,7 +39,8 @@ target_sources(libblisp_obj PRIVATE
target_include_directories(libblisp_obj PRIVATE ${CMAKE_SOURCE_DIR}/vendor/libserialport)
if(WIN32)
target_link_libraries(libblisp_obj PRIVATE Setupapi.lib)
target_link_libraries(libblisp PRIVATE Setupapi.lib)
target_link_libraries(libblisp_static PRIVATE Setupapi.lib)
target_compile_definitions(libblisp_obj PRIVATE LIBSERIALPORT_MSBUILD)
target_sources(libblisp_obj PRIVATE
${CMAKE_SOURCE_DIR}/vendor/libserialport/windows.c)

View File

@ -66,7 +66,11 @@ int32_t blisp_easy_load_segment_data(
uint32_t sent_data = 0;
uint32_t buffer_size = 0;
#ifdef _WIN32
uint8_t buffer[4092];
#else
uint8_t buffer[buffer_max_size];
#endif
blisp_easy_report_progress(progress_callback, 0, segment_size);
@ -333,7 +337,11 @@ int32_t blisp_easy_flash_write(struct blisp_device* device,
uint32_t sent_data = 0;
uint32_t buffer_size = 0;
#ifdef _WIN32
uint8_t buffer[2052];
#else
uint8_t buffer[buffer_max_size];
#endif
blisp_easy_report_progress(progress_callback, 0, data_size);
while (sent_data < data_size) {