Skip to content

Commit

Permalink
Fix CI builds
Browse files Browse the repository at this point in the history
  • Loading branch information
AuroraViola committed Nov 13, 2024
1 parent b46a704 commit a77e204
Show file tree
Hide file tree
Showing 5 changed files with 26 additions and 8 deletions.
5 changes: 4 additions & 1 deletion .github/workflows/build-linux.yml
Original file line number Diff line number Diff line change
Expand Up @@ -79,18 +79,21 @@ jobs:
- name: Prepare artifacts
run: |
cp /usr/local/lib/libraylib.so.550 build
cp build/third-party/openpnp-capture/libopenpnp-capture.so.0 build
cd build
patchelf --remove-needed libraylib.so.550 ChillyGB
patchelf --remove-needed libopenpnp-capture.so.0 ChillyGB
patchelf --add-needed ./libraylib.so.550 ChillyGB
patchelf --add-needed ./libopenpnp-capture.so.0 ChillyGB
- uses: actions/upload-artifact@v4
with:
name: ChillyGB-release-linux-x86_64
path: |
build/ChillyGB
build/res
build/third-party
build/libraylib.so.550
build/libopenpnp-capture.so.0
- name: Restore cached Roms
id: cache-roms-restore
Expand Down
7 changes: 5 additions & 2 deletions .github/workflows/build-windows.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,11 +25,14 @@ jobs:
run: cmake -B ${{github.workspace}}/build -DCMAKE_BUILD_TYPE=${{env.BUILD_TYPE}} -DCMAKE_TOOLCHAIN_FILE=windows-toolchain.cmake

- name: Build
run: cmake --build ${{github.workspace}}/build --config ${{env.BUILD_TYPE}}
run: |
cmake --build ${{github.workspace}}/build --config ${{env.BUILD_TYPE}}
mv build/_deps/openpnp_capture_win64-src/openpnp-capture.dll build
- uses: actions/upload-artifact@v4
with:
name: ChillyGB-release-win-x64
path: |
build/ChillyGB.exe
build/res
build/res
build/openpnp-capture.dll
19 changes: 15 additions & 4 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,15 @@ if (${CMAKE_SYSTEM_NAME} MATCHES "Windows")
raylib_win64
URL https://github.com/raysan5/raylib/releases/download/5.0/raylib-5.0_win64_mingw-w64.zip
)
FetchContent_MakeAvailable(raylib_win64)
FetchContent_Declare(
openpnp_capture_win64
URL https://github.com/openpnp/openpnp-capture/releases/download/v0.0.28/libopenpnp-capture-windows-latest-x86_64.dll
DOWNLOAD_NO_EXTRACT TRUE
DOWNLOAD_NAME openpnp-capture.dll
)
FetchContent_MakeAvailable(raylib_win64 openpnp_capture_win64)
include_directories(${raylib_win64_SOURCE_DIR}/include)
link_directories(${raylib_win64_SOURCE_DIR}/lib)
link_directories(${raylib_win64_SOURCE_DIR}/lib ${openpnp_capture_win64_SOURCE_DIR})
endif()

if (${PLATFORM} MATCHES "NX")
Expand Down Expand Up @@ -69,8 +75,13 @@ include_directories(
third-party/cJSON
third-party/raylib-nuklear/include
)
add_subdirectory(third-party/openpnp-capture)
target_link_libraries(ChillyGB raylib m openpnp-capture)
if (NOT ${CMAKE_SYSTEM_NAME} MATCHES "Windows")
add_subdirectory(third-party/openpnp-capture)
target_link_libraries(ChillyGB raylib m openpnp-capture)
endif()
if (${CMAKE_SYSTEM_NAME} MATCHES "Windows")
target_link_libraries(ChillyGB raylib m openpnp-capture)
endif()
option(CUSTOM_OPEN_DIALOG "Enable custom open dialog box built with Nuklear" OFF)

if(CUSTOM_OPEN_DIALOG)
Expand Down
2 changes: 1 addition & 1 deletion src/modules/camera.c
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ void initialize_camera() {
camera_pnp.context = Cap_createContext();
camera_pnp.stream = Cap_openStream(camera_pnp.context, 0, 0);
Cap_getFormatInfo(camera_pnp.context, 0, 0, &camera_pnp.formatinfo);
camera_pnp.buffer_size = camera_pnp.formatinfo.width * camera_pnp.formatinfo.height * (camera_pnp.formatinfo.bpp / 8);
camera_pnp.buffer_size = camera_pnp.formatinfo.width * camera_pnp.formatinfo.height * 3;
camera_pnp.buffer = malloc(camera_pnp.buffer_size);
}

Expand Down
1 change: 1 addition & 0 deletions src/modules/open_dialog.c
Original file line number Diff line number Diff line change
Expand Up @@ -154,6 +154,7 @@ char *do_open_rom_dialog(bool bootrom_chooser) {
#include <windows.h>
#include <shlobj.h>
#include <stdio.h>
#include <stdbool.h>

static char *wc_to_utf8_alloc(const wchar_t *wide) {
unsigned int cb = WideCharToMultiByte(CP_UTF8, 0, wide, -1, NULL, 0, NULL, NULL);
Expand Down

0 comments on commit a77e204

Please sign in to comment.