Simplify compile.sh and make it perform better
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
widelands |
Fix Released
|
Medium
|
Hans Joachim Desserud |
Bug Description
There are a bunch of issues around compile.sh and I think it is time to kill it.
1) compile.sh was made as a bandaid to make it "easy" for users to compile widelands.
The main problem it fixed though was that our builds were not incrementally correct when we did not run cmake everytime. This was because we used glob() to figure out what files to compile - if a new file was added, cmake would need to remake the build files, but since we never touched a CmakeFile it could not do it automatically.
This problem is gone now: each source is mentioned in a CMakeLists.txt file and adding or removing one will need to modify the CmakeLists.txt file too - and cmake reruns itself. So running 'make' in the build directory is now always sufficient and usually way faster.
2) compile.sh uses MakeFiles and make to build the system. This is noisy (e.g. bug 1342741) and slow. Using cmake -G Ninja and 'ninja' [1] is ~100 times faster.
[1] http://
3) All in all, building widelands without compile.sh is as easy as:
mkdir build && cd build
cmake -G Ninja -DCMAKE_
ninja
Updating it:
bzr pull && cd build && ninja
Related branches
- SirVer: Approve
-
Diff: 266 lines (+64/-139)1 file modifiedcompile.sh (+64/-139)
Changed in widelands: | |
status: | New → Incomplete |
tags: | removed: cmake |
Changed in widelands: | |
status: | Fix Committed → Fix Released |
Hmm. I guess those are too many things in one bug.
compile.sh and make/ninja are independend.
I also believe ninja could be a good replacement for make. I would still not think it should "replace" compile.sh.
One of the major things of compile.sh is the update.sh which makes it easier for bzr illiterates (non-devs).
Then, even now, cmake/make is as easy as cmake/ninja. There is virtually no difference for me.
Then: update.sh runs "touch CMakeLists.txt" for a long time now, which forces cmake to run again. Of course this is slower, but it is always correct. It even makes make lang pick up new catalogs.
So, from my point of view:
+1 for ninja
-1 for removing compile.sh
The bug should be separated into "implement ninja support" and "move compile.sh to ninja".
Question would then be: do we really want to remove support for make (officially) and switch over to ninja? Do we want to support both? What is with the PPA builds?