diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 239f2234..2c8f9f42 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -2,12 +2,14 @@ name: Build USVFS on: push: - branches: master + branches: [master, dev/cmake] + tags: + - "*" pull_request: types: [opened, synchronize, reopened] env: - BOOST_PREBUILT_URL: "https://github.com/ModOrganizer2/mob/releases/download/2.5-dependencies/boost_prebuilt_1_85_0.7z" + VCPKG_BINARY_SOURCES: "clear;x-gha,readwrite" jobs: build: @@ -16,104 +18,115 @@ jobs: matrix: arch: [x86, x64] config: [Debug, Release] - tests: ["", "Test"] runs-on: windows-2022 steps: + # https://learn.microsoft.com/en-us/vcpkg/consume/binary-caching-github-actions-cache + - name: Export GitHub Actions cache environment variables + uses: actions/github-script@v7 + with: + script: | + core.exportVariable('ACTIONS_CACHE_URL', process.env.ACTIONS_CACHE_URL || ''); + core.exportVariable('ACTIONS_RUNTIME_TOKEN', process.env.ACTIONS_RUNTIME_TOKEN || ''); + + # checkout USVFS and vcpkg - uses: actions/checkout@v4 + - uses: lukka/run-vcpkg@v11 + with: + vcpkgGitCommitId: f61a294e765b257926ae9e9d85f96468a0af74e7 + vcpkgJsonGlob: ${{ github.workspace }}/usvfs/vcpkg.json + + # configure + - run: cmake --preset vs2022-windows-${{ matrix.arch }} -B build_${{ matrix.arch }} "-DCMAKE_INSTALL_PREFIX=install/${{ matrix.config }}" + env: + VCPKG_ROOT: ${{ github.workspace }}/vcpkg + + # build + - run: cmake --build build_${{ matrix.arch }} --config ${{ matrix.config }} --target INSTALL + env: + VCPKG_ROOT: ${{ github.workspace }}/vcpkg + + # package install + - uses: actions/upload-artifact@master + with: + name: usvfs_${{ matrix.config }}_${{ matrix.arch }} + path: ./install/${{ matrix.config }} + + # package test/dlls/etc. for tests + + - uses: actions/upload-artifact@master with: - submodules: true - - name: Fetch Boost prebuilt - run: | - Invoke-WebRequest -Uri ${env:BOOST_PREBUILT_URL} -OutFile boost.7z - Expand-7ZipArchive -Path boost.7z -Destination .\boost - - name: Add msbuild to PATH - uses: microsoft/setup-msbuild@v2 - with: - msbuild-architecture: ${{ matrix.arch }} - - if: matrix.tests == 'Test' - name: Fetch googletest - uses: actions/checkout@v4 - with: - repository: google/googletest - path: ./googletest - - if: matrix.tests == 'Test' - name: Build googletest - run: | - cmake -B googletest/build_${{ matrix.arch }} ` - -A ${{ matrix.arch == 'x86' && 'Win32' || 'x64' }} ` - -Dgtest_force_shared_crt=ON ` - googletest - cmake --build googletest/build_${{ matrix.arch }} --config ${{ matrix.config }} - - name: Build - run: | - msbuild -nologo ` - -maxCpuCount "-property:UseMultiToolTask=true" "-property:EnforceProcessCountAcrossBuilds=true" ` - "-property:Configuration=${{ matrix.config }}${{ matrix.tests }}" ` - "-property:Platform=${{ matrix.arch }}" ` - "-property:BOOST_PATH=..\boost" ` - "-property:GTEST_PATH=..\googletest" ` - "-property:GTEST_LIBDIR=..\googletest\build_${{ matrix.arch }}\lib\${{ matrix.config }}" ` - "-property:RunCodeAnalysis=false" ` - .\vsbuild\usvfs.sln - - - if: matrix.tests == 'Test' && matrix.config == 'Debug' - uses: actions/upload-artifact@master - with: - name: usvfs-libs_${{ matrix.arch }} + name: usvfs-libs_${{ matrix.config }}_${{ matrix.arch }} path: ./lib - - if: matrix.tests == 'Test' && matrix.config == 'Debug' - uses: actions/upload-artifact@master + - uses: actions/upload-artifact@master with: - name: usvfs-bins_${{ matrix.arch }} + name: usvfs-bins_${{ matrix.config }}_${{ matrix.arch }} path: ./bin - - if: matrix.tests == 'Test' && matrix.config == 'Debug' - uses: actions/upload-artifact@master + - uses: actions/upload-artifact@master with: - name: usvfs-tests_${{ matrix.arch }} + name: usvfs-tests_${{ matrix.config }}_${{ matrix.arch }} path: ./test/bin - # merge x86 / x64 artifacts - merge-artifacts: + # merge x86 / x64 artifacts for tests (root bin/lib and test folder) + merge-artifacts-for-tests: runs-on: ubuntu-latest - name: Merge Artifacts for Tests + name: Merge Test Artifacts needs: build + strategy: + matrix: + config: [Debug, Release] steps: - name: Merge USVFS libs uses: actions/upload-artifact/merge@v4 with: - name: usvfs-libs - pattern: usvfs-libs_* + name: usvfs-libs_${{ matrix.config }} + pattern: usvfs-libs_${{ matrix.config }}_* - name: Merge USVFS bins uses: actions/upload-artifact/merge@v4 with: - name: usvfs-bins - pattern: usvfs-bins_* + name: usvfs-bins_${{ matrix.config }} + pattern: usvfs-bins_${{ matrix.config }}_* - name: Merge USVFS tests uses: actions/upload-artifact/merge@v4 with: - name: usvfs-tests - pattern: usvfs-tests_* + name: usvfs-tests_${{ matrix.config }} + pattern: usvfs-tests_${{ matrix.config }}_* + + # merge x86 / x64 artifacts (install folder) + merge-artifacts-for-release: + runs-on: ubuntu-latest + name: Merge Install Artifacts + needs: build + strategy: + matrix: + config: [Debug, Release] + steps: + - name: Merge USVFS install + uses: actions/upload-artifact/merge@v4 + with: + name: usvfs_${{ matrix.config }} + pattern: usvfs_${{ matrix.config }}_* test: name: Test USVFS - needs: merge-artifacts + needs: merge-artifacts-for-tests runs-on: windows-2022 strategy: matrix: + config: [Debug, Release] arch: [x86, x64] steps: - uses: actions/checkout@v4 - uses: actions/download-artifact@master with: - name: usvfs-libs + name: usvfs-libs_${{ matrix.config }} path: ./lib - uses: actions/download-artifact@master with: - name: usvfs-bins + name: usvfs-bins_${{ matrix.config }} path: ./bin - uses: actions/download-artifact@master with: - name: usvfs-tests + name: usvfs-tests_${{ matrix.config }} path: ./test/bin - run: ./test/bin/shared_test_${{ matrix.arch }}.exe if: always() @@ -130,8 +143,39 @@ jobs: - uses: actions/upload-artifact@master if: always() with: - name: tests-outputs_${{ matrix.arch }} + name: tests-outputs_${{ matrix.config }}_${{ matrix.arch }} path: ./test/temp if-no-files-found: ignore retention-days: 7 overwrite: true + + publish: + if: github.ref_type == 'tag' + needs: [merge-artifacts-for-release, test] + runs-on: windows-2022 + permissions: + contents: write + steps: + # USVFS does not use different names for debug and release so we are going to + # retrieve both install artifacts and put them under install/ and install/debug/ + + - name: Download Release Artifact + uses: actions/download-artifact@master + with: + name: usvfs_Release + path: ./install + + - name: Download Debug Artifact + uses: actions/download-artifact@master + with: + name: usvfs_Debug + path: ./install/debug + + - name: Create USVFS Base archive + run: 7z a usvfs_${{ github.ref_name }}.7z ./install/* + + - name: Publish Release + env: + GH_TOKEN: ${{ github.token }} + GH_REPO: ${{ github.repository }} + run: gh release create --draft=false --notes="Release ${{ github.ref_name }}" "${{ github.ref_name }}" ./usvfs_${{ github.ref_name }}.7z diff --git a/.gitignore b/.gitignore index e9c54f6c..c9837dd1 100644 --- a/.gitignore +++ b/.gitignore @@ -2,6 +2,8 @@ /bin /lib /test/bin +/build* +/install # local overides /vsbuild/external_dependencies_local.props @@ -11,6 +13,9 @@ /vsbuild/ReleaseTest /vsbuild/Debug /vsbuild/DebugTest +/vsbuild32 +/vsbuild64 +CMakeUserPresets.json # test "side effects" /test/temp diff --git a/.gitmodules b/.gitmodules deleted file mode 100644 index 272512fb..00000000 --- a/.gitmodules +++ /dev/null @@ -1,9 +0,0 @@ -[submodule "asmjit"] - path = asmjit - url = https://github.com/asmjit/asmjit.git -[submodule "udis86"] - path = udis86 - url = https://github.com/ModOrganizer2/udis86 -[submodule "spdlog"] - path = spdlog - url = https://github.com/gabime/spdlog.git diff --git a/CMakeLists.txt b/CMakeLists.txt new file mode 100644 index 00000000..e0deb428 --- /dev/null +++ b/CMakeLists.txt @@ -0,0 +1,75 @@ +cmake_minimum_required(VERSION 3.16) + +include(CMakePackageConfigHelpers) + +project(usvfs) + +set_property(GLOBAL PROPERTY USE_FOLDERS ON) +set(CMAKE_VS_INCLUDE_INSTALL_TO_DEFAULT_BUILD 1) +set(CMAKE_CXX_STANDARD 20) + +set(USVFS_BINDIR ${CMAKE_CURRENT_LIST_DIR}/bin) +set(USVFS_LIBDIR ${CMAKE_CURRENT_LIST_DIR}/lib) + +if (MSVC) + # /Zi generate PDBs + # /Gy enable function-level linking + # /Oi enable intrinsic function + add_compile_options("$<$>:/Zi;/Gy;/Oi>") + + # /OPT:ICF enable COMDAT folding + # /DEBUG:FULL generate debug info (PDB) + # /OPT:REF enable references (PDB) + add_link_options("$<$>:/OPT:ICF;/DEBUG:FULL;/OPT:REF>") +endif() + +if(CMAKE_SIZEOF_VOID_P EQUAL 4) + set(ARCH_POSTFIX _x86) +else() + set(ARCH_POSTFIX _x64) +endif() + +add_subdirectory(src/shared) + +add_subdirectory(src/thooklib) +add_subdirectory(src/tinjectlib) +add_subdirectory(src/usvfs_helper) + +add_subdirectory(src/usvfs_dll) +add_subdirectory(src/usvfs_proxy) + +configure_package_config_file(${CMAKE_CURRENT_SOURCE_DIR}/cmake/config.cmake.in + "${CMAKE_CURRENT_BINARY_DIR}/usvfsConfig.cmake" + INSTALL_DESTINATION "lib/cmake/usvfs" + NO_SET_AND_CHECK_MACRO + NO_CHECK_REQUIRED_COMPONENTS_MACRO +) + +file(READ "${CMAKE_CURRENT_SOURCE_DIR}/include/usvfs/usvfs_version.h" usvfs_version) +string(REGEX MATCH "USVFS_VERSION_MAJOR ([0-9]*)" _ ${usvfs_version}) +set(usvfs_version_major ${CMAKE_MATCH_1}) +string(REGEX MATCH "USVFS_VERSION_MINOR ([0-9]*)" _ ${usvfs_version}) +set(usvfs_version_minor ${CMAKE_MATCH_1}) +string(REGEX MATCH "USVFS_VERSION_BUILD ([0-9]*)" _ ${usvfs_version}) +set(usvfs_version_build ${CMAKE_MATCH_1}) +string(REGEX MATCH "USVFS_VERSION_REVISION ([0-9]*)" _ ${usvfs_version}) +set(usvfs_version_revision ${CMAKE_MATCH_1}) + +write_basic_package_version_file( + "${CMAKE_CURRENT_BINARY_DIR}/usvfsConfigVersion.cmake" + VERSION "${usvfs_version_major}.${usvfs_version_minor}.${usvfs_version_build}.${usvfs_version_revision}" + COMPATIBILITY AnyNewerVersion + ARCH_INDEPENDENT +) + +install(FILES + ${CMAKE_CURRENT_BINARY_DIR}/usvfsConfig.cmake + ${CMAKE_CURRENT_BINARY_DIR}/usvfsConfigVersion.cmake + DESTINATION lib/cmake/usvfs +) + +if (BUILD_TESTING) + enable_testing() + set(USVFS_TEST_BINDIR ${CMAKE_CURRENT_LIST_DIR}/test/bin) + add_subdirectory(test) +endif() diff --git a/CMakePresets.json b/CMakePresets.json new file mode 100644 index 00000000..156ccfe8 --- /dev/null +++ b/CMakePresets.json @@ -0,0 +1,102 @@ +{ + "configurePresets": [ + { + "cacheVariables": { + "BUILD_TESTING": { + "type": "BOOL", + "value": "ON" + } + }, + "errors": { + "deprecated": true + }, + "hidden": true, + "name": "cmake-dev", + "warnings": { + "deprecated": true, + "dev": true + } + }, + { + "cacheVariables": { + "VCPKG_MANIFEST_NO_DEFAULT_FEATURES": { + "type": "BOOL", + "value": "ON" + } + }, + "toolchainFile": "$env{VCPKG_ROOT}/scripts/buildsystems/vcpkg.cmake", + "hidden": true, + "name": "vcpkg" + }, + { + "cacheVariables": { + "VCPKG_MANIFEST_FEATURES": { + "type": "STRING", + "value": "testing" + } + }, + "hidden": true, + "inherits": ["vcpkg"], + "name": "vcpkg-dev" + }, + { + "binaryDir": "${sourceDir}/vsbuild64", + "architecture": { + "strategy": "set", + "value": "x64" + }, + "cacheVariables": { + "VCPKG_TARGET_TRIPLET": { + "type": "STRING", + "value": "x64-windows-static-md" + } + }, + "hidden": true, + "name": "windows-x64" + }, + { + "binaryDir": "${sourceDir}/vsbuild32", + "architecture": { + "strategy": "set", + "value": "Win32" + }, + "cacheVariables": { + "VCPKG_TARGET_TRIPLET": { + "type": "STRING", + "value": "x86-windows-static-md" + } + }, + "hidden": true, + "name": "windows-x86" + }, + { + "cacheVariables": { + "CMAKE_CXX_FLAGS": "/EHsc /MP /W4" + }, + "generator": "Visual Studio 17 2022", + "inherits": ["cmake-dev", "vcpkg-dev"], + "hidden": true, + "name": "vs2022-windows", + "toolset": "v143" + }, + { + "inherits": ["vs2022-windows", "windows-x64"], + "name": "vs2022-windows-x64" + }, + { + "inherits": ["vs2022-windows", "windows-x86"], + "name": "vs2022-windows-x86" + } + ], + "buildPresets": [ + { + "name": "vs2022-windows-x64", + "configurePreset": "vs2022-windows-x64" + }, + { + "name": "vs2022-windows-x86", + "configurePreset": "vs2022-windows-x86" + } + ], + "version": 3 +} diff --git a/LICENSE b/LICENSE index 3f5aed8d..c0000a00 100644 --- a/LICENSE +++ b/LICENSE @@ -1,4 +1,4 @@ -Copyright (C) 2015-2017 Sebastian Herbord +Copyright (C) 2015-2024 Sebastian Herbord, ModOrganizer2 Team This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 3 of the License, or (at your option) any later version. @@ -697,4 +697,3 @@ may consider it more useful to permit linking proprietary applications with the library. If this is what you want to do, use the GNU Lesser General Public License instead of this License. But first, please read . - diff --git a/README.md b/README.md index b23376c8..16cca300 100644 --- a/README.md +++ b/README.md @@ -1,14 +1,13 @@ # usvfs [![License](http://img.shields.io/:license-gpl-blue.svg)](http://www.gnu.org/licenses/gpl-3.0.en.html) -[![Build status](https://ci.appveyor.com/api/projects/status/rfc2xe8mo9775smo?svg=true)](https://ci.appveyor.com/project/Modorganizer2/usvfs) -[![Coverity Scan Build Status](https://scan.coverity.com/projects/8941/badge.svg)](https://scan.coverity.com/projects/8941) +[![Build status](https://github.com/github/docs/actions/workflows/build.yml/badge.svg)](https://github.com/ModOrganizer2/usvfs/actions) USVFS (short for User Space Virtual File System) aims to allow windows applications to create file or directory links that are visible to only a select set of processes. It does so by using api hooking to fool file access functions into discovering/opening files that are in fact somewhere else -# Comparison to symbolic links +## Comparison to symbolic links The following is based on the final goal for usvfs and doesn't necessary reflect the current development state. @@ -27,16 +26,29 @@ There are of course drawbacks - introduces a new source of bugs that can cause hard to diagnose problems in affected processes - may rub antivirus software the wrong way as the used techniques are similar to what some malware does. -# Current state +## Current state usvfs is work in progress and should be considered in alpha state. -It is a core component of Mod Organizer v2 and thus receives serious real world testing +It is a core component of Mod Organizer v2 +and thus receives serious real world testing -# License +## Building + +You will `cmake`, Python 3+ and `vcpkg` to build USVFS: + +```pwsh +cmake -B build32 -A Win32 "-DCMAKE_TOOLCHAIN_FILE=path\to\vcpkg\scripts\buildsystems\vcpkg.cmake" -DBUILD_USVFS_TESTS=TRUE +cmake --build build32 --config Release + +cmake -B build64 -A Win64 "-DCMAKE_TOOLCHAIN_FILE=path\to\vcpkg\scripts\buildsystems\vcpkg.cmake" -DBUILD_USVFS_TESTS=TRUE +cmake --build build64 --config Release +``` + +## License usvfs is currently licensed under the GPLv3 but this may change in the future. -# Contributing +## Contributing -Contributions are very welcome but please notice that since I'm still undecided on licensing I have to ask all contributors to agree -to future licensing changes. +Contributions are very welcome but please notice that since I'm still undecided on +licensing I have to ask all contributors to agree to future licensing changes. diff --git a/asmjit b/asmjit deleted file mode 160000 index fb9f82cb..00000000 --- a/asmjit +++ /dev/null @@ -1 +0,0 @@ -Subproject commit fb9f82cb61df36aa513d054e748dc6769045f33e diff --git a/cmake/config.cmake.in b/cmake/config.cmake.in new file mode 100644 index 00000000..b5e85eef --- /dev/null +++ b/cmake/config.cmake.in @@ -0,0 +1,6 @@ +@PACKAGE_INIT@ + +include ( "${CMAKE_CURRENT_LIST_DIR}/usvfs_x86Targets.cmake" ) +include ( "${CMAKE_CURRENT_LIST_DIR}/usvfs_x64Targets.cmake" ) + +add_library(usvfs::usvfs ALIAS usvfs_x64::usvfs_dll) diff --git a/include/dllimport.h b/include/usvfs/dllimport.h similarity index 100% rename from include/dllimport.h rename to include/usvfs/dllimport.h diff --git a/include/logging.h b/include/usvfs/logging.h similarity index 100% rename from include/logging.h rename to include/usvfs/logging.h diff --git a/include/sharedparameters.h b/include/usvfs/sharedparameters.h similarity index 100% rename from include/sharedparameters.h rename to include/usvfs/sharedparameters.h diff --git a/include/usvfs.h b/include/usvfs/usvfs.h similarity index 100% rename from include/usvfs.h rename to include/usvfs/usvfs.h diff --git a/include/usvfs_version.h b/include/usvfs/usvfs_version.h similarity index 96% rename from include/usvfs_version.h rename to include/usvfs/usvfs_version.h index 71ded550..e998df3c 100644 --- a/include/usvfs_version.h +++ b/include/usvfs/usvfs_version.h @@ -3,7 +3,7 @@ #define USVFS_VERSION_MAJOR 0 #define USVFS_VERSION_MINOR 5 #define USVFS_VERSION_BUILD 6 -#define USVFS_VERSION_REVISION 1 +#define USVFS_VERSION_REVISION 2 #define USVFS_BUILD_STRING "" #define USVFS_BUILD_WSTRING L"" diff --git a/include/usvfsparameters.h b/include/usvfs/usvfsparameters.h similarity index 100% rename from include/usvfsparameters.h rename to include/usvfs/usvfsparameters.h diff --git a/include/usvfsparametersprivate.h b/include/usvfs/usvfsparametersprivate.h similarity index 100% rename from include/usvfsparametersprivate.h rename to include/usvfs/usvfsparametersprivate.h diff --git a/spdlog b/spdlog deleted file mode 160000 index 27cb4c76..00000000 --- a/spdlog +++ /dev/null @@ -1 +0,0 @@ -Subproject commit 27cb4c76708608465c413f6d0e6b8d99a4d84302 diff --git a/src/shared/CMakeLists.txt b/src/shared/CMakeLists.txt new file mode 100644 index 00000000..c62a0d42 --- /dev/null +++ b/src/shared/CMakeLists.txt @@ -0,0 +1,22 @@ +cmake_minimum_required(VERSION 3.16) + +find_package(Boost CONFIG REQUIRED COMPONENTS algorithm interprocess filesystem) +find_package(spdlog CONFIG REQUIRED) + +file(GLOB sources "*.cpp" "*.h") +source_group("" FILES ${sources}) + +add_library(shared STATIC ${sources}) +target_link_libraries(shared + PUBLIC + Boost::algorithm Boost::interprocess comsuppw + Boost::filesystem spdlog::spdlog_header_only) +target_include_directories(shared + PUBLIC ${PROJECT_SOURCE_DIR}/include/usvfs ${CMAKE_CURRENT_SOURCE_DIR}) +target_precompile_headers(shared PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/pch.h) +target_compile_options(shared PUBLIC /FI"pch.h") +target_compile_definitions(shared PUBLIC + SPDLOG_USE_STD_FORMAT SPDLOG_NO_NAME SPDLOG_NO_REGISTRY_MUTEX + BOOST_INTERPROCESS_SHARED_DIR_FUNC BOOST_CONFIG_SUPPRESS_OUTDATED_MESSAGE + NOMINMAX _WINDOWS _UNICODE UNICODE +) diff --git a/src/shared/formatters.h b/src/shared/formatters.h index ab963a7d..829422fb 100644 --- a/src/shared/formatters.h +++ b/src/shared/formatters.h @@ -75,7 +75,9 @@ struct std::formatter : std::formatter - requires (std::is_pointer_v + requires (std::is_pointer_v + && !std::is_same_v + && !std::is_same_v && !std::is_same_v && !std::is_same_v) struct std::formatter : std::formatter diff --git a/src/thooklib/CMakeLists.txt b/src/thooklib/CMakeLists.txt new file mode 100644 index 00000000..48426db2 --- /dev/null +++ b/src/thooklib/CMakeLists.txt @@ -0,0 +1,14 @@ +cmake_minimum_required(VERSION 3.16) + +find_package(asmjit CONFIG REQUIRED) +find_library(LIBUDIS86_LIBRARY libudis86) +find_package(spdlog CONFIG REQUIRED) + +file(GLOB sources CONFIGURE_DEPENDS "*.cpp" "*.h") +source_group("" FILES ${sources}) + +add_library(thooklib STATIC ${sources}) +target_link_libraries(thooklib PRIVATE shared asmjit::asmjit ${LIBUDIS86_LIBRARY} spdlog::spdlog_header_only) +target_include_directories(thooklib PUBLIC ${CMAKE_CURRENT_SOURCE_DIR}) +set_target_properties(thooklib PROPERTIES FOLDER injection) +target_precompile_headers(shared PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/../shared/pch.h) diff --git a/src/thooklib/asmjit_sane.h b/src/thooklib/asmjit_sane.h index ec0c4388..23f637d7 100644 --- a/src/thooklib/asmjit_sane.h +++ b/src/thooklib/asmjit_sane.h @@ -24,6 +24,6 @@ along with usvfs. If not, see . #pragma warning(disable : 4201) #pragma warning(disable : 4244) #pragma warning(disable : 4245) -#include -#include +#include +#include #pragma warning (pop) diff --git a/src/thooklib/hooklib.cpp b/src/thooklib/hooklib.cpp index 0b66493a..10b2b61a 100644 --- a/src/thooklib/hooklib.cpp +++ b/src/thooklib/hooklib.cpp @@ -23,7 +23,7 @@ along with usvfs. If not, see . #include #include "udis86wrapper.h" #pragma warning (push, 3) -#include "asmjit.h" +#include #pragma warning (pop) #include "hooklib.h" #include "utility.h" diff --git a/src/tinjectlib/CMakeLists.txt b/src/tinjectlib/CMakeLists.txt new file mode 100644 index 00000000..096608ea --- /dev/null +++ b/src/tinjectlib/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.16) + +find_package(asmjit CONFIG REQUIRED) + +add_library(tinjectlib STATIC asmjit_sane.h injectlib.cpp injectlib.h) +target_link_libraries(tinjectlib PRIVATE shared asmjit::asmjit) +target_include_directories(tinjectlib PUBLIC ${CMAKE_CURRENT_SOURCE_DIR}) +set_target_properties(tinjectlib PROPERTIES FOLDER injection) diff --git a/src/tinjectlib/asmjit_sane.h b/src/tinjectlib/asmjit_sane.h index 56be2b17..10d05211 100644 --- a/src/tinjectlib/asmjit_sane.h +++ b/src/tinjectlib/asmjit_sane.h @@ -27,6 +27,6 @@ along with usvfs. If not, see . //#ifndef ASMJIT_API //#define ASMJIT_API //#endif // ASMJIT_API -#include -#include +#include +#include #pragma warning (pop) diff --git a/src/usvfs_dll/CMakeLists.txt b/src/usvfs_dll/CMakeLists.txt new file mode 100644 index 00000000..2520b50c --- /dev/null +++ b/src/usvfs_dll/CMakeLists.txt @@ -0,0 +1,57 @@ +cmake_minimum_required(VERSION 3.16) + +include(GNUInstallDirs) + +find_package(Boost CONFIG REQUIRED COMPONENTS thread) +find_package(spdlog CONFIG REQUIRED) + +file(GLOB sources "*.cpp" "*.h") +source_group("" FILES ${sources}) + +file(GLOB hooks "hooks/*.cpp" "hooks/*.h") +source_group("dlls" FILES ${hooks}) + +add_library(usvfs_dll SHARED) +target_sources(usvfs_dll + PRIVATE + ${PROJECT_SOURCE_DIR}/include/usvfs/usvfsparametersprivate.h + ${sources} + ${hooks} + version.rc + PUBLIC + FILE_SET HEADERS + BASE_DIRS ${PROJECT_SOURCE_DIR}/include + FILES + ${PROJECT_SOURCE_DIR}/include/usvfs/dllimport.h + ${PROJECT_SOURCE_DIR}/include/usvfs/logging.h + ${PROJECT_SOURCE_DIR}/include/usvfs/sharedparameters.h + ${PROJECT_SOURCE_DIR}/include/usvfs/usvfs_version.h + ${PROJECT_SOURCE_DIR}/include/usvfs/usvfs.h + ${PROJECT_SOURCE_DIR}/include/usvfs/usvfsparameters.h +) +target_link_libraries(usvfs_dll + PRIVATE shared thooklib usvfs_helper + Boost::thread spdlog::spdlog_header_only + Shlwapi) +target_compile_definitions(usvfs_dll PRIVATE BUILDING_USVFS_DLL) +set_target_properties(usvfs_dll + PROPERTIES + ARCHIVE_OUTPUT_NAME usvfs${ARCH_POSTFIX} + ARCHIVE_OUTPUT_DIRECTORY_DEBUG ${USVFS_LIBDIR} + ARCHIVE_OUTPUT_DIRECTORY_RELEASE ${USVFS_LIBDIR} + LIBRARY_OUTPUT_NAME usvfs${ARCH_POSTFIX} + LIBRARY_OUTPUT_DIRECTORY_DEBUG ${USVFS_LIBDIR} + LIBRARY_OUTPUT_DIRECTORY_RELEASE ${USVFS_LIBDIR} + PDB_OUTPUT_DIRECTORY_DEBUG ${USVFS_LIBDIR} + PDB_OUTPUT_DIRECTORY_RELEASE ${USVFS_LIBDIR} + RUNTIME_OUTPUT_NAME usvfs${ARCH_POSTFIX} + RUNTIME_OUTPUT_DIRECTORY_DEBUG ${USVFS_LIBDIR} + RUNTIME_OUTPUT_DIRECTORY_RELEASE ${USVFS_LIBDIR}) + +install(TARGETS usvfs_dll EXPORT usvfs${ARCH_POSTFIX}Targets FILE_SET HEADERS) +install(FILES $ DESTINATION pdb OPTIONAL) +install(EXPORT usvfs${ARCH_POSTFIX}Targets + FILE usvfs${ARCH_POSTFIX}Targets.cmake + NAMESPACE usvfs${ARCH_POSTFIX}:: + DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake/usvfs +) diff --git a/src/usvfs_dll/version.rc b/src/usvfs_dll/version.rc index b06dd06e..7dbf8e36 100644 --- a/src/usvfs_dll/version.rc +++ b/src/usvfs_dll/version.rc @@ -1,5 +1,5 @@ #include "Winver.h" -#include "..\..\include\usvfs_version.h" +#include "..\..\include\usvfs\usvfs_version.h" #define VER_FILEVERSION USVFS_VERSION_MAJOR,USVFS_VERSION_MINOR,USVFS_VERSION_BUILD,USVFS_VERSION_REVISION #define VER_FILEVERSION_STR USVFS_VERSION_STRING diff --git a/src/usvfs_helper/CMakeLists.txt b/src/usvfs_helper/CMakeLists.txt new file mode 100644 index 00000000..5e083d9f --- /dev/null +++ b/src/usvfs_helper/CMakeLists.txt @@ -0,0 +1,6 @@ +cmake_minimum_required(VERSION 3.16) + +add_library(usvfs_helper STATIC inject.h inject.cpp) +target_link_libraries(usvfs_helper PUBLIC shared PRIVATE tinjectlib) +target_include_directories(usvfs_helper PUBLIC ${CMAKE_CURRENT_SOURCE_DIR}) +set_target_properties(usvfs_helper PROPERTIES FOLDER injection) diff --git a/src/usvfs_helper/inject.cpp b/src/usvfs_helper/inject.cpp index 264bbcea..fd6f4141 100644 --- a/src/usvfs_helper/inject.cpp +++ b/src/usvfs_helper/inject.cpp @@ -26,7 +26,7 @@ along with usvfs. If not, see . #include #include -#include +#include "inject.h" #include #include #include diff --git a/src/usvfs_proxy/CMakeLists.txt b/src/usvfs_proxy/CMakeLists.txt new file mode 100644 index 00000000..47614eef --- /dev/null +++ b/src/usvfs_proxy/CMakeLists.txt @@ -0,0 +1,15 @@ +cmake_minimum_required(VERSION 3.16) + +find_package(Boost CONFIG REQUIRED COMPONENTS filesystem) + +add_executable(usvfs_proxy main.cpp version.rc) +target_link_libraries(usvfs_proxy PRIVATE usvfs_dll shared usvfs_helper) +set_target_properties(usvfs_proxy + PROPERTIES + RUNTIME_OUTPUT_NAME usvfs_proxy${ARCH_POSTFIX} + RUNTIME_OUTPUT_DIRECTORY_DEBUG ${USVFS_BINDIR} + RUNTIME_OUTPUT_DIRECTORY_RELEASE ${USVFS_BINDIR} +) + +install(TARGETS usvfs_proxy EXPORT usvfs${ARCH_POSTFIX}Targets) +install(FILES $ DESTINATION pdb OPTIONAL) diff --git a/src/usvfs_proxy/version.rc b/src/usvfs_proxy/version.rc index e95c58c5..03652c21 100644 --- a/src/usvfs_proxy/version.rc +++ b/src/usvfs_proxy/version.rc @@ -1,5 +1,5 @@ #include "Winver.h" -#include "..\..\include\usvfs_version.h" +#include "..\..\include\usvfs\usvfs_version.h" #define VER_FILEVERSION USVFS_VERSION_MAJOR,USVFS_VERSION_MINOR,USVFS_VERSION_BUILD,USVFS_VERSION_REVISION #define VER_FILEVERSION_STR USVFS_VERSION_STRING diff --git a/test/CMakeLists.txt b/test/CMakeLists.txt new file mode 100644 index 00000000..43148028 --- /dev/null +++ b/test/CMakeLists.txt @@ -0,0 +1,73 @@ +cmake_minimum_required(VERSION 3.16) + +include(CMakeParseArguments) + +#! usvfs_set_test_properties +# +# this function sets the following properties on the given executable or shared +# library test target: +# - OUTPUT_NAME to add arch-specific prefix +# - OUTPUT_DIRECTORY to put the test executable or shared library in the right location +# - FOLDER to organize the VS solution layout +# +# \param:FOLDER if present, specifies the subfolder to use in the solution +# +function(usvfs_set_test_properties TARGET) + cmake_parse_arguments(USVFS_TEST "" "FOLDER" "" ${ARGN}) + if (NOT DEFINED USVFS_TEST_FOLDER) + set(folder "tests") + else() + set(folder "tests/${USVFS_TEST_FOLDER}") + endif() + set_target_properties(${TARGET} + PROPERTIES + FOLDER ${folder} + RUNTIME_OUTPUT_NAME ${TARGET}${ARCH_POSTFIX} + RUNTIME_OUTPUT_DIRECTORY_DEBUG ${USVFS_TEST_BINDIR} + RUNTIME_OUTPUT_DIRECTORY_RELEASE ${USVFS_TEST_BINDIR} + ) +endfunction() + +#! usvfs_target_link_usvfs +# +# add a target link between the given target and the usvfs shared library with delay +# loading +# +function(usvfs_target_link_usvfs TARGET) + target_link_libraries(${TARGET} PRIVATE usvfs_dll) + target_link_options(${TARGET} PRIVATE "/DELAYLOAD:usvfs${ARCH_POSTFIX}.dll") +endfunction() + + +file(GLOB directories LIST_DIRECTORIES true "*") + +# this goes through all the directories and +# +# 1. add them if there is a CMakeLists.txt inside +# 2. add correspondings tests (for CTest) for BOTH x86 and x64 when possible +# +foreach(directory ${directories}) + if(NOT(IS_DIRECTORY ${directory})) + continue() + endif() + + if(NOT(EXISTS ${directory}/CMakeLists.txt)) + continue() + endif() + + add_subdirectory(${directory}) + + get_filename_component(dirname ${directory} NAME) + if(dirname STREQUAL "test_utils") + continue() + endif() + + add_test(NAME ${dirname}_x64 + COMMAND ${USVFS_TEST_BINDIR}/${dirname}_x64.exe + WORKING_DIRECTORY ${PROJECT_SOURCE_DIR} + ) + add_test(NAME ${dirname}_x86 + COMMAND ${USVFS_TEST_BINDIR}/${dirname}_x86.exe + WORKING_DIRECTORY ${PROJECT_SOURCE_DIR} + ) +endforeach() diff --git a/test/shared_test/CMakeLists.txt b/test/shared_test/CMakeLists.txt new file mode 100644 index 00000000..c5a42ea0 --- /dev/null +++ b/test/shared_test/CMakeLists.txt @@ -0,0 +1,7 @@ +cmake_minimum_required(VERSION 3.16) + +find_package(GTest CONFIG REQUIRED) + +add_executable(shared_test main.cpp) +usvfs_set_test_properties(shared_test) +target_link_libraries(shared_test PRIVATE test_utils GTest::gtest GTest::gtest_main) diff --git a/test/test_utils/CMakeLists.txt b/test/test_utils/CMakeLists.txt new file mode 100644 index 00000000..cdb86d92 --- /dev/null +++ b/test/test_utils/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.16) + +find_package(GTest CONFIG REQUIRED) + +add_library(test_utils STATIC test_helpers.cpp test_helpers.h) +set_target_properties(test_utils PROPERTIES FOLDER tests) +target_link_libraries(test_utils PUBLIC shared) +target_include_directories(test_utils PUBLIC ${CMAKE_CURRENT_SOURCE_DIR}) diff --git a/src/shared/test_helpers.cpp b/test/test_utils/test_helpers.cpp similarity index 99% rename from src/shared/test_helpers.cpp rename to test/test_utils/test_helpers.cpp index 923b9e6e..ef008e94 100644 --- a/src/shared/test_helpers.cpp +++ b/test/test_utils/test_helpers.cpp @@ -1,7 +1,5 @@ #pragma once -#if USVFS_BUILD_TESTS - #include #include "test_helpers.h" @@ -222,5 +220,3 @@ namespace test { } }; - -#endif diff --git a/src/shared/test_helpers.h b/test/test_utils/test_helpers.h similarity index 52% rename from src/shared/test_helpers.h rename to test/test_utils/test_helpers.h index cfe86edb..ad69f222 100644 --- a/src/shared/test_helpers.h +++ b/test/test_utils/test_helpers.h @@ -1,31 +1,30 @@ #pragma once -#if USVFS_BUILD_TESTS - #include "windows_sane.h" #include -namespace test { +namespace test +{ class FuncFailed : public std::runtime_error { public: - FuncFailed(const char* func) - : std::runtime_error(msg(func)) {} - FuncFailed(const char* func, unsigned long res) - : std::runtime_error(msg(func, nullptr, &res)) {} - FuncFailed(const char* func, const char* arg1) - : std::runtime_error(msg(func, arg1)) {} - FuncFailed(const char* func, const char* arg1, unsigned long res) - : std::runtime_error(msg(func, arg1, &res)) {} - FuncFailed(const char* func, const char* what, const char* arg1) - : std::runtime_error(msg(func, arg1, nullptr, what)) {} - FuncFailed(const char* func, const char* what, const char* arg1, unsigned long res) - : std::runtime_error(msg(func, arg1, &res, what)) {} + FuncFailed(const char *func) + : std::runtime_error(msg(func)) {} + FuncFailed(const char *func, unsigned long res) + : std::runtime_error(msg(func, nullptr, &res)) {} + FuncFailed(const char *func, const char *arg1) + : std::runtime_error(msg(func, arg1)) {} + FuncFailed(const char *func, const char *arg1, unsigned long res) + : std::runtime_error(msg(func, arg1, &res)) {} + FuncFailed(const char *func, const char *what, const char *arg1) + : std::runtime_error(msg(func, arg1, nullptr, what)) {} + FuncFailed(const char *func, const char *what, const char *arg1, unsigned long res) + : std::runtime_error(msg(func, arg1, &res, what)) {} private: - std::string msg(const char* func, const char* arg1 = nullptr, const unsigned long* res = nullptr, const char* what = nullptr); + std::string msg(const char *func, const char *arg1 = nullptr, const unsigned long *res = nullptr, const char *what = nullptr); }; class WinFuncFailed : public std::runtime_error @@ -38,7 +37,7 @@ namespace test { { public: WinFuncFailedGenerator(DWORD gle = GetLastError()) : m_gle(gle) {} - WinFuncFailedGenerator(const WinFuncFailedGenerator&) = delete; + WinFuncFailedGenerator(const WinFuncFailedGenerator &) = delete; DWORD lastError() const { return m_gle; } @@ -68,25 +67,39 @@ namespace test { // trick to guarantee the evalutation of GetLastError() before the evalution of the parameters to the WinFuncFailed message generation template - [[noreturn]] void throw_testWinFuncFailed(std::basic_string_view func, Args&&... args) { - ::test::WinFuncFailedGenerator exceptionGenerator; - throw exceptionGenerator(func, std::forward(args)... ); + [[noreturn]] void throw_testWinFuncFailed(std::basic_string_view func, Args &&...args) + { + ::test::WinFuncFailedGenerator exceptionGenerator; + throw exceptionGenerator(func, std::forward(args)...); } - class ScopedFILE { + class ScopedFILE + { public: - ScopedFILE(FILE* f = nullptr) : m_f(f) {} - ScopedFILE(const ScopedFILE&) = delete; - ScopedFILE(ScopedFILE&& other) noexcept : m_f(other.m_f) { other.m_f = nullptr; } - ~ScopedFILE() { if (m_f) fclose(m_f); } + ScopedFILE(FILE *f = nullptr) : m_f(f) {} + ScopedFILE(const ScopedFILE &) = delete; + ScopedFILE(ScopedFILE &&other) noexcept : m_f(other.m_f) { other.m_f = nullptr; } + ~ScopedFILE() + { + if (m_f) + fclose(m_f); + } - void close() { if (m_f) { fclose(m_f); m_f = nullptr; } } + void close() + { + if (m_f) + { + fclose(m_f); + m_f = nullptr; + } + } operator bool() const { return m_f; } - operator FILE*() const { return m_f; } - operator FILE**() { return &m_f; } + operator FILE *() const { return m_f; } + operator FILE **() { return &m_f; } + private: - FILE* m_f; + FILE *m_f; }; using std::filesystem::path; @@ -94,38 +107,39 @@ namespace test { // path functions assume they are called by a test executable // (calculate the requested path relative to the current executable path) - path path_of_test_bin(const path& relative = path()); - path path_of_test_temp(const path& relative = path()); - path path_of_test_fixtures(const path& relative = path()); - path path_of_usvfs_lib(const path& relative = path()); + path path_of_test_bin(const path &relative = path()); + path path_of_test_temp(const path &relative = path()); + path path_of_test_fixtures(const path &relative = path()); + path path_of_usvfs_lib(const path &relative = path()); - std::string platform_dependant_executable(const char* name, const char* ext = "exe", const char* platform = nullptr); + std::string platform_dependant_executable(const char *name, const char *ext = "exe", const char *platform = nullptr); // if full_path is a subfolder of base returns only the relative path, // if full_path and base are the same folder "." is returned, // otherwise full_path is returned unchanged - path path_as_relative(const path& base, const path& full_path); + path path_as_relative(const path &base, const path &full_path); - std::vector read_small_file(const path& file, bool binary = true); + std::vector read_small_file(const path &file, bool binary = true); // true iff the the contents of the two files is exactly the same - bool compare_files(const path& file1, const path& file2, bool binary = true); + bool compare_files(const path &file1, const path &file2, bool binary = true); // return true iff the given path is an empty (optionally true also if path doesn't exist) - bool is_empty_folder(const path& dpath, bool or_doesnt_exist = false); + bool is_empty_folder(const path &dpath, bool or_doesnt_exist = false); - void delete_file(const path& file); + void delete_file(const path &file); // Recursively deletes the given path and all the files and directories under it // Use with care!!! - void recursive_delete_files(const path& dpath); + void recursive_delete_files(const path &dpath); // Recursively copies all files and directories from srcPath to destPath - void recursive_copy_files(const path& src_path, const path& dest_path, bool overwrite); + void recursive_copy_files(const path &src_path, const path &dest_path, bool overwrite); - class ScopedLoadLibrary { + class ScopedLoadLibrary + { public: - ScopedLoadLibrary(const wchar_t* dll_path); + ScopedLoadLibrary(const wchar_t *dll_path); ~ScopedLoadLibrary(); // returns zero if load library failed @@ -135,5 +149,3 @@ namespace test { HMODULE m_mod; }; }; - -#endif diff --git a/test/thooklib_test/CMakeLists.txt b/test/thooklib_test/CMakeLists.txt new file mode 100644 index 00000000..cca9e10b --- /dev/null +++ b/test/thooklib_test/CMakeLists.txt @@ -0,0 +1,11 @@ +cmake_minimum_required(VERSION 3.16) + +find_package(GTest CONFIG REQUIRED) +find_package(Boost CONFIG REQUIRED COMPONENTS thread) + +# not sure why there is a test_hooks.cpp here? +add_executable(thooklib_test main.cpp) +usvfs_set_test_properties(thooklib_test) +target_link_libraries(thooklib_test + PRIVATE test_utils shared thooklib Boost::thread + GTest::gtest GTest::gtest_main) diff --git a/test/tinjectlib_test/CMakeLists.txt b/test/tinjectlib_test/CMakeLists.txt new file mode 100644 index 00000000..9bd3f7b6 --- /dev/null +++ b/test/tinjectlib_test/CMakeLists.txt @@ -0,0 +1,16 @@ +cmake_minimum_required(VERSION 3.16) + +find_package(GTest CONFIG REQUIRED) + +# binary and binary injected +add_executable(testinject_bin testinject_bin/main.cpp) +usvfs_set_test_properties(testinject_bin FOLDER tinjectlib) + +add_library(testinject_dll SHARED testinject_dll/main.cpp testinject_dll/main.h) +usvfs_set_test_properties(testinject_dll FOLDER tinjectlib) + +# actual test executable +add_executable(tinjectlib_test main.cpp) +usvfs_set_test_properties(tinjectlib_test FOLDER tinjectlib) +target_link_libraries(tinjectlib_test PRIVATE tinjectlib shared GTest::gtest GTest::gtest_main) +add_dependencies(tinjectlib_test testinject_bin testinject_dll) diff --git a/test/testinject_bin/main.cpp b/test/tinjectlib_test/testinject_bin/main.cpp similarity index 100% rename from test/testinject_bin/main.cpp rename to test/tinjectlib_test/testinject_bin/main.cpp diff --git a/test/testinject_dll/main.cpp b/test/tinjectlib_test/testinject_dll/main.cpp similarity index 100% rename from test/testinject_dll/main.cpp rename to test/tinjectlib_test/testinject_dll/main.cpp diff --git a/test/testinject_dll/main.h b/test/tinjectlib_test/testinject_dll/main.h similarity index 100% rename from test/testinject_dll/main.h rename to test/tinjectlib_test/testinject_dll/main.h diff --git a/test/tvfs_test/CMakeLists.txt b/test/tvfs_test/CMakeLists.txt new file mode 100644 index 00000000..76a53069 --- /dev/null +++ b/test/tvfs_test/CMakeLists.txt @@ -0,0 +1,12 @@ +cmake_minimum_required(VERSION 3.16) + +find_package(GTest CONFIG REQUIRED) + +add_executable(tvfs_test main.cpp) +usvfs_set_test_properties(tvfs_test) +target_link_libraries(tvfs_test PRIVATE test_utils usvfs_helper GTest::gtest GTest::gtest_main) +usvfs_target_link_usvfs(tvfs_test) + +# tvfs_test uses a private USVFS header so we need to include it manually +get_target_property(USVFS_SOURCE_DIR usvfs_dll SOURCE_DIR) +target_include_directories(tvfs_test PRIVATE ${USVFS_SOURCE_DIR}) diff --git a/test/usvfs_test_runner/CMakeLists.txt b/test/usvfs_test_runner/CMakeLists.txt new file mode 100644 index 00000000..a0a7ca92 --- /dev/null +++ b/test/usvfs_test_runner/CMakeLists.txt @@ -0,0 +1,35 @@ +cmake_minimum_required(VERSION 3.16) + +find_package(GTest CONFIG REQUIRED) + +# other executables +add_executable(test_file_operations + test_file_operations/test_file_operations.cpp + test_file_operations/test_filesystem.cpp + test_file_operations/test_filesystem.h + test_file_operations/test_ntapi.cpp + test_file_operations/test_ntapi.h + test_file_operations/test_ntdll_declarations.h + test_file_operations/test_w32api.cpp + test_file_operations/test_w32api.h +) +usvfs_set_test_properties(test_file_operations FOLDER usvfs_test_runner) +target_link_libraries(test_file_operations PRIVATE test_utils ntdll) + +add_executable(usvfs_test + usvfs_test/usvfs_basic_test.cpp + usvfs_test/usvfs_basic_test.h + usvfs_test/usvfs_test_base.cpp + usvfs_test/usvfs_test_base.h + usvfs_test/usvfs_test.cpp +) +usvfs_set_test_properties(usvfs_test FOLDER usvfs_test_runner) +usvfs_target_link_usvfs(usvfs_test) +target_link_libraries(usvfs_test PRIVATE test_utils) + +# actual test executable +add_executable(usvfs_test_runner usvfs_test_runner.cpp) +usvfs_set_test_properties(usvfs_test_runner FOLDER usvfs_test_runner) +target_link_libraries(usvfs_test_runner + PRIVATE test_utils GTest::gtest GTest::gtest_main) +add_dependencies(usvfs_test_runner usvfs_test test_file_operations) diff --git a/test/test_file_operations/test_file_operations.cpp b/test/usvfs_test_runner/test_file_operations/test_file_operations.cpp similarity index 100% rename from test/test_file_operations/test_file_operations.cpp rename to test/usvfs_test_runner/test_file_operations/test_file_operations.cpp diff --git a/test/test_file_operations/test_filesystem.cpp b/test/usvfs_test_runner/test_file_operations/test_filesystem.cpp similarity index 100% rename from test/test_file_operations/test_filesystem.cpp rename to test/usvfs_test_runner/test_file_operations/test_filesystem.cpp diff --git a/test/test_file_operations/test_filesystem.h b/test/usvfs_test_runner/test_file_operations/test_filesystem.h similarity index 100% rename from test/test_file_operations/test_filesystem.h rename to test/usvfs_test_runner/test_file_operations/test_filesystem.h diff --git a/test/test_file_operations/test_ntapi.cpp b/test/usvfs_test_runner/test_file_operations/test_ntapi.cpp similarity index 100% rename from test/test_file_operations/test_ntapi.cpp rename to test/usvfs_test_runner/test_file_operations/test_ntapi.cpp diff --git a/test/test_file_operations/test_ntapi.h b/test/usvfs_test_runner/test_file_operations/test_ntapi.h similarity index 100% rename from test/test_file_operations/test_ntapi.h rename to test/usvfs_test_runner/test_file_operations/test_ntapi.h diff --git a/test/test_file_operations/test_ntdll_declarations.h b/test/usvfs_test_runner/test_file_operations/test_ntdll_declarations.h similarity index 100% rename from test/test_file_operations/test_ntdll_declarations.h rename to test/usvfs_test_runner/test_file_operations/test_ntdll_declarations.h diff --git a/test/test_file_operations/test_w32api.cpp b/test/usvfs_test_runner/test_file_operations/test_w32api.cpp similarity index 100% rename from test/test_file_operations/test_w32api.cpp rename to test/usvfs_test_runner/test_file_operations/test_w32api.cpp diff --git a/test/test_file_operations/test_w32api.h b/test/usvfs_test_runner/test_file_operations/test_w32api.h similarity index 100% rename from test/test_file_operations/test_w32api.h rename to test/usvfs_test_runner/test_file_operations/test_w32api.h diff --git a/test/usvfs_test/usvfs_basic_test.cpp b/test/usvfs_test_runner/usvfs_test/usvfs_basic_test.cpp similarity index 100% rename from test/usvfs_test/usvfs_basic_test.cpp rename to test/usvfs_test_runner/usvfs_test/usvfs_basic_test.cpp diff --git a/test/usvfs_test/usvfs_basic_test.h b/test/usvfs_test_runner/usvfs_test/usvfs_basic_test.h similarity index 100% rename from test/usvfs_test/usvfs_basic_test.h rename to test/usvfs_test_runner/usvfs_test/usvfs_basic_test.h diff --git a/test/usvfs_test/usvfs_test.cpp b/test/usvfs_test_runner/usvfs_test/usvfs_test.cpp similarity index 100% rename from test/usvfs_test/usvfs_test.cpp rename to test/usvfs_test_runner/usvfs_test/usvfs_test.cpp diff --git a/test/usvfs_test/usvfs_test_base.cpp b/test/usvfs_test_runner/usvfs_test/usvfs_test_base.cpp similarity index 100% rename from test/usvfs_test/usvfs_test_base.cpp rename to test/usvfs_test_runner/usvfs_test/usvfs_test_base.cpp diff --git a/test/usvfs_test/usvfs_test_base.h b/test/usvfs_test_runner/usvfs_test/usvfs_test_base.h similarity index 100% rename from test/usvfs_test/usvfs_test_base.h rename to test/usvfs_test_runner/usvfs_test/usvfs_test_base.h diff --git a/udis86 b/udis86 deleted file mode 160000 index df9323a4..00000000 --- a/udis86 +++ /dev/null @@ -1 +0,0 @@ -Subproject commit df9323a47f4c343302617239d42968f6ac61218a diff --git a/vcpkg-configuration.json b/vcpkg-configuration.json new file mode 100644 index 00000000..7990f775 --- /dev/null +++ b/vcpkg-configuration.json @@ -0,0 +1,21 @@ +{ + "default-registry": { + "kind": "git", + "repository": "https://github.com/Microsoft/vcpkg", + "baseline": "f61a294e765b257926ae9e9d85f96468a0af74e7" + }, + "registries": [ + { + "kind": "git", + "repository": "https://github.com/Microsoft/vcpkg", + "baseline": "f61a294e765b257926ae9e9d85f96468a0af74e7", + "packages": ["boost*", "boost-*"] + }, + { + "kind": "git", + "repository": "https://github.com/ModOrganizer2/vcpkg-registry", + "baseline": "27d8adbfe9e4ce88a875be3a45fadab69869eb60", + "packages": ["asmjit", "spdlog"] + } + ] +} diff --git a/vcpkg.json b/vcpkg.json new file mode 100644 index 00000000..818fe758 --- /dev/null +++ b/vcpkg.json @@ -0,0 +1,25 @@ +{ + "dependencies": [ + "asmjit", + "spdlog", + "libudis86", + "boost-algorithm", + "boost-any", + "boost-dll", + "boost-filesystem", + "boost-format", + "boost-interprocess", + "boost-headers", + "boost-locale", + "boost-multi-index", + "boost-thread", + "boost-predef" + ], + "builtin-baseline": "f61a294e765b257926ae9e9d85f96468a0af74e7", + "features": { + "testing": { + "description": "Build USVFS tests.", + "dependencies": ["gtest"] + } + } +}