diff --git a/.github/workflows/c-cpp.yml b/.github/workflows/c-cpp.yml new file mode 100644 index 0000000..841123f --- /dev/null +++ b/.github/workflows/c-cpp.yml @@ -0,0 +1,72 @@ +name: C/C++ CI + +on: + push: + branches: [ "main" ] + pull_request: + branches: [ "main" ] + +jobs: + build-and-test: + strategy: + fail-fast: false + matrix: + os: [windows-latest] + build_type: [Release] + runs-on: ${{ matrix.os }} + env: + BUILD_TYPE: ${{ matrix.build_type }} + CTEST_OUTPUT_ON_FAILURE: 1 + + steps: + - name: Checkout + uses: actions/checkout@v4 + + - name: Config MSVC (Windows) + if: runner.os == 'Windows' + uses: ilammy/msvc-dev-cmd@v1 + + - name: Install ninja (Windows) + if: runner.os == 'Windows' + run: choco install -y ninja + + - name: Setup python + uses: actions/setup-python@v4 + with: + python-version: '3.10.X' + cache: 'pip' + cache-dependency-path: '**/requirements.txt' + + - name: Install python dependencies + run: | + python -m pip install --upgrade pip setuptools wheel + pip install -r requirements.txt + + - name: Configure (Windows) + if: runner.os == 'Windows' + run: | + cmake -S . -B build -G Ninja ` + -DCMAKE_BUILD_TYPE=${{ env.BUILD_TYPE }} ` + -DBUILD_TESTING=ON ` + -DBUILD_TESTS=ON ` + -DPROXY_ENABLE_LOG=ON ` + -DPROXY_LINK_MAP=ON ` + -DBUILD_LOADER=ON + + - name: Build + run: cmake --build build --config ${{ env.BUILD_TYPE }} -- -k 0 + + - name: Tests + working-directory: build + run: ctest -C ${{ env.BUILD_TYPE }} + + - name: Upload build & tests logs + if: always() + uses: actions/upload-artifact@v4 + with: + name: logs-${{ matrix.os }}-${{ env.BUILD_TYPE }} + path: | + build/Testing/Temporary/LastTest.log + build/CMakeFiles/CMakeOutput.log + build/CMakeFiles/CMakeError.log + if-no-files-found: ignore diff --git a/CMakeLists.txt b/CMakeLists.txt index c99d9cd..ff7c5c8 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -163,7 +163,7 @@ target_link_options(proxy_library PRIVATE if(PROXY_LINK_MAP) if(${MSVC_LIKE}) target_link_options(proxy_library PRIVATE - "/MAP:${CMAKE_CURRENT_BINARY_DIR}/${PROXY_DLL_NAME}.map" "/MAPINFO:SECTIONS" + "/MAP:${CMAKE_CURRENT_BINARY_DIR}/${PROXY_DLL_NAME}.map" "/MAPINFO:EXPORTS" ) else() target_link_options(proxy_library PRIVATE diff --git a/requirements.txt b/requirements.txt new file mode 100644 index 0000000..5088fdb --- /dev/null +++ b/requirements.txt @@ -0,0 +1 @@ +pefile \ No newline at end of file diff --git a/tools/gen_def.py b/tools/gen_def.py index 2a62984..98fbdab 100644 --- a/tools/gen_def.py +++ b/tools/gen_def.py @@ -6,7 +6,6 @@ from pathlib import Path from typing import NamedTuple, Optional, List, Literal - import pefile # ---------------------------