支持 Visual Studio 2026 (#1343)

* chore: 支持 VS2026

* docs: 更新文档以及排除 pdb

* chore: 修复 pdb 生成

* chore: 禁止 Magpie.Core 生成 pdb

* chore: 清理
This commit is contained in:
Xu 2025-11-27 21:57:38 +08:00 committed by GitHub
commit 6fc3594d9d
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
21 changed files with 77 additions and 156 deletions

View file

@ -2,9 +2,9 @@ name: build
on:
push:
paths: [ '.github/workflows/build.yml', 'Magpie.sln', '*.props', 'scripts/publish.py', 'src/**' ]
paths: [ '.github/workflows/build.yml', 'Magpie.slnx', '*.props', 'scripts/publish.py', 'src/**' ]
pull_request:
paths: [ '.github/workflows/build.yml', 'Magpie.sln', '*.props', 'scripts/publish.py', 'src/**' ]
paths: [ '.github/workflows/build.yml', 'Magpie.slnx', '*.props', 'scripts/publish.py', 'src/**' ]
jobs:
build:
@ -19,7 +19,7 @@ jobs:
- uses: actions/setup-python@v6
with:
python-version: '3.11'
python-version: '3.13'
- name: Setup Conan
run: pip install conan

View file

@ -36,7 +36,7 @@ jobs:
- uses: actions/setup-python@v6
with:
python-version: '3.11'
python-version: '3.13'
- name: Setup Conan
run: pip install conan
@ -63,7 +63,7 @@ jobs:
- uses: actions/setup-python@v6
with:
python-version: '3.11'
python-version: '3.13'
- name: Setup Requests
run: pip install requests

View file

@ -14,7 +14,7 @@ jobs:
- uses: actions/setup-python@v6
with:
python-version: '3.11'
python-version: '3.13'
- name: Upload documentations to wiki
run: python scripts/wiki.py ${{ secrets.CONTENTS_ACCESS_TOKEN }}

View file

@ -1,118 +0,0 @@

Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio Version 17
VisualStudioVersion = 17.1.32228.430
MinimumVisualStudioVersion = 10.0.40219.1
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Magpie", "src\Magpie\Magpie.vcxproj", "{1239537C-E5B8-427A-9E7F-EA443D1F3529}"
ProjectSection(ProjectDependencies) = postProject
{05B51BB8-08CB-4907-884F-8E2AD6BF6052} = {05B51BB8-08CB-4907-884F-8E2AD6BF6052}
{456CCAE4-2C51-4CF2-8D3A-1EFCE8C41A2D} = {456CCAE4-2C51-4CF2-8D3A-1EFCE8C41A2D}
{62503530-B84B-4CC2-80B6-3F89618172B7} = {62503530-B84B-4CC2-80B6-3F89618172B7}
{E82B7A20-0557-4DC1-B418-87977D7450A4} = {E82B7A20-0557-4DC1-B418-87977D7450A4}
EndProjectSection
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution Items", "{00AB63C3-0CD3-4944-B8E6-58C86138618D}"
ProjectSection(SolutionItems) = preProject
src\BuildOptions.props = src\BuildOptions.props
src\Common.Post.props = src\Common.Post.props
src\Common.Pre.props = src\Common.Pre.props
Directory.Build.props = Directory.Build.props
src\HybridCRT.props = src\HybridCRT.props
src\WinUI.targets = src\WinUI.targets
EndProjectSection
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "_ConanDeps", "src\_ConanDeps\_ConanDeps.vcxproj", "{456CCAE4-2C51-4CF2-8D3A-1EFCE8C41A2D}"
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Effects", "src\Effects\Effects.vcxproj", "{62503530-B84B-4CC2-80B6-3F89618172B7}"
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Magpie.Core", "src\Magpie.Core\Magpie.Core.vcxproj", "{0E5205AE-DFA9-4CB8-B662-E43CD6512E2A}"
ProjectSection(ProjectDependencies) = postProject
{456CCAE4-2C51-4CF2-8D3A-1EFCE8C41A2D} = {456CCAE4-2C51-4CF2-8D3A-1EFCE8C41A2D}
EndProjectSection
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Natvis", "Natvis", "{9808D34F-5715-4D02-B216-4CB80F46BBC0}"
ProjectSection(SolutionItems) = preProject
natvis\magpie.natvis = natvis\magpie.natvis
natvis\phmap.natvis = natvis\phmap.natvis
natvis\rapidjson.natvis = natvis\rapidjson.natvis
EndProjectSection
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Updater", "src\Updater\Updater.vcxproj", "{E82B7A20-0557-4DC1-B418-87977D7450A4}"
ProjectSection(ProjectDependencies) = postProject
{456CCAE4-2C51-4CF2-8D3A-1EFCE8C41A2D} = {456CCAE4-2C51-4CF2-8D3A-1EFCE8C41A2D}
EndProjectSection
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "TouchHelper", "src\TouchHelper\TouchHelper.vcxproj", "{05B51BB8-08CB-4907-884F-8E2AD6BF6052}"
ProjectSection(ProjectDependencies) = postProject
{456CCAE4-2C51-4CF2-8D3A-1EFCE8C41A2D} = {456CCAE4-2C51-4CF2-8D3A-1EFCE8C41A2D}
EndProjectSection
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Shared", "src\Shared\Shared.vcxitems", "{AABDA3A3-7B23-4189-895B-F68A4C6B14C2}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|ARM64 = Debug|ARM64
Debug|x64 = Debug|x64
Release|ARM64 = Release|ARM64
Release|x64 = Release|x64
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{1239537C-E5B8-427A-9E7F-EA443D1F3529}.Debug|ARM64.ActiveCfg = Debug|ARM64
{1239537C-E5B8-427A-9E7F-EA443D1F3529}.Debug|ARM64.Build.0 = Debug|ARM64
{1239537C-E5B8-427A-9E7F-EA443D1F3529}.Debug|x64.ActiveCfg = Debug|x64
{1239537C-E5B8-427A-9E7F-EA443D1F3529}.Debug|x64.Build.0 = Debug|x64
{1239537C-E5B8-427A-9E7F-EA443D1F3529}.Release|ARM64.ActiveCfg = Release|ARM64
{1239537C-E5B8-427A-9E7F-EA443D1F3529}.Release|ARM64.Build.0 = Release|ARM64
{1239537C-E5B8-427A-9E7F-EA443D1F3529}.Release|x64.ActiveCfg = Release|x64
{1239537C-E5B8-427A-9E7F-EA443D1F3529}.Release|x64.Build.0 = Release|x64
{456CCAE4-2C51-4CF2-8D3A-1EFCE8C41A2D}.Debug|ARM64.ActiveCfg = Debug|ARM64
{456CCAE4-2C51-4CF2-8D3A-1EFCE8C41A2D}.Debug|ARM64.Build.0 = Debug|ARM64
{456CCAE4-2C51-4CF2-8D3A-1EFCE8C41A2D}.Debug|x64.ActiveCfg = Debug|x64
{456CCAE4-2C51-4CF2-8D3A-1EFCE8C41A2D}.Debug|x64.Build.0 = Debug|x64
{456CCAE4-2C51-4CF2-8D3A-1EFCE8C41A2D}.Release|ARM64.ActiveCfg = Release|ARM64
{456CCAE4-2C51-4CF2-8D3A-1EFCE8C41A2D}.Release|ARM64.Build.0 = Release|ARM64
{456CCAE4-2C51-4CF2-8D3A-1EFCE8C41A2D}.Release|x64.ActiveCfg = Release|x64
{456CCAE4-2C51-4CF2-8D3A-1EFCE8C41A2D}.Release|x64.Build.0 = Release|x64
{62503530-B84B-4CC2-80B6-3F89618172B7}.Debug|ARM64.ActiveCfg = Debug|ARM64
{62503530-B84B-4CC2-80B6-3F89618172B7}.Debug|ARM64.Build.0 = Debug|ARM64
{62503530-B84B-4CC2-80B6-3F89618172B7}.Debug|x64.ActiveCfg = Debug|x64
{62503530-B84B-4CC2-80B6-3F89618172B7}.Debug|x64.Build.0 = Debug|x64
{62503530-B84B-4CC2-80B6-3F89618172B7}.Release|ARM64.ActiveCfg = Release|ARM64
{62503530-B84B-4CC2-80B6-3F89618172B7}.Release|ARM64.Build.0 = Release|ARM64
{62503530-B84B-4CC2-80B6-3F89618172B7}.Release|x64.ActiveCfg = Release|x64
{62503530-B84B-4CC2-80B6-3F89618172B7}.Release|x64.Build.0 = Release|x64
{0E5205AE-DFA9-4CB8-B662-E43CD6512E2A}.Debug|ARM64.ActiveCfg = Debug|ARM64
{0E5205AE-DFA9-4CB8-B662-E43CD6512E2A}.Debug|ARM64.Build.0 = Debug|ARM64
{0E5205AE-DFA9-4CB8-B662-E43CD6512E2A}.Debug|x64.ActiveCfg = Debug|x64
{0E5205AE-DFA9-4CB8-B662-E43CD6512E2A}.Debug|x64.Build.0 = Debug|x64
{0E5205AE-DFA9-4CB8-B662-E43CD6512E2A}.Release|ARM64.ActiveCfg = Release|ARM64
{0E5205AE-DFA9-4CB8-B662-E43CD6512E2A}.Release|ARM64.Build.0 = Release|ARM64
{0E5205AE-DFA9-4CB8-B662-E43CD6512E2A}.Release|x64.ActiveCfg = Release|x64
{0E5205AE-DFA9-4CB8-B662-E43CD6512E2A}.Release|x64.Build.0 = Release|x64
{E82B7A20-0557-4DC1-B418-87977D7450A4}.Debug|ARM64.ActiveCfg = Debug|ARM64
{E82B7A20-0557-4DC1-B418-87977D7450A4}.Debug|ARM64.Build.0 = Debug|ARM64
{E82B7A20-0557-4DC1-B418-87977D7450A4}.Debug|x64.ActiveCfg = Debug|x64
{E82B7A20-0557-4DC1-B418-87977D7450A4}.Debug|x64.Build.0 = Debug|x64
{E82B7A20-0557-4DC1-B418-87977D7450A4}.Release|ARM64.ActiveCfg = Release|ARM64
{E82B7A20-0557-4DC1-B418-87977D7450A4}.Release|ARM64.Build.0 = Release|ARM64
{E82B7A20-0557-4DC1-B418-87977D7450A4}.Release|x64.ActiveCfg = Release|x64
{E82B7A20-0557-4DC1-B418-87977D7450A4}.Release|x64.Build.0 = Release|x64
{05B51BB8-08CB-4907-884F-8E2AD6BF6052}.Debug|ARM64.ActiveCfg = Debug|ARM64
{05B51BB8-08CB-4907-884F-8E2AD6BF6052}.Debug|ARM64.Build.0 = Debug|ARM64
{05B51BB8-08CB-4907-884F-8E2AD6BF6052}.Debug|x64.ActiveCfg = Debug|x64
{05B51BB8-08CB-4907-884F-8E2AD6BF6052}.Debug|x64.Build.0 = Debug|x64
{05B51BB8-08CB-4907-884F-8E2AD6BF6052}.Release|ARM64.ActiveCfg = Release|ARM64
{05B51BB8-08CB-4907-884F-8E2AD6BF6052}.Release|ARM64.Build.0 = Release|ARM64
{05B51BB8-08CB-4907-884F-8E2AD6BF6052}.Release|x64.ActiveCfg = Release|x64
{05B51BB8-08CB-4907-884F-8E2AD6BF6052}.Release|x64.Build.0 = Release|x64
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
GlobalSection(NestedProjects) = preSolution
{9808D34F-5715-4D02-B216-4CB80F46BBC0} = {00AB63C3-0CD3-4944-B8E6-58C86138618D}
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {0114F74A-3B0C-43A4-AA0E-AB36FD4935F8}
EndGlobalSection
EndGlobal

37
Magpie.slnx Normal file
View file

@ -0,0 +1,37 @@
<Solution>
<Configurations>
<Platform Name="ARM64" />
<Platform Name="x64" />
</Configurations>
<Folder Name="/Solution Items/">
<File Path="Directory.Build.props" />
<File Path="src/BuildOptions.props" />
<File Path="src/Common.Post.props" />
<File Path="src/Common.Pre.props" />
<File Path="src/HybridCRT.props" />
<File Path="src/WinUI.targets" />
</Folder>
<Folder Name="/Solution Items/Natvis/">
<File Path="natvis/magpie.natvis" />
<File Path="natvis/phmap.natvis" />
<File Path="natvis/rapidjson.natvis" />
</Folder>
<Project Path="src/Effects/Effects.vcxproj" Id="62503530-b84b-4cc2-80b6-3f89618172b7" />
<Project Path="src/Magpie.Core/Magpie.Core.vcxproj" Id="0e5205ae-dfa9-4cb8-b662-e43cd6512e2a">
<BuildDependency Project="src/_ConanDeps/_ConanDeps.vcxproj" />
</Project>
<Project Path="src/Magpie/Magpie.vcxproj" Id="1239537c-e5b8-427a-9e7f-ea443d1f3529">
<BuildDependency Project="src/Effects/Effects.vcxproj" />
<BuildDependency Project="src/TouchHelper/TouchHelper.vcxproj" />
<BuildDependency Project="src/Updater/Updater.vcxproj" />
<BuildDependency Project="src/_ConanDeps/_ConanDeps.vcxproj" />
</Project>
<Project Path="src/Shared/Shared.vcxitems" Id="aabda3a3-7b23-4189-895b-f68a4c6b14c2" />
<Project Path="src/TouchHelper/TouchHelper.vcxproj" Id="05b51bb8-08cb-4907-884f-8e2ad6bf6052">
<BuildDependency Project="src/_ConanDeps/_ConanDeps.vcxproj" />
</Project>
<Project Path="src/Updater/Updater.vcxproj" Id="e82b7a20-0557-4dc1-b418-87977d7450a4">
<BuildDependency Project="src/_ConanDeps/_ConanDeps.vcxproj" />
</Project>
<Project Path="src/_ConanDeps/_ConanDeps.vcxproj" Id="456ccae4-2c51-4cf2-8d3a-1efce8c41a2d" />
</Solution>

View file

@ -2,7 +2,7 @@
In order to compile Magpie, you need to first install:
1. The latest version of Visual Studio 2022. You need to install both "Desktop development with C++" and "Universal Windows Platform development" workloads and Windows SDK build 26100 or newer.
1. The latest version of Visual Studio 2022 or 2026. You need to install both "Desktop development with C++" and "Universal Windows Platform development" workloads and Windows SDK build 26100 or newer.
2. [CMake](https://cmake.org/)
You can also use the built-in CMake of Visual Studio, which is located at `%ProgramFiles%\Microsoft Visual Studio\2022\Community\Common7\IDE\CommonExtensions\Microsoft\CMake\CMake\bin`.
@ -28,7 +28,7 @@ In order to compile Magpie, you need to first install:
git clone https://github.com/Blinue/Magpie
```
2. Open the Magpie.sln in the root directory and build the solution.
2. Open the Magpie.slnx in the root directory and build the solution.
### Enabling Touch Support

View file

@ -2,7 +2,7 @@
为了编译 Magpie你首先需要安装
1. Visual Studio 2022 的最新版本,需要安装“使用 C++ 的桌面开发”和“通用 Windows 平台开发”两个工作负荷以及 Windows SDK build 26100 或更高版本。
1. Visual Studio 2022 或 2026 的最新版本,需要安装“使用 C++ 的桌面开发”和“通用 Windows 平台开发”两个工作负荷以及 Windows SDK build 26100 或更高版本。
2. [CMake](https://cmake.org/)
你也可以使用 Visual Studio 内置的 CMake它位于 `%ProgramFiles%\Microsoft Visual Studio\2022\Community\Common7\IDE\CommonExtensions\Microsoft\CMake\CMake\bin`
@ -28,7 +28,7 @@
git clone https://github.com/Blinue/Magpie
```
2. 打开根目录的 Magpie.sln 然后生成解决方案。
2. 打开根目录的 Magpie.slnx 然后生成解决方案。
## 启用触控支持

View file

@ -94,7 +94,7 @@ if args.version_major != 0 or args.version_minor != 0 or args.version_patch != 0
versionTagProp = "" if args.version_tag == "" else f";VersionTag={args.version_tag}"
p = subprocess.run(
f'"{msbuildPath}" Magpie.sln -m -t:Rebuild -restore -p:RestorePackagesConfig=true;Configuration=Release;Platform={args.platform};UseClangCL={args.compiler == "ClangCL"};UseNativeMicroArch={args.use_native_march};OutDir={os.getcwd()}\\publish\\{args.platform}\\;CommitId={commitId}{versionNumProps}{versionTagProp}'
f'"{msbuildPath}" Magpie.slnx -m -t:Rebuild -restore -p:RestorePackagesConfig=true;Configuration=Release;Platform={args.platform};DisablePDB=true;UseClangCL={args.compiler == "ClangCL"};UseNativeMicroArch={args.use_native_march};OutDir={os.getcwd()}\\publish\\{args.platform}\\;CommitId={commitId}{versionNumProps}{versionTagProp}'
)
if p.returncode != 0:
raise Exception("编译失败")
@ -116,9 +116,8 @@ def remove_file(file):
pass
for pattern in ["*.pdb", "*.lib", "*.exp"]:
for file in glob.glob(pattern):
remove_file(file)
for file in glob.glob("*.lib"):
remove_file(file)
print("清理完毕", flush=True)

View file

@ -12,6 +12,7 @@
<PreprocessorDefinitions Condition="$(DebugBorder)">MP_DEBUG_BORDER;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<PreprocessorDefinitions Condition="$(DebugInfoOnOverlay)">MP_DEBUG_INFO_ON_OVERLAY;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<PreprocessorDefinitions Condition="$(UseCompSwapchain)">MP_USE_COMPSWAPCHAIN;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<DebugInformationFormat Condition="'$(DisablePDB)' == 'true'">None</DebugInformationFormat>
<AdditionalOptions>/bigobj %(AdditionalOptions)</AdditionalOptions>
<!-- /await:strict: 禁用协程的非标准语言扩展 -->
<AdditionalOptions Condition="!$(UseClangCL)">/await:strict %(AdditionalOptions)</AdditionalOptions>
@ -23,9 +24,14 @@
<AdditionalOptions Condition="$(UseClangCL) And '$(Platform)' == 'x64'">/clang:-mcx16 %(AdditionalOptions)</AdditionalOptions>
<!-- -march=native: 针对当前硬件生成优化代码 -->
<AdditionalOptions Condition="$(UseClangCL) And $(UseNativeMicroArch)">/clang:-march=native %(AdditionalOptions)</AdditionalOptions>
<!-- 使用 clang-cl 编译时禁用 cppwinrt 头文件中的编译警告 -->
<AdditionalOptions Condition="$(UseClangCL) And '$(GeneratedFilesDir)' != ''">/clang:-isystem /clang:"$(GeneratedFilesDir)\" %(AdditionalOptions)</AdditionalOptions>
<!-- 修复编译 Shared 中源文件找不到 pch.h 的问题 -->
<AdditionalIncludeDirectories Condition="$(UseClangCL)">.;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
</ClCompile>
<Link>
<GenerateDebugInformation Condition="'$(DisablePDB)' == 'true'">false</GenerateDebugInformation>
</Link>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)' == 'Debug'">

View file

@ -28,7 +28,13 @@
<PropertyGroup Label="Configuration">
<PlatformToolset Condition="$(UseClangCL)">ClangCL</PlatformToolset>
<PlatformToolset Condition="!$(UseClangCL)">v143</PlatformToolset>
<VS17 Condition="$([System.String]::new('$(MSBuildVersion)').StartsWith('17'))">true</VS17>
<VS17 Condition="$(VS17) != 'true'">false</VS17>
<MinimumVisualStudioVersion>17.0</MinimumVisualStudioVersion>
<VCProjectVersion Condition="$(VS17)">17.0</VCProjectVersion>
<VCProjectVersion Condition="!$(VS17)">18.0</VCProjectVersion>
<PlatformToolset Condition="!$(UseClangCL) And $(VS17)">v143</PlatformToolset>
<PlatformToolset Condition="!$(UseClangCL) And !$(VS17)">v145</PlatformToolset>
<UseDebugLibraries Condition="'$(Configuration)' == 'Debug'">true</UseDebugLibraries>
<WholeProgramOptimization Condition="'$(Configuration)' == 'Release'">true</WholeProgramOptimization>
</PropertyGroup>

View file

@ -1,7 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup Label="Globals">
<VCProjectVersion>17.0</VCProjectVersion>
<Keyword>Win32Proj</Keyword>
<ProjectGuid>{62503530-b84b-4cc2-80b6-3f89618172b7}</ProjectGuid>
<WindowsTargetPlatformVersion>10.0.26100.0</WindowsTargetPlatformVersion>

View file

@ -48,11 +48,6 @@ private:
ImGuiBackend _backend;
phmap::flat_hash_map<std::string, ImVec4> _windowRects;
uint32_t _handlerId = 0;
HANDLE _hHookThread = NULL;
DWORD _hookThreadId = 0;
};
}

