Skip to content

Commit f3acb32

Browse files
yzytommingkuang-Chuyu
authored andcommitted
Fea #52, 添加Developer PowerShell支持
1 parent d2dcef6 commit f3acb32

16 files changed

+863
-211
lines changed

Readme.md

+15-2
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@ If you need to use the heap debugging, please disable VC-LTL.
8383
| -------------- | --
8484
| Visual Studio | NuGet or [VC-LTL helper for Visual Studio.props](#31-using-vc-ltl-in-visual-studio)
8585
| CMake | [VC-LTL helper for cmake.cmake](#32-using-vc-ltl-in-cmake)
86-
| NMake, CL | [VC-LTL helper for nmake.cmd](#33-using-vc-ltl-in-nmakecl)
86+
| NMake, CL | [VC-LTL helper for nmake.cmd/VC-LTL helper for nmake.ps1](#33-using-vc-ltl-in-nmakecl)
8787
| QMake | VC-LTL helper for qmake.pri
8888
| Rust | crate
8989

@@ -167,13 +167,26 @@ If you download and unzip [VC-LTL Binary](https://github.com/Chuyu-Team/VC-LTL5/
167167
168168
Copy `VC-LTL helper for nmake.cmd` to your project. Run `vcvars32.bat` or `vcvars64.bat` and execute this script. The script will automatically modify the `include` and `lib` environment variables.
169169

170-
**Example:**
170+
**Example: cmd**
171171
```
172172
call "C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\VC\Auxiliary\Build\vcvars32.bat"
173173
call "D:\VC-LTL\VC-LTL helper for nmake.cmd"
174174
175175
nmake /f Test.mak
176176
```
177+
178+
**Example: powershell**
179+
```
180+
$BuiltInVsWhereExe = "${env:ProgramFiles(x86)}\Microsoft Visual Studio\Installer\vswhere.exe"
181+
$LatestVisualStudioRoot = & $BuiltInVsWhereExe -latest -prerelease -property installationPath
182+
183+
# x86、amd64、arm、arm64
184+
& "$LatestVisualStudioRoot\Common7\Tools\Launch-VsDevShell.ps1" -arch x86
185+
& D:\VC-LTL\VC-LTL helper for nmake.ps1"
186+
187+
& nmake /f Test.mak
188+
```
189+
177190
#### 3.3.2. Modify The Configuration
178191

179192
> It's recommended to use `/MT` to compile the project when using VC-LTL.

Readme.osc.md

+14-2
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@ VC-LTL 5.0开始,ABI与微软原版`兼容`,您可以直接使用现有的
7575
| -------------- | --
7676
| Visual Studio | NuGet 或者 [VC-LTL helper for Visual Studio.props](#31-在visual-studio中使用vc-ltl)
7777
| CMake | [VC-LTL helper for cmake.cmake](#32-在cmake中使用vc-ltl)
78-
| NMake、CL | [VC-LTL helper for nmake.cmd](#33-在nmake纯cl中使用vc-ltl)
78+
| NMake、CL | [VC-LTL helper for nmake.cmd/VC-LTL helper for nmake.ps1](#33-在nmake纯cl中使用vc-ltl)
7979
| QMake | VC-LTL helper for qmake.pri
8080
| Rust | crate
8181

@@ -158,13 +158,25 @@ add_subdirectory(src)
158158

159159
将辅助脚本`VC-LTL helper for nmake.cmd`复制到你的工程目录。启动`vcvars32.bat/vcvars64.bat`执行此脚本即可,脚本将自动修改`include`以及`lib`环境变量。
160160

161-
**示例:**
161+
**CMD 示例:**
162162
```
163163
call "C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\VC\Auxiliary\Build\vcvars32.bat"
164164
call "D:\VC-LTL\VC-LTL helper for nmake.cmd"
165165
166166
nmake /f Test.mak
167167
```
168+
169+
**powershell 示例:**
170+
```
171+
$BuiltInVsWhereExe = "${env:ProgramFiles(x86)}\Microsoft Visual Studio\Installer\vswhere.exe"
172+
$LatestVisualStudioRoot = & $BuiltInVsWhereExe -latest -prerelease -property installationPath
173+
174+
# x86、amd64、arm、arm64
175+
& "$LatestVisualStudioRoot\Common7\Tools\Launch-VsDevShell.ps1" -arch x86
176+
& D:\VC-LTL\VC-LTL helper for nmake.ps1"
177+
178+
& nmake /f Test.mak
179+
```
168180
#### 3.3.2. 配置工程属性
169181

170182
> 建议使用`/MT`编译代码。如需支持XP,请修改`VC-LTL helper for nmake.cmd`启用 `set WindowsTargetPlatformMinVersion=5.1.2600.0`,除此之外建议您安装YY-Thunks。

0 commit comments

Comments
 (0)