Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Boost 1.85 #62

Merged
merged 5 commits into from
Jun 3, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
57 changes: 57 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
name: Build USVFS

on:
push:
branches: master
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"

jobs:
build:
name: Build USVFS
strategy:
matrix:
arch: [x86, x64]
config: [Debug, Release]
tests: ["", "Test"]
exclude:
- config: Debug
tests: ""
runs-on: windows-2022
steps:
- uses: actions/checkout@v4
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' }} 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
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@

# build intermediates:
/vsbuild/Release
/vsbuild/ReleaseTest
/vsbuild/Debug

# test "side effects"
Expand Down
2 changes: 1 addition & 1 deletion appveyor.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ platform:
- x86
environment:
GTEST_PATH: C:\Libraries\GoogleTest
BOOST_PATH: C:\Libraries\boost_1_79_0
BOOST_PATH: C:\Libraries\boost_1_84_0
WEBHOOK_URL:
secure: gOKbXaZM9ImtMD5XrYITvdyZUW/az082G9OIN1EC1VZ2CuYaUUM6WY2eiNxaFeOL7/9Jyu/m+Vm1fH54CEyigcUUaxA7d8F5IMWlOgE/7YYdaAFSMUTFD7EK+++3FBYfmU1F/nZ61wsiWE6hB9Au5FpGBSCeQ0Tf8U8m0ybPmD0=
before_build:
Expand Down
4 changes: 2 additions & 2 deletions src/shared/test_helpers.cpp
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#pragma once

#if 0
#if USVFS_BUILD_TESTS

