diff --git a/.github/workflows/main_ci.yml b/.github/workflows/main_ci.yml index cc168e5a..3694d158 100644 --- a/.github/workflows/main_ci.yml +++ b/.github/workflows/main_ci.yml @@ -24,7 +24,7 @@ jobs: uses: actions/checkout@v4 - name: Setup MSVC Environment - uses: ilammy/msvc-dev-cmd@v1.10.0 + uses: ilammy/msvc-dev-cmd@v1.12.1 - name: Setup vcpkg uses: lukka/run-vcpkg@v11 diff --git a/.github/workflows/maintenance.yml b/.github/workflows/maintenance.yml index d9f5ce34..c41a37d4 100644 --- a/.github/workflows/maintenance.yml +++ b/.github/workflows/maintenance.yml @@ -5,6 +5,7 @@ on: branches: main paths: - "CommonLibSF/**" + workflow_dispatch: jobs: maintenance: @@ -17,7 +18,7 @@ jobs: shell: pwsh run: "& ${{ github.workspace }}/.github/make-directives.ps1 ${{ github.workspace }}/CommonLibSF" - - name: Run clang-format + - name: Apply Clang-Format uses: DoozyX/clang-format-lint-action@v0.16.2 with: source: "." @@ -26,16 +27,16 @@ jobs: clangFormatVersion: 16 inplace: True - - name: Update vcpkg version-date + - name: Update VCPKG Version id: versioning shell: pwsh run: "& ${{ github.workspace }}/.github/update-registry.ps1 ${{ github.workspace }}" - - name: Check for success + - name: Check Failure run: exit 1 if: ${{ steps.versioning.outputs.VCPKG_SUCCESS == 'false' }} - - name: Check for commit + - name: Check for Commit uses: EndBug/add-and-commit@v9 with: author_name: maintenance @@ -47,6 +48,5 @@ jobs: uses: peter-evans/repository-dispatch@v2 with: token: ${{ secrets.VCPKG_HELPER_TOKEN }} - repository: Starfield-Reverse-Engineering/Starfield-RE-vcpkg + repository: ${{ github.repository_owner }}/Starfield-RE-vcpkg event-type: update-event - client-payload: '{"sha": "${{ github.sha }}"}' diff --git a/CommonLibSF/CMakeLists.txt b/CommonLibSF/CMakeLists.txt index 2eeb92e3..89e470cb 100644 --- a/CommonLibSF/CMakeLists.txt +++ b/CommonLibSF/CMakeLists.txt @@ -5,9 +5,6 @@ if(TARGET CommonLibSF) return() endif() -# options if not defined -option(SFSE_SUPPORT_XBYAK "Enables trampoline support for Xbyak." ON) - # standards & flags set(CMAKE_CXX_STANDARD 23) set(CMAKE_CXX_STANDARD_REQUIRED ON) @@ -32,6 +29,7 @@ endif() # dependencies find_package(spdlog CONFIG REQUIRED) +find_package(xbyak CONFIG REQUIRED) # source files execute_process(COMMAND powershell -ExecutionPolicy Bypass -File "${CMAKE_CURRENT_SOURCE_DIR}/cmake/make-sourcelist.ps1" "${CMAKE_CURRENT_SOURCE_DIR}" "${CMAKE_CURRENT_BINARY_DIR}") @@ -116,18 +114,9 @@ target_link_libraries( ${PROJECT_NAME} PUBLIC spdlog::spdlog - Version.lib -) - -if (SFSE_SUPPORT_XBYAK) -find_package(xbyak CONFIG REQUIRED) - -target_link_libraries( - ${PROJECT_NAME} - PUBLIC xbyak::xbyak + Version.lib ) -endif() target_precompile_headers( ${PROJECT_NAME} diff --git a/CommonLibSF/cmake/config.cmake.in b/CommonLibSF/cmake/config.cmake.in index 95aea02c..cdaf907e 100644 --- a/CommonLibSF/cmake/config.cmake.in +++ b/CommonLibSF/cmake/config.cmake.in @@ -1,5 +1,5 @@ include("${CMAKE_CURRENT_LIST_DIR}/@PROJECT_NAME@-targets.cmake") -include("${CMAKE_CURRENT_LIST_DIR}/@PROJECT_NAME@.cmake") include(CMakeFindDependencyMacro) find_dependency(spdlog CONFIG) +find_dependency(xbyak CONFIG) diff --git a/CommonLibSF/include/REL/Relocation.h b/CommonLibSF/include/REL/Relocation.h index 056debef..608cb419 100644 --- a/CommonLibSF/include/REL/Relocation.h +++ b/CommonLibSF/include/REL/Relocation.h @@ -638,17 +638,6 @@ namespace REL return write_vfunc(a_idx, stl::unrestricted_cast(a_newFunc)); } - /** - template - void write_vfunc() - { - REL::Relocation vtbl{ F::VTABLE[0] - - * * }; - T::func = vtbl.write_vfunc(idx, T::thunk); - } - **/ - private: [[nodiscard]] static std::uintptr_t base() { diff --git a/CommonLibSF/vcpkg.json b/CommonLibSF/vcpkg.json index 9fee2955..760bb482 100644 --- a/CommonLibSF/vcpkg.json +++ b/CommonLibSF/vcpkg.json @@ -8,6 +8,10 @@ "license": "GPL-3.0-or-later", "supports": "windows & x64", "dependencies": [ + { + "name": "vcpkg-cmake", + "host": true + }, { "name": "vcpkg-cmake-config", "host": true diff --git a/README.md b/README.md index 9c2cf7d6..82e55928 100644 --- a/README.md +++ b/README.md @@ -28,29 +28,7 @@ #### vcpkg -Add the following to your `vcpkg-configuration`: - -```json -"registries": [ - { - "kind": "git", - "repository": "https://github.com/Starfield-Reverse-Engineering/Starfield-RE-vcpkg", - "baseline": "", - "packages": [ - "commonlibsf" - ] - } -] -``` - -And the following to your `CMakeLists.txt`: - -```cmake -find_package(CommonLibSF CONFIG REQUIRED) -target_link_libraries(${PROJECT_NAME} - PRIVATE - CommonLibSF::CommonLibSF) -``` +[See how to use CommonLibSF with vcpkg in your project.](https://github.com/Starfield-Reverse-Engineering/Starfield-RE-vcpkg) --- @@ -67,9 +45,11 @@ Then add the following to your `CMakeLists.txt`: ```cmake add_subdirectory(extern/CommonLibSF) -target_link_libraries(${PROJECT_NAME} - PRIVATE - CommonLibSF::CommonLibSF) +target_link_libraries( + ${PROJECT_NAME} + PRIVATE + CommonLibSF::CommonLibSF +) ``` ## End-User Dependencies