Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
31 commits
Select commit Hold shift + click to select a range
a4696de
Updated Catch to v2.13.10
acidicoala Sep 14, 2025
3f07a2b
Code style & inspection settings
acidicoala Sep 15, 2025
c587019
First working TestDetourx64 on linux-clang
acidicoala Sep 15, 2025
5034853
All x64Detour tests pass on linux-clang
acidicoala Sep 15, 2025
527612e
Added translation test to linux
acidicoala Sep 15, 2025
8d0ca74
Fixed safe_mem_read & mem_protect on linux
acidicoala Sep 15, 2025
1901f14
Fix static init fiasco
acidicoala Sep 15, 2025
db428ad
Fix 32-bit linux build
acidicoala Sep 15, 2025
90ad05c
fixed unhooking (stop managing m_userTrampVar)
acidicoala Sep 16, 2025
3541b2e
32-bit detour tests
acidicoala Sep 16, 2025
b749f3a
Added CI tests
acidicoala Sep 17, 2025
4495365
Fix CI
acidicoala Sep 17, 2025
0f0c6b3
Fix CI
acidicoala Sep 17, 2025
63d84a4
Fix CI
acidicoala Sep 17, 2025
c708b99
Fix CI
acidicoala Sep 17, 2025
221c91b
Fix CI
acidicoala Sep 17, 2025
a2d5846
Fix CI
acidicoala Sep 17, 2025
641c18c
Fix CI
acidicoala Sep 17, 2025
f7b05cf
Fix CI
acidicoala Sep 17, 2025
6baec36
Disable tests under GCC
acidicoala Sep 17, 2025
af45230
Fix Windows build
acidicoala Sep 17, 2025
0604940
Fix Windows tests
acidicoala Sep 17, 2025
c62a9c7
Fix test bin path
acidicoala Sep 17, 2025
a62694a
Fix test bin path
acidicoala Sep 17, 2025
6c748ee
Fix test bin path
acidicoala Sep 17, 2025
2cd24dd
Updated CI comments
acidicoala Sep 17, 2025
3371bd3
Removed TODO list
acidicoala Sep 17, 2025
522a2f9
Removed unused test util
acidicoala Sep 17, 2025
8931ac4
Removed trampoline question
acidicoala Sep 17, 2025
4783925
Removed unused code
acidicoala Sep 17, 2025
c1a7fe0
Fix ff 25 read width to be 32bits on x86 mode
stevemk14ebr Sep 27, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 16 additions & 0 deletions .clang-format
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
# Settings for clang-format 20
# See: https://releases.llvm.org/20.1.0/tools/clang/docs/ClangFormatStyleOptions.html

BasedOnStyle: LLVM
ColumnLimit: 120
UseTab: Always
IndentWidth: 4
TabWidth: 4

BinPackArguments: false
BinPackParameters: OnePerLine
AlignAfterOpenBracket: BlockIndent
BracedInitializerIndentWidth: 4
FixNamespaceComments: false
KeepEmptyLines:
AtEndOfFile: true
153 changes: 102 additions & 51 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
@@ -1,73 +1,124 @@
# This starter workflow is for a CMake project running on multiple platforms. There is a different starter workflow if you just want a single platform.
# See: https://github.com/actions/starter-workflows/blob/main/ci/cmake-single-platform.yml
name: Win MSVC, Linux GCC, Linux Clang

on: [push, pull_request, workflow_dispatch]
on: [ push, pull_request, workflow_dispatch ]

jobs:
build:
build-and-test:
runs-on: ${{ matrix.os }}

strategy:
# Set fail-fast to false to ensure that feedback is delivered for all matrix combinations. Consider changing this to true when your workflow is stable.
# We want to see all failing combinations, not just the first one.
fail-fast: false

# Set up a matrix to run the following 3 configurations:
# 1. <Windows, Release, latest MSVC compiler toolchain on the default runner image, default generator>
# 2. <Linux, Release, latest GCC compiler toolchain on the default runner image, default generator>
# 3. <Linux, Release, latest Clang compiler toolchain on the default runner image, default generator>
#
# To add more build types (Release, Debug, RelWithDebInfo, etc.) customize the build_type list.
# This matrix sets up 16 combinations, which are a cross product of: OS, Build Type, Bitness and Compiler
# Then it excludes 4 combinations where OS is Windows and compiler is Clang. It will be included in the future.
# This results in the following 12 combinations:
# windows-debug-32-msvc | windows-debug-64-msvc | windows-release-32-msvc | windows-release-64-msvc
# linux-debug-32-gcc | linux-debug-64-gcc | linux-release-32-gcc | linux-release-64-gcc
# linux-debug-32-clang | linux-debug-64-clang | linux-release-32-clang | linux-release-64-clang
matrix:
os: [ubuntu-latest, windows-latest]
build_type: [Release, Debug]
c_compiler: [gcc, clang, cl]
arch: [x86, AMD64, x86_64]
os: [ ubuntu-latest, windows-latest ]
build_type: [ Debug, Release ]
bitness: [ 32, 64 ]
compiler: [ native, clang ]
exclude:
# TODO: Add this in the future
- os: windows-latest
compiler: clang
include:
# Windows
- os: windows-latest
build_type: Debug
test_bin_path: Debug\\PolyHook_2.exe