#include "test_helpers.h"
#include "winapi.h"
Expand Down Expand Up @@ -53,7 +53,7 @@ namespace test {

path path_of_test_bin(const path& relative) {
path base(winapi::wide::getModuleFileName(nullptr));
return base.parent_path() / relative;
return relative.empty() ? base.parent_path() : base.parent_path() / relative;
}

path path_of_test_temp(const path& relative) {
Expand Down
4 changes: 3 additions & 1 deletion src/shared/test_helpers.h
Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@
#pragma once

#if 0
#if USVFS_BUILD_TESTS

#include "windows_sane.h"

#include <filesystem>

namespace test {

class FuncFailed : public std::runtime_error
Expand Down
1 change: 1 addition & 0 deletions src/shared/winapi.h
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ along with usvfs. If not, see <http://www.gnu.org/licenses/>.
#pragma once

#include "windows_sane.h"
#include <ShlObj.h>
#include "logging.h"
#include "stringcast.h"

Expand Down
2 changes: 2 additions & 0 deletions test/shared_test/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@
#include <directory_tree.h>
#undef PRIVATE

#include <tree_container.h>

using namespace usvfs::shared;

using namespace boost::interprocess;
Expand Down
6 changes: 5 additions & 1 deletion test/test_file_operations/test_file_operations.cpp
Original file line number Diff line number Diff line change
@@ -1,7 +1,11 @@
#include <cstdio>
#include <stdexcept>
#include <winapi.h>
#include <fmt/format.h>

#include <boost/type_traits.hpp>
#include <boost/filesystem.hpp>
#include <winapi.h>

#include <test_helpers.h>
#include "test_ntapi.h"
#include "test_w32api.h"
Expand Down
4 changes: 4 additions & 0 deletions test/thooklib_test/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,13 @@
#include <utility.h>
#include <windows_sane.h>
//#include <boost/thread.hpp>
#include <boost/filesystem.hpp>
#include <spdlog.h>
#include <exceptionex.h>
#include <winapi.h>

namespace fs = boost::filesystem;

#include <stringutils.h>


Expand Down
4 changes: 2 additions & 2 deletions test/tinjectlib_test/main.cpp
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
#include <gtest/gtest.h>
#include <injectlib.h>
#include <windows_error.h>
#include <boost/type_traits.hpp>
#include <boost/filesystem.hpp>
#include <winapi.h>
#include <spdlog.h>
#include <boost/filesystem.hpp>

using namespace usvfs::shared;
using namespace InjectLib;
Expand Down
4 changes: 4 additions & 0 deletions test/tvfs_test/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,10 @@ You should have received a copy of the GNU General Public License
along with usvfs. If not, see <http://www.gnu.org/licenses/>.
*/

// this file depends on so many stuff that the easiest way is to include
// pch.h from shared
#include "pch.h"

#include <test_helpers.h>

#pragma warning (push, 3)
Expand Down
6 changes: 5 additions & 1 deletion test/usvfs_test/usvfs_test.cpp
Original file line number Diff line number Diff line change
@@ -1,9 +1,13 @@

#include <iostream>
#include <memory>

#include <boost/filesystem.hpp>
#include <boost/type_traits.hpp>
#include <winapi.h>
#include <stringcast.h>

#include "usvfs_basic_test.h"
#include <stringcast.h>

void print_usage(const std::wstring& exe_name, const std::wstring& test_name) {
using namespace std;
Expand Down
2 changes: 2 additions & 0 deletions test/usvfs_test/usvfs_test_base.cpp
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@

#include "usvfs_test_base.h"
#include <boost/filesystem.hpp>
#include <boost/type_traits.hpp>
#include <winapi.h>
#include <stringcast.h>
#include <usvfs.h>
Expand Down
4 changes: 2 additions & 2 deletions test/usvfs_test/usvfs_test_base.h
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
#pragma once

#include <test_helpers.h>
#include <filesystem>
#include <string>

#include <test_helpers.h>

class usvfs_test_options {
public:
static constexpr auto DEFAULT_MAPPING = L"vfs_mappings.txt";
Expand Down
2 changes: 2 additions & 0 deletions test/usvfs_test_runner/usvfs_test_runner.cpp
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
#include <gtest/gtest.h>

#include <boost/filesystem.hpp>
#include <test_helpers.h>
#include <windows_sane.h>
#include <iostream>
Expand Down
100 changes: 100 additions & 0 deletions vsbuild/asmjit.vcxproj
Original file line number Diff line number Diff line change
@@ -1,10 +1,26 @@
<?xml version="1.0" encoding="utf-8"?>
<Project DefaultTargets="Build" ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ItemGroup Label="ProjectConfigurations">
<ProjectConfiguration Include="DebugTest|Win32">
<Configuration>DebugTest</Configuration>
<Platform>Win32</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="DebugTest|x64">
<Configuration>DebugTest</Configuration>
<Platform>x64</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Debug|Win32">
<Configuration>Debug</Configuration>
<Platform>Win32</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="ReleaseTest|Win32">
<Configuration>ReleaseTest</Configuration>
<Platform>Win32</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="ReleaseTest|x64">
<Configuration>ReleaseTest</Configuration>
<Platform>x64</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Release|Win32">
<Configuration>Release</Configuration>
<Platform>Win32</Platform>
Expand Down Expand Up @@ -88,26 +104,52 @@
<PlatformToolset>v143</PlatformToolset>
<CharacterSet>Unicode</CharacterSet>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='DebugTest|Win32'" Label="Configuration">
<ConfigurationType>StaticLibrary</ConfigurationType>
<UseDebugLibraries>true</UseDebugLibraries>
<PlatformToolset>v143</PlatformToolset>
<CharacterSet>Unicode</CharacterSet>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
<ConfigurationType>StaticLibrary</ConfigurationType>
<UseDebugLibraries>false</UseDebugLibraries>
<PlatformToolset>v143</PlatformToolset>
<WholeProgramOptimization>true</WholeProgramOptimization>
<CharacterSet>Unicode</CharacterSet>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='ReleaseTest|Win32'" Label="Configuration">
<ConfigurationType>StaticLibrary</ConfigurationType>
<UseDebugLibraries>false</UseDebugLibraries>
<PlatformToolset>v143</PlatformToolset>
<WholeProgramOptimization>true</WholeProgramOptimization>
<CharacterSet>Unicode</CharacterSet>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration">
<ConfigurationType>StaticLibrary</ConfigurationType>
<UseDebugLibraries>true</UseDebugLibraries>
<PlatformToolset>v143</PlatformToolset>
<CharacterSet>Unicode</CharacterSet>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='DebugTest|x64'" Label="Configuration">
<ConfigurationType>StaticLibrary</ConfigurationType>
<UseDebugLibraries>true</UseDebugLibraries>
<PlatformToolset>v143</PlatformToolset>
<CharacterSet>Unicode</CharacterSet>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">
<ConfigurationType>StaticLibrary</ConfigurationType>
<UseDebugLibraries>false</UseDebugLibraries>
<PlatformToolset>v143</PlatformToolset>
<WholeProgramOptimization>true</WholeProgramOptimization>
<CharacterSet>Unicode</CharacterSet>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='ReleaseTest|x64'" Label="Configuration">
<ConfigurationType>StaticLibrary</ConfigurationType>
<UseDebugLibraries>false</UseDebugLibraries>
<PlatformToolset>v143</PlatformToolset>
<WholeProgramOptimization>true</WholeProgramOptimization>
<CharacterSet>Unicode</CharacterSet>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
<ImportGroup Label="ExtensionSettings">
</ImportGroup>
Expand All @@ -117,18 +159,34 @@
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
<Import Project="common.props" />
</ImportGroup>
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='DebugTest|Win32'" Label="PropertySheets">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
<Import Project="common.props" />
</ImportGroup>
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
<Import Project="common.props" />
</ImportGroup>
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='ReleaseTest|Win32'" Label="PropertySheets">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
<Import Project="common.props" />
</ImportGroup>
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
<Import Project="common.props" />
</ImportGroup>
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='DebugTest|x64'" Label="PropertySheets">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
<Import Project="common.props" />
</ImportGroup>
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
<Import Project="common.props" />
</ImportGroup>
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='ReleaseTest|x64'" Label="PropertySheets">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
<Import Project="common.props" />
</ImportGroup>
<PropertyGroup Label="UserMacros" />
<PropertyGroup />
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
Expand All @@ -137,12 +195,30 @@
<PreprocessorDefinitions>ASMJIT_STATIC;%(PreprocessorDefinitions)</PreprocessorDefinitions>
</ClCompile>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='DebugTest|Win32'">
<ClCompile>
<Optimization>Disabled</Optimization>
<PreprocessorDefinitions>ASMJIT_STATIC;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<RuntimeLibrary>MultiThreadedDebug</RuntimeLibrary>
<LanguageStandard>stdcpp14</LanguageStandard>
<BasicRuntimeChecks>Default</BasicRuntimeChecks>
</ClCompile>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
<ClCompile>
<Optimization>Disabled</Optimization>
<PreprocessorDefinitions>ASMJIT_STATIC;%(PreprocessorDefinitions)</PreprocessorDefinitions>
</ClCompile>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='DebugTest|x64'">
<ClCompile>
<Optimization>Disabled</Optimization>
<PreprocessorDefinitions>ASMJIT_STATIC;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<RuntimeLibrary>MultiThreadedDebug</RuntimeLibrary>
<LanguageStandard>stdcpp14</LanguageStandard>
<BasicRuntimeChecks>Default</BasicRuntimeChecks>
</ClCompile>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
<ClCompile>
<Optimization>MaxSpeed</Optimization>
Expand All @@ -155,6 +231,18 @@
<OptimizeReferences>true</OptimizeReferences>
</Link>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='ReleaseTest|Win32'">
<ClCompile>
<Optimization>MaxSpeed</Optimization>
<FunctionLevelLinking>true</FunctionLevelLinking>
<IntrinsicFunctions>true</IntrinsicFunctions>
<PreprocessorDefinitions>ASMJIT_STATIC;%(PreprocessorDefinitions)</PreprocessorDefinitions>
</ClCompile>
<Link>
<EnableCOMDATFolding>true</EnableCOMDATFolding>
<OptimizeReferences>true</OptimizeReferences>
</Link>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
<ClCompile>
<Optimization>MaxSpeed</Optimization>
Expand All @@ -167,6 +255,18 @@
<OptimizeReferences>true</OptimizeReferences>
</Link>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='ReleaseTest|x64'">
<ClCompile>
<Optimization>MaxSpeed</Optimization>
<FunctionLevelLinking>true</FunctionLevelLinking>
<IntrinsicFunctions>true</IntrinsicFunctions>
<PreprocessorDefinitions>ASMJIT_STATIC;%(PreprocessorDefinitions)</PreprocessorDefinitions>
</ClCompile>
<Link>
<EnableCOMDATFolding>true</EnableCOMDATFolding>
<OptimizeReferences>true</OptimizeReferences>
</Link>
</ItemDefinitionGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
<ImportGroup Label="ExtensionTargets">
</ImportGroup>
Expand Down
Loading