Why use Scons over (cmakelist.txt + automation) #4736
Replies: 3 comments 3 replies
-
It seems like you have your mind made up already, so there's not a lot to say, I guess. Use the tool which feels comfortable to you. SCons can also act as a build generator, which is CMake's purpose - SCons can generate a ninja build. CMake doesn't handle any building directly, although it has a convenience method to kick off the build. SCons does does indeed do a lot of work in the default "correctness is more important than speed" mode for a big project. For developer use, you can do stuff to speed it up - essentially making the same assumption that makefiles, ninja builds, etc. do: you trade not automatically recomputing dependencies for speed, and leave it up to you as teh developer, rather than the tool, to know when something has changed and stuff should be rescanned. CMake has evolved over time, it's now relatively "target centric" - which matches how SCons has always been (old CMake was pretty cumbersome to use). You describe the relationship between desired targets and explicit sources, and SCons computes things from there. Yes, CMake has better toolchain support: nobody would deny it's a bigger ecosystem (and with a commercial company behind it). SCons needs people to contribute more tool modules to keep up. There's been no particular demand for file change notification - I'm sure it's come up but I don't recall any real discussion. That could potentially be added to "interactive mode", which leaves SCons running and makes incremental rebuilds fast because there's no startup time to pay, the dependency graph is already in memory. The ninja mode uses interactive to have a running copy that can be called back to for steps ninja shouldn't build, and I can see, conceptually, how file change detection could help there. |
Beta Was this translation helpful? Give feedback.
-
I am familiar with this topic. Thank you for providing some background on SCons and its features, particularly the "interactive mode." I appreciate that information. I do have a follow-up question: In what real-world scenarios or types of projects have you found SCons to be a better fit than CMake, or vice versa? **I'm interested in understanding the differing |
Beta Was this translation helpful? Give feedback.
-
It's hard to speak for others. Projects such as Godot, Gem5 and Nuitka seem to be pretty attached to SCons. MongoDB was SCons based for a long time, they're now transitioning to Bazel, I don't think they ever considered CMake viable - but can't represent to you why. |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
I want to know why should i use scons !?
Reason 1:
Cmake, you can use a cmakelists.txt file along with build scripts (like .sh or .ps1) containing all the necessary commands to build the project. cmakelists.txt handles source files, library linking, tests, and platform-specific configuration. Cmake generates native build files for tools like make, ninja, or visual studio, resulting in efficient builds with fewer system calls and lower overhead compared to scons, which executes build logic directly and can introduce additional processing overhead.
More system calls in python make it slow for larger projects.
Reason 2 :
In terms of manual labour its essentially the same. If you know little bit of automation
But in scons, unnecessary translation needed and its make it slow in every aspect when compared to cmakelist path.
Reason 3:
Both things, does not watch your files in realtime.
Reason 4:
If someones priority is fast builds, more scalability, and broad tool support, cmake with a script is usually the better choice over scons
regardless of the scripting language used in configuration.
*Please don't say it's because Python is easier to manage, that depends on individual perspectives.
Any comments are welcome! I’m not a hater, just genuinely curious
Beta Was this translation helpful? Give feedback.
All reactions