Skip to content

Commit

Permalink
Update Windows github action to use winpcap and run test of axpbox rom
Browse files Browse the repository at this point in the history
  • Loading branch information
Remy van Elst committed May 1, 2024
1 parent f3bd6f4 commit 842f63d
Show file tree
Hide file tree
Showing 322 changed files with 56,928 additions and 16 deletions.
28 changes: 25 additions & 3 deletions .github/workflows/build-test-and-artifact.yml
Original file line number Diff line number Diff line change
Expand Up @@ -139,6 +139,23 @@ jobs:
steps:
- uses: actions/checkout@v2

- name: Download npcap
working-directory: ${{runner.workspace}}\axpbox\
run: curl -o ./npcap-sdk-1.13.zip https://npcap.com/dist/npcap-sdk-1.13.zip

- name: unzip npcap
working-directory: ${{runner.workspace}}\axpbox\
run: unzip npcap-sdk-1.13.zip

- name: dir
working-directory: ${{runner.workspace}}\axpbox\
run: ls

- name: install netcat
uses: crazy-max/ghaction-chocolatey@v3
with:
args: install netcat

- name: Get current date
id: date
run: echo "::set-output name=date::$(date +'%Y-%m-%dT%H%M')"
Expand All @@ -149,8 +166,8 @@ jobs:
- name: Configure CMake
shell: bash
working-directory: ${{runner.workspace}}/build
run: cmake $GITHUB_WORKSPACE -DCMAKE_BUILD_TYPE=Release
run: cmake $GITHUB_WORKSPACE -DCMAKE_BUILD_TYPE=Release -DPCAP_ROOT_DIR=${{runner.workspace}}\winpcap\WpdPack\

- name: Build
working-directory: ${{runner.workspace}}/build
shell: bash
Expand All @@ -162,13 +179,18 @@ jobs:
working-directory: ${{runner.workspace}}/build
run: ${{runner.workspace}}\build\Release\axpbox.exe

- name: Run rom tests script
working-directory: ${{runner.workspace}}\axpbox\test\rom\
run: ${{runner.workspace}}\axpbox\test\rom\test.ps1


- name: Upload AXPbox Binary
uses: actions/upload-artifact@v1
with:
name: AXPbox-windows-x86-msvc-${{ env.BUILD_DATE }}.exe
path: ${{runner.workspace}}\build\Release\axpbox.exe
env:
BUILD_DATE: ${{ steps.date.outputs.date }}
BUILD_DATE: ${{ steps.date.outputs.date }}

osx-x86-appleclang:
runs-on: "macos-12"
Expand Down
34 changes: 21 additions & 13 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,10 @@ list(REMOVE_ITEM srcs ${include_sources})

add_executable(axpbox ${srcs} src/Main.cpp)
target_include_directories(axpbox PRIVATE src src/base src/gui ${CMAKE_BINARY_DIR}/src)

# Path to additional CMake modules
set(CMAKE_MODULE_PATH ${CMAKE_SOURCE_DIR}/cmake)

if (CMAKE_GENERATOR MATCHES "Visual Studio")
add_definitions(-DNOMINMAX -D_WIN32_WINNT=0x0A00 -DLANG_CXX11 -DCOMPILER_MSVC -D__VERSION__=\"MSVC\")
add_definitions(-DWIN32 -DOS_WIN -D_MBCS -DWIN64 -DWIN32_LEAN_AND_MEAN -DNOGDI -DPLATFORM_WINDOWS)
Expand All @@ -24,9 +28,6 @@ endif()
find_package(Threads REQUIRED)
target_link_libraries(axpbox Threads::Threads)

# Path to additional CMake modules
set(CMAKE_MODULE_PATH ${CMAKE_SOURCE_DIR}/cmake)

# Configuration options
include(CheckSymbolExists)
include(CheckIncludeFile)
Expand Down Expand Up @@ -115,30 +116,37 @@ check_symbol_exists(_stricasecmp "string.h" HAVE__STRICASECMP)
check_symbol_exists(_stricmp "string.h" HAVE__STRICMP)

# Features
check_include_file("pcap.h" HAVE_PCAP)
check_include_file("SDL/SDL.h" HAVE_SDL)
check_include_file("X11/X.h" HAVE_X11)
# Large file support (fopen64 / disk files > 2 GB)
AXPBOX_TEST_LARGE_FILES(HAVE_LARGE_FILES)



if (DISABLE_PCAP STREQUAL "yes")
set(HAVE_PCAP 0)
set(WANT_PCAP 0)
else()
set(WANT_PCAP 1)
endif()

if(WANT_PCAP)
find_package(PCAP REQUIRED)
if(PCAP_FOUND)
message(STATUS "pcap found. Networking support enabled")
include_directories(${WINPCAP_INCLUDE_DIRS})
target_link_libraries(axpbox ${WINPCAP_LIBRARIES})
else()
message(STATUS "pcap not found. Networking support disabled")
endif()
else()
message(STATUS "pcap disabled. Networking support disabled")
endif()

if (DISABLE_SDL STREQUAL "yes")
set(HAVE_SDL 0)
endif()
if (DISABLE_X11 STREQUAL "yes")
set(HAVE_X11 0)
endif()

if(HAVE_PCAP)
target_link_libraries(axpbox pcap)
message(STATUS "pcap found. Networking support enabled")
else()
message(WARNING "pcap not found. Building without network support")
endif()
if(HAVE_SDL)
target_link_libraries(axpbox SDL)
message(STATUS "sdl found. SDL graphics support enabled")
Expand Down
Loading

0 comments on commit 842f63d

Please sign in to comment.