📝 add doc about how to build on windows

This commit is contained in:
ValKmjolnir
2024-12-26 23:19:34 +08:00
parent 985dee8001
commit 260f0cb5a3
5 changed files with 48 additions and 14 deletions

View File

@@ -81,6 +81,7 @@ Windows 平台的预览版解释器现在还没配置相关流水线,
### __Windows 平台 (Vistual Studio)__
项目提供了 [__CMakeLists.txt__](../CMakeLists.txt) 用于在`Visual Studio`中创建项目。
最近我们总结了命令行编译的方法 [__如何在 Windows 平台编译 Nasal-Interpreter__](./windows-build.md)。
### __Linux / macOS / Unix 平台__

27
doc/windows-build.md Normal file
View File

@@ -0,0 +1,27 @@
# Build Nasal-Interpreter on Windows
## MSVC / Visual Studio
Need CMake and Visual Studio 2022. Remember to add MSBuild.exe to Path.
Valid on powershell:
```sh
mkdir cmake-windows-msvc
cd cmake-windows-msvc
cmake .. -DCMAKE_BUILD_TYPE=Release -G "Visual Studio 17 2022"
MSbuild.exe nasal.sln /p:Configuration=Release /p:Platform=x64
```
## MingW-W64
Need CMake and MingW-W64. Remember to add MingW-W64 bin to Path.
Valid on powershell:
```sh
mkdir cmake-windows-mingw
cd cmake-windows-mingw
cmake .. -DCMAKE_BUILD_TYPE=Release -G "MinGW Makefiles" -DCMAKE_C_COMPILER=gcc -DCMAKE_CXX_COMPILER=g++
mingw32-make.exe -j6
```