Skip to content

Commit

Permalink
Fea #52, 添加Developer PowerShell支持
Browse files Browse the repository at this point in the history
  • Loading branch information
yzytom authored and mingkuang-Chuyu committed Sep 7, 2023
1 parent d2dcef6 commit f3acb32
Show file tree
Hide file tree
Showing 16 changed files with 863 additions and 211 deletions.
17 changes: 15 additions & 2 deletions Readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ If you need to use the heap debugging, please disable VC-LTL.
| -------------- | --
| Visual Studio | NuGet or [VC-LTL helper for Visual Studio.props](#31-using-vc-ltl-in-visual-studio)
| CMake | [VC-LTL helper for cmake.cmake](#32-using-vc-ltl-in-cmake)
| NMake, CL | [VC-LTL helper for nmake.cmd](#33-using-vc-ltl-in-nmakecl)
| NMake, CL | [VC-LTL helper for nmake.cmd/VC-LTL helper for nmake.ps1](#33-using-vc-ltl-in-nmakecl)
| QMake | VC-LTL helper for qmake.pri
| Rust | crate

Expand Down Expand Up @@ -167,13 +167,26 @@ If you download and unzip [VC-LTL Binary](https://github.com/Chuyu-Team/VC-LTL5/
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.

**Example:**
**Example: cmd**
```
call "C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\VC\Auxiliary\Build\vcvars32.bat"
call "D:\VC-LTL\VC-LTL helper for nmake.cmd"
nmake /f Test.mak
```

**Example: powershell**
```
$BuiltInVsWhereExe = "${env:ProgramFiles(x86)}\Microsoft Visual Studio\Installer\vswhere.exe"
$LatestVisualStudioRoot = & $BuiltInVsWhereExe -latest -prerelease -property installationPath
# x86、amd64、arm、arm64
& "$LatestVisualStudioRoot\Common7\Tools\Launch-VsDevShell.ps1" -arch x86
& D:\VC-LTL\VC-LTL helper for nmake.ps1"
& nmake /f Test.mak
```

#### 3.3.2. Modify The Configuration

> It's recommended to use `/MT` to compile the project when using VC-LTL.
Expand Down
16 changes: 14 additions & 2 deletions Readme.osc.md
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ VC-LTL 5.0开始,ABI与微软原版`兼容`,您可以直接使用现有的
| -------------- | --
| Visual Studio | NuGet 或者 [VC-LTL helper for Visual Studio.props](#31-在visual-studio中使用vc-ltl)
| CMake | [VC-LTL helper for cmake.cmake](#32-在cmake中使用vc-ltl)
| NMake、CL | [VC-LTL helper for nmake.cmd](#33-在nmake纯cl中使用vc-ltl)
| NMake、CL | [VC-LTL helper for nmake.cmd/VC-LTL helper for nmake.ps1](#33-在nmake纯cl中使用vc-ltl)
| QMake | VC-LTL helper for qmake.pri
| Rust | crate

Expand Down Expand Up @@ -158,13 +158,25 @@ add_subdirectory(src)

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

**示例:**
**CMD 示例:**
```
call "C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\VC\Auxiliary\Build\vcvars32.bat"
call "D:\VC-LTL\VC-LTL helper for nmake.cmd"
nmake /f Test.mak
```

**powershell 示例:**
```
$BuiltInVsWhereExe = "${env:ProgramFiles(x86)}\Microsoft Visual Studio\Installer\vswhere.exe"
$LatestVisualStudioRoot = & $BuiltInVsWhereExe -latest -prerelease -property installationPath
# x86、amd64、arm、arm64
& "$LatestVisualStudioRoot\Common7\Tools\Launch-VsDevShell.ps1" -arch x86
& D:\VC-LTL\VC-LTL helper for nmake.ps1"
& nmake /f Test.mak
```
#### 3.3.2. 配置工程属性

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

0 comments on commit f3acb32

Please sign in to comment.