Skip to content
This repository has been archived by the owner on Jan 7, 2020. It is now read-only.

Commit

Permalink
Support MSVC v141 and v142 simultaneously
Browse files Browse the repository at this point in the history
  • Loading branch information
stdrc committed May 11, 2019
1 parent 88ba613 commit 846887d
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion .appveyor.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ branches:
- /dev.*/ # do not build dev branch

image:
- Visual Studio 2019 Preview
- Visual Studio 2017

platform:
- x86
Expand Down
5 changes: 3 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ CQ_MAIN {

在开始使用之前,请确保你已经安装了 Git,且 `PATH` 中存在 `git` 命令。不需要安装 vcpkg,后面的脚本中会自动安装。

然后确保安装了 **Visual Studio 2019**,并勾选「使用 C++ 的桌面开发」,确保安装了 CMake、**MSVC v142****Windows 10 SDK** 这三个组件。其中,如果系统中已经安装了 CMake,无需再在 VS Installer 中安装,但需要确保命令已添加进 `PATH`。除此之外,vcpkg 还要求安装 VS 2019**英文语言包**
然后确保安装了 **Visual Studio 2017 或 2019**,并勾选「使用 C++ 的桌面开发」,确保安装了 CMake、**MSVC v141 或 v142****Windows 10 SDK** 这三个组件。其中,如果系统中已经安装了 CMake,无需再在 VS Installer 中安装,但需要确保命令已添加进 `PATH`。除此之外,vcpkg 还要求安装 VS 的**英文语言包**

### 下载 SDK

Expand Down Expand Up @@ -118,7 +118,7 @@ powershell .\scripts\generate.ps1 Debug
powershell .\scripts\build.ps1 Debug
```

上面两条命令分别生成 build 目录和构建项目,将 `Debug` 改为 `Release` 可以构建 release 版本。如果安装了 CMake 还没支持的较新版本 VS,需要先手动进入 VS 2019 的 Developer Command Prompt,再执行上面的命令。
上面两条命令分别生成 build 目录和构建项目,将 `Debug` 改为 `Release` 可以构建 release 版本。如果安装了 CMake 还没支持的较新版本 VS,需要先手动进入 VS 2017 或 2019 的 Developer Command Prompt,再执行上面的命令。

如果你使用 VS Code,可以直接运行 task;如果使用 VS,可以直接选择菜单 CMake - 全部生成。

Expand All @@ -143,6 +143,7 @@ $jsonPath = "$appOutDir\$jsonName"
Write-Host "正在拷贝插件到 酷Q 应用文件夹……"
New-Item -Path $coolqAppDevDir -ItemType Directory -ErrorAction SilentlyContinue
Copy-Item -Force $dllPath "$coolqAppDevDir\$dllName"
Copy-Item -Force $jsonPath "$coolqAppDevDir\$jsonName"
Expand Down
1 change: 0 additions & 1 deletion cmake/x86-windows-static-custom.cmake
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
set(VCPKG_TARGET_ARCHITECTURE x86)
set(VCPKG_CRT_LINKAGE dynamic)
set(VCPKG_LIBRARY_LINKAGE static)
set(VCPKG_PLATFORM_TOOLSET v142)

if (PORT MATCHES "^libiconv$")
set(VCPKG_LIBRARY_LINKAGE dynamic)
Expand Down
Binary file modified scripts/generate.ps1
Binary file not shown.

0 comments on commit 846887d

Please sign in to comment.