- os: windows-latest
build_type: Release
test_bin_path: Release\\PolyHook_2.exe

- os: windows-latest
bitness: 32
arch: -A Win32

- os: windows-latest
bitness: 64
arch: -A x64

## MSVC
- os: windows-latest
compiler: native
c_compiler: cl
cpp_compiler: cl

# Linux
- os: ubuntu-latest
test_bin_path: PolyHook_2

- os: ubuntu-latest
bitness: 32
arch: -DCMAKE_C_FLAGS="-m32" -DCMAKE_CXX_FLAGS="-m32"

- os: ubuntu-latest
bitness: 64
arch: -DCMAKE_C_FLAGS="-m64" -DCMAKE_CXX_FLAGS="-m64"

## GCC
- os: ubuntu-latest
compiler: native
c_compiler: gcc
cpp_compiler: g++

## Clang
- os: ubuntu-latest
compiler: clang
c_compiler: clang
cpp_compiler: clang++
exclude:
- os: windows-latest
c_compiler: gcc
- os: windows-latest
c_compiler: clang
- os: ubuntu-latest
c_compiler: cl
- os: windows-latest
arch: x86_x64
- os: ubuntu-latest
arch: AMD64

env:
BUILD_DIR: "${{ github.workspace }}/build"

steps:
- uses: actions/checkout@v4
with:
submodules: 'recursive'

- name: Set reusable strings
# Turn repeated input strings (such as the build output directory) into step outputs. These step outputs can be used throughout the workflow file.
id: strings
shell: bash
run: |
echo "build-output-dir=${{ github.workspace }}/build" >> "$GITHUB_OUTPUT"

- name: Configure CMake
# Configure CMake in a 'build' subdirectory. `CMAKE_BUILD_TYPE` is only required if you are using a single-configuration generator such as make.
# See https://cmake.org/cmake/help/latest/variable/CMAKE_BUILD_TYPE.html?highlight=cmake_build_type
run: >
cmake -B ${{ steps.strings.outputs.build-output-dir }}
-DCMAKE_CXX_COMPILER=${{ matrix.cpp_compiler }}
-DCMAKE_C_COMPILER=${{ matrix.c_compiler }}
-DCMAKE_BUILD_TYPE=${{ matrix.build_type }}
-DCMAKE_SYSTEM_PROCESSOR=${{ matrix.arch }}
-S ${{ github.workspace }}

- name: Build
# Build your program with the given configuration. Note that --config is needed because the default Windows generator is a multi-config generator (Visual Studio generator).
run: cmake --build ${{ steps.strings.outputs.build-output-dir }} --config ${{ matrix.build_type }}
# The default GitHub runner is missing dependencies for cross-compilation
- name: Install 32-bit compiler toolchain
if: ${{ matrix.bitness == '32' && matrix.os == 'ubuntu-latest' }}
run: sudo apt update && sudo apt install gcc-multilib g++-multilib

- uses: actions/checkout@v5
with:
submodules: 'recursive'

- name: Configure CMake for build
# Configure CMake in a 'build' subdirectory. `CMAKE_BUILD_TYPE` is only required if
# you are using a single-configuration generator such as make.
# See https://cmake.org/cmake/help/latest/variable/CMAKE_BUILD_TYPE.html?highlight=cmake_build_type
run: >
cmake -B ${{ env.BUILD_DIR }}
-S ${{ github.workspace }}
-DCMAKE_CXX_COMPILER=${{ matrix.cpp_compiler }}
-DCMAKE_C_COMPILER=${{ matrix.c_compiler }}
-DCMAKE_BUILD_TYPE=${{ matrix.build_type }}
${{ matrix.arch }}

- name: Build
# Build your program with the given configuration. Note that --config is needed because
# the default Windows generator is a multi-config generator (Visual Studio generator).
run: cmake --build ${{ env.BUILD_DIR }} --config ${{ matrix.build_type }}

# TODO: Deduplicate this command
- name: Configure CMake for test
run: >
cmake -B ${{ env.BUILD_DIR }}
-S ${{ github.workspace }}
-DCMAKE_CXX_COMPILER=${{ matrix.cpp_compiler }}
-DCMAKE_C_COMPILER=${{ matrix.c_compiler }}
-DCMAKE_BUILD_TYPE=${{ matrix.build_type }}
${{ matrix.arch }}
-DPOLYHOOK_BUILD_DLL="OFF"

- name: Build tests
id: build-tests
if: ${{ matrix.c_compiler != 'gcc' }} # See PLH_TEST_CALLBACK in TestUtils.hpp for the reason
run: cmake --build ${{ env.BUILD_DIR }} --config ${{ matrix.build_type }} --target PolyHook_2

- name: Run tests
if: ${{ steps.build-tests.outcome != 'skipped' }}
run: ${{ env.BUILD_DIR }}/${{ matrix.test_bin_path }}
Loading
Loading