Neutree / c_cpp_project_framework

CMake build system( framework) with kconfig support for C/CPP projects
https://neucrack.com/p/276
MIT License
159 stars 38 forks source link

resolve the python2.7.17 and cmake3.10.2 error #6

Closed skb666 closed 1 year ago

skb666 commented 1 year ago

老版本的 python2 不支持 f"{arg}" 的语法,已修复 老版本的 cmake 不支持 --parallel 并行编译,可以通过 ./project.py config -G Ninja 使用 Ninja 加速编译

Neutree commented 1 year ago

很棒! 查了下文档,确实是 cmake12 才支持的参数,不过你直接删掉感觉也不太妥,也许有两个方式:

  1. 直接将 cmake最小版本要求改为 >= 12.4, 强制用户安装 12.4以上版本的cmake,这样维护起来也方便
  2. 在语句里面判断一下,cmake版本<12.4, 则警告用户升级 cmake,可以在代码里面判断一下configs["CONFIG_CMAKE_GENERATOR"] == "Unix Makefiles"的话就不用cmake --build命令,直接用make -j{thread_num } 构建
skb666 commented 1 year ago

方法二应该不可行,有时在编译完成之后还要执行 gen_binary.cmake 中用户通过 add_custom_command 添加的目标命令。 目前 vcpkg 支持的最低 cmake 版本为 3.7.2,我将 cmake 版本同步支持到与它一致了

Neutree commented 1 year ago

很棒, --指定参数给构建工具,漂亮!