View file

@ -7,7 +7,6 @@
<CppWinRTRootNamespaceAutoMerge>true</CppWinRTRootNamespaceAutoMerge>
<CppWinRTGenerateWindowsMetadata>false</CppWinRTGenerateWindowsMetadata>
<CppWinRTVerbosity>low</CppWinRTVerbosity>
<VCProjectVersion>17.0</VCProjectVersion>
<Keyword>Win32Proj</Keyword>
<ProjectGuid>{0e5205ae-dfa9-4cb8-b662-e43cd6512e2a}</ProjectGuid>
<WindowsTargetPlatformVersion>10.0.26100.0</WindowsTargetPlatformVersion>

View file

@ -133,7 +133,7 @@ struct Win32Helper {
}
Variant(VARIANT&& varSrc) noexcept {
std::memcpy(this, &varSrc, sizeof(varSrc));
std::memcpy((VARIANT*)this, &varSrc, sizeof(varSrc));
varSrc.vt = VT_EMPTY;
}
@ -166,7 +166,7 @@ struct Win32Helper {
}
Variant& operator=(VARIANT&& other) noexcept {
std::memcpy(this, &other, sizeof(other));
std::memcpy((VARIANT*)this, &other, sizeof(other));
other.vt = VT_EMPTY;
return *this;
}

