admin管理员组文章数量:1026989
1. 系统安装python, 测试版本为(3.7.0)
2. 从官方网站获取get-pip.py
https://bootstrap.pypa.io/get-pip.py
3. 安装pip
python get-pip.py
4. 安装ninja
pip install ninja
5. 准备CMakeLists.txt
cmake_minimum_required(VERSION 3.22)
project(hello_ninja)
add_executable(${PROJECT_NAME} main.cpp)
6. 准备main.cpp
#include <iostream>
#include <conio.h>
int main(int argc, char *argv[])
{
std::cout << "hello world" << std::endl;
_getch();
return 0;
}
7. 编译, 从vs2019 Developer Command Prompt for VS 2019进入命令窗口
(与上述的main.cpp和CMakeLists.txt同级目录)
mkdir build
cd build
cmake -G Ninja ..
ninja
1. 系统安装python, 测试版本为(3.7.0)
2. 从官方网站获取get-pip.py
https://bootstrap.pypa.io/get-pip.py
3. 安装pip
python get-pip.py
4. 安装ninja
pip install ninja
5. 准备CMakeLists.txt
cmake_minimum_required(VERSION 3.22)
project(hello_ninja)
add_executable(${PROJECT_NAME} main.cpp)
6. 准备main.cpp
#include <iostream>
#include <conio.h>
int main(int argc, char *argv[])
{
std::cout << "hello world" << std::endl;
_getch();
return 0;
}
7. 编译, 从vs2019 Developer Command Prompt for VS 2019进入命令窗口
(与上述的main.cpp和CMakeLists.txt同级目录)
mkdir build
cd build
cmake -G Ninja ..
ninja
版权声明:本文标题:Windows 搭建ninja 编译c++的环境 内容由热心网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://it.en369.cn/jiaocheng/1735375002a1315734.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论