01:SCons是什么?

SCons是一个开源的软件构建工具,提供比经典Make更简单、更可靠的构建方案。它使用Python脚本作为配置文件,支持自动依赖关系分析,内建多种编程语言和文档类型的构建支持,包括C、C++、Java等。此外,SCons支持并行构建、VisualStudio项目生成,以及跨平台操作,能在各种操作系统上运行。

Scons:一个软件构造工具(本篇是翻译官方的介绍)

SCons是什么?

SCons是一个开源软件构建工具。将SCons视为经典Make实用程序的一种改进的跨平台替代品,其集成功能类似于autoconf/automake和编译器缓存(如ccache)。简而言之,SCons是一种更简单、更可靠、更快的软件构建方式

SCons为什么越来越受到欢迎?

配置文件是Python脚本——使用真正的编程语言来解决构建问题。
为C、C++和Fortran内置的可靠的自动依赖关系分析--不再使用“make dependent”或“make clean”来获取所有依赖关系。依赖关系分析可以通过其他语言或文件类型的用户定义依赖关系扫描程序轻松扩展。
内置对C、C++、D、Java、Fortran、Yacc、Lex、Qt和SWIG的支持,并构建TeX和LaTeX文档。通过用户定义的其他语言或文件类型的构建器轻松扩展。
从源代码和/或预构建目标的中央存储库构建。
内置对Microsoft Visual Studio的支持,包括生成.dsp、.dsw、.sln和.vcproj文件。
使用MD5签名可靠地检测构建更改;对传统时间戳的可选、可配置的支持。
支持并行构建,如make-j,但无论目录层次结构如何,都可以同时运行N个作业。
对查找#include文件、库、函数和typedef的类似Autoconf的集成支持。
所有依赖项的全局视图——不再需要多次构建过程或重新排序目标来构建所有内容。
能够在缓存中共享已构建的文件,以加快多个构建的速度——类似于ccache,但适用于任何类型的目标文件,而不仅仅是C/C++编译。
从头开始为跨平台构建而设计,已知可在Linux、其他POSIX系统(包括AIX、BSD系统、HP/UX、IRIX和Solaris)、Windows 7/8/10、MacOS和OS/2上工作。
官网: https://www.scons.org/
扩展:其它构建工具 autotools(make)、cmake+ninja
修正后的代码仍存在警告 Copied D:\c++\01test\Project4\Project4\bl_2.c to libudf\src (system "copy "D:\ANSYS2~1\ANSYSI~1\v221\fluent"\fluent22.1.0\src\udf\sconstruct.udf "libudf\win64\2ddp_host\SConstruct" ") ????? 1 ??????? (system "copy "D:\ANSYS2~1\ANSYSI~1\v221\fluent"\fluent22.1.0\src\udf\scons_default.bat "libudf\win64\2ddp_host\scons_test.bat" ") ????? 1 ??????? Files udf_names.c and user_nt.udf in 2ddp_host are up-to-date. (system "copy "D:\ANSYS2~1\ANSYSI~1\v221\fluent"\fluent22.1.0\src\udf\makefile_nt.udf "libudf\win64\2ddp_host\makefile" ") ????? 1 ??????? (chdir "libudf")(chdir "win64\2ddp_host") D:\c++\01test\Project4\Project4\libudf\win64\2ddp_host>rem D:\c++\01test\Project4\Project4\libudf\win64\2ddp_host>rem Copyright 1987-2022 ANSYS, Inc. All Rights Reserved. D:\c++\01test\Project4\Project4\libudf\win64\2ddp_host>rem 'cl.exe' ????????????????????????��???? ????????????? 'clang-cl' ????????????????????????��???? ????????????? scons: warning: No version of Visual Studio compiler found - C/C++ compilers most likely not set correctly File "D:\c++\01test\Project4\Project4\libudf\win64\2ddp_host\SConstruct", line 8, in <module> scons: warning: No version of Visual Studio compiler found - C/C++ compilers most likely not set correctly File "D:\c++\01test\Project4\Project4\libudf\win64\2ddp_host\SConstruct", line 18, in <module> Compiler used is "D:\ANSYS2~1\ANSYSI~1\v221\fluent"\ntbin\clang\bin\clang-cl Linker used is "D:\ANSYS2~1\ANSYSI~1\v221\fluent"\ntbin\clang\bin\lld-link scons: warning: No version of Visual Studio compiler found - C/C++ compilers most likely not set correctly File "D:\c++\01test\Project4\Project4\libudf\win64\2ddp_host\SConstruct", line 152, in <module> Copy("D:\c++\01test\Project4\Project4\libudf\win64\2ddp_host\resolve.exe", "D:\ANSYS2~1\ANSYSI~1\v221\fluent\ntbin\win64\resolve.exe") Copy("D:\c++\01test\Project4\Project4\libudf\win64\2ddp_host\bl_2.c", "D:\c++\01test\Project4\Project4\libudf\src\bl_2.c") c_sources ['bl_2.c', 'udf_names.c'] c_sources_ ['bl_2.c'] In file included from bl_2.c:1: In file included from D:\ANSYS2~1\ANSYSI~1\v221\fluent\fluent22.1.0\src\udf\udf.h:22: In file included from D:\ANSYS2~1\ANSYSI~1\v221\fluent\fluent22.1.0\src\main\global.h:266: In file included from D:\ANSYS2~1\ANSYSI~1\v221\fluent\fluent22.1.0\src\storage\var.h:10: D:\ANSYS2~1\ANSYSI~1\v221\fluent\ntbin\clang\10\Include\10.0.18362.0\shared\basetsd.h(322,12): warning: cast to 'void * __ptr32' from smaller integer type 'unsigned long' [-Wint-to-void-pointer-cast] return((void * POINTER_32) (unsigned long) (ULONG_PTR) p); ^ 1 warning generated. 'nmake' ????????????????????????��???? ????????????? (system "copy "D:\ANSYS2~1\ANSYSI~1\v221\fluent"\fluent22.1.0\src\udf\sconstruct.udf "libudf\win64\2ddp_node\SConstruct" ") ????? 1 ??????? (system "copy "D:\ANSYS2~1\ANSYSI~1\v221\fluent"\fluent22.1.0\src\udf\scons_default.bat "libudf\win64\2ddp_node\scons_test.bat" ") ????? 1 ??????? Files udf_names.c and user_nt.udf in 2ddp_node are up-to-date. (system "copy "D:\ANSYS2~1\ANSYSI~1\v221\fluent"\fluent22.1.0\src\udf\makefile_nt.udf "libudf\win64\2ddp_node\makefile" ") ????? 1 ??????? (chdir "libudf")(chdir "win64\2ddp_node") D:\c++\01test\Project4\Project4\libudf\win64\2ddp_node>rem D:\c++\01test\Project4\Project4\libudf\win64\2ddp_node>rem Copyright 1987-2022 ANSYS, Inc. All Rights Reserved. D:\c++\01test\Project4\Project4\libudf\win64\2ddp_node>rem 'cl.exe' ????????????????????????��???? ????????????? 'clang-cl' ????????????????????????��???? ????????????? scons: warning: No version of Visual Studio compiler found - C/C++ compilers most likely not set correctly File "D:\c++\01test\Project4\Project4\libudf\win64\2ddp_node\SConstruct", line 8, in <module> scons: warning: No version of Visual Studio compiler found - C/C++ compilers most likely not set correctly File "D:\c++\01test\Project4\Project4\libudf\win64\2ddp_node\SConstruct", line 18, in <module> Compiler used is "D:\ANSYS2~1\ANSYSI~1\v221\fluent"\ntbin\clang\bin\clang-cl Linker used is "D:\ANSYS2~1\ANSYSI~1\v221\fluent"\ntbin\clang\bin\lld-link scons: warning: No version of Visual Studio compiler found - C/C++ compilers most likely not set correctly File "D:\c++\01test\Project4\Project4\libudf\win64\2ddp_node\SConstruct", line 152, in <module> Copy("D:\c++\01test\Project4\Project4\libudf\win64\2ddp_node\resolve.exe", "D:\ANSYS2~1\ANSYSI~1\v221\fluent\ntbin\win64\resolve.exe") Copy("D:\c++\01test\Project4\Project4\libudf\win64\2ddp_node\bl_2.c", "D:\c++\01test\Project4\Project4\libudf\src\bl_2.c") c_sources ['bl_2.c', 'udf_names.c'] c_sources_ ['bl_2.c'] In file included from bl_2.c:1: In file included from D:\ANSYS2~1\ANSYSI~1\v221\fluent\fluent22.1.0\src\udf\udf.h:22: In file included from D:\ANSYS2~1\ANSYSI~1\v221\fluent\fluent22.1.0\src\main\global.h:266: In file included from D:\ANSYS2~1\ANSYSI~1\v221\fluent\fluent22.1.0\src\storage\var.h:10: D:\ANSYS2~1\ANSYSI~1\v221\fluent\ntbin\clang\10\Include\10.0.18362.0\shared\basetsd.h(322,12): warning: cast to 'void * __ptr32' from smaller integer type 'unsigned long' [-Wint-to-void-pointer-cast] return((void * POINTER_32) (unsigned long) (ULONG_PTR) p); ^ 1 warning generated. 'nmake' ????????????????????????��???? ????????????? LAPTOP-9EE2DO2N: Opening library "D:\c++\01test\Project4\Project4\libudf"...Done. bl_normal_integrate Done. Done. Done.
最新发布
09-23
评论
成就一亿技术人!
拼手气红包6.0元
还能输入1000个字符
 
红包 添加红包
表情包 插入表情
 条评论被折叠 查看
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

搏哥聊技术

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值