View file

@ -11,7 +11,6 @@
<MinimalCoreWin>true</MinimalCoreWin>
<ProjectGuid>{1239537c-e5b8-427a-9e7f-ea443d1f3529}</ProjectGuid>
<RootNamespace>$(MSBuildProjectName)</RootNamespace>
<MinimumVisualStudioVersion>17.0</MinimumVisualStudioVersion>
<!-- 为了编译为 exeAppContainerApplication 必须为 false否则虽然可以编译但无法在 VS 中调试。 -->
<!-- 这会导致不会自动生成 pri稍后我们手动导入 Microsoft.AppXPackage.Targets 来解决这个问题。 -->
<AppContainerApplication>false</AppContainerApplication>
@ -39,7 +38,8 @@
<Import Project="..\Common.Pre.props" />
<PropertyGroup Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<PlatformToolset>v143</PlatformToolset>
<PlatformToolset Condition="$(VS17)">v143</PlatformToolset>
<PlatformToolset Condition="!$(VS17)">v145</PlatformToolset>
<CharacterSet>Unicode</CharacterSet>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
@ -84,11 +84,10 @@
<AdditionalIncludeDirectories>..\Magpie.Core\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
</ClCompile>
<ClCompile Condition="$(UseClangCL)">
<!-- 禁用 cppwinrt 生成的头文件中的编译警告 -->
<AdditionalOptions>/clang:-isystem /clang:"$(GeneratedFilesDir)\" $(LlvmArchitectureSwitch) %(AdditionalOptions)</AdditionalOptions>
<AdditionalOptions>$(LlvmArchitectureSwitch) %(AdditionalOptions)</AdditionalOptions>
<!-- clang-cl 不支持 /ZI而且 /Zi 和 /Z7 效果相同。 -->
<!-- Microsoft.Cpp.ClangCl.Common.target 始终使用 OldStyle (/Z7),我们和它保持一致。 -->
<DebugInformationFormat>OldStyle</DebugInformationFormat>
<DebugInformationFormat Condition="'$(DisablePDB)' != 'true'">OldStyle</DebugInformationFormat>
<!-- clang-cl 使用 MultiProcCL 属性实现并行编译 -->
<MultiProcessorCompilation>false</MultiProcessorCompilation>
</ClCompile>

View file

@ -1,7 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup Label="Globals">
<MSBuildAllProjects Condition="'$(MSBuildVersion)' == '' Or '$(MSBuildVersion)' &lt; '16.0'">$(MSBuildAllProjects);$(MSBuildThisFileFullPath)</MSBuildAllProjects>
<HasSharedItems>true</HasSharedItems>
<ItemsProjectGuid>{aabda3a3-7b23-4189-895b-f68a4c6b14c2}</ItemsProjectGuid>
</PropertyGroup>

View file

@ -1,7 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup Label="Globals">
<VCProjectVersion>17.0</VCProjectVersion>
<Keyword>Win32Proj</Keyword>
<ProjectGuid>{05b51bb8-08cb-4907-884f-8e2ad6bf6052}</ProjectGuid>
<WindowsTargetPlatformVersion>10.0.26100.0</WindowsTargetPlatformVersion>

View file

@ -1,7 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup Label="Globals">
<VCProjectVersion>17.0</VCProjectVersion>
<Keyword>Win32Proj</Keyword>
<ProjectGuid>{e82b7a20-0557-4dc1-b418-87977d7450a4}</ProjectGuid>
<WindowsTargetPlatformVersion>10.0.26100.0</WindowsTargetPlatformVersion>

View file

@ -1,7 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup Label="Globals">
<VCProjectVersion>17.0</VCProjectVersion>
<Keyword>Win32Proj</Keyword>
<ProjectGuid>{456ccae4-2c51-4cf2-8d3a-1efce8c41a2d}</ProjectGuid>
<WindowsTargetPlatformVersion>10.0.26100.0</WindowsTargetPlatformVersion>
@ -110,9 +109,12 @@ ConanFile = conanFiles.ToArray();
<AdditionalFlags Condition="$(UseClangCL) And '$(Platform)' == 'x64'">$(AdditionalFlags),'/clang:-mcx16'</AdditionalFlags>
<AdditionalFlags Condition="$(UseClangCL) And $(UseNativeMicroArch)">$(AdditionalFlags),'/clang:-march=native'</AdditionalFlags>
<AdditionalFlags Condition="!$(UseClangCL) And '$(Configuration)' == 'Release'">$(AdditionalFlags),'/GL'</AdditionalFlags>
<FlagOptions Condition="'$(AdditionalFlags)' != ''">-c:a tools.build:cxxflags=[$(AdditionalFlags)] -c:a tools.build:cflags=[$(AdditionalFlags)]</FlagOptions>
<AdditionalOptions Condition="'$(AdditionalFlags)' != ''">-c:a tools.build:cxxflags=[$(AdditionalFlags)] -c:a tools.build:cflags=[$(AdditionalFlags)]</AdditionalOptions>
<!-- profile 面向 VS2026VS2022 上应更改编译器版本 -->
<AdditionalOptions Condition="$(VS17) And $(UseClangCL)">-s:a compiler.version=19 -c:a &quot;tools.cmake.cmaketoolchain:generator=Visual Studio 17&quot; $(AdditionalOptions)</AdditionalOptions>
<AdditionalOptions Condition="$(VS17) And !$(UseClangCL)">-s:a compiler.version=194 $(AdditionalOptions)</AdditionalOptions>
</PropertyGroup>
<!-- 批量处理 ConanFile 中的元素 -->
<Exec Condition="'@(ConanFile)' != ''" Command="conan install &quot;%(ConanFile.FullPath)&quot; -pr:a=$(ProfileName) --output-folder $(IntDir)%(ConanFile.ProjectName) -s build_type=$(Configuration) -s arch=$(ConanInstallArch) $(FlagOptions) --build=missing --update" />
<Exec Condition="'@(ConanFile)' != ''" Command="conan install &quot;%(ConanFile.FullPath)&quot; -pr:a=$(ProfileName) --output-folder $(IntDir)%(ConanFile.ProjectName) -s:a build_type=$(Configuration) -s:a arch=$(ConanInstallArch) $(AdditionalOptions) --build=missing --update" />
</Target>
</Project>

View file

@ -1,10 +1,10 @@
[settings]
os=Windows
compiler=clang
compiler.version=19
compiler.version=20
compiler.runtime=static
compiler.cppstd=gnu17
[conf]
tools.cmake.cmaketoolchain:generator=Visual Studio 17
tools.cmake.cmaketoolchain:generator=Visual Studio 18
tools.info.package_id:confs=["tools.build:cxxflags"]

View file

@ -1,7 +1,7 @@
[settings]
os=Windows
compiler=msvc
compiler.version=194
compiler.version=195
compiler.runtime=static
compiler.cppstd=17