Building using CMake: Difference between revisions

Jump to navigation Jump to search
m
(Switch to {{flightgear url}} to fix the broken Gitorious link. And usage of {{flightgear clone}} and {{simgear clone}} to abstract the repository cloning.)
Line 188: Line 188:
* '''-DJPEG_FACTORY=ON''' (enable jpeg support)
* '''-DJPEG_FACTORY=ON''' (enable jpeg support)
* '''-DENABLE_FLITE=ON''' (enable FLITE TTS-based ATIS) [http://sourceforge.net/p/flightgear/mailman/message/32265565] [{{flightgear url|commit=cadb77b18d13bb0d45672ac607801bda222454e9}}]
* '''-DENABLE_FLITE=ON''' (enable FLITE TTS-based ATIS) [http://sourceforge.net/p/flightgear/mailman/message/32265565] [{{flightgear url|commit=cadb77b18d13bb0d45672ac607801bda222454e9}}]
== LTO ==
Erik has tried to compile Simgear and FlightGear using 'gcc -flto' to see if he could squeee just a bit more performance out of the code.
To be able to do so he's run cmake for both Simgear and FlightGear as follows:
<pre>
cmake -DCMAKE_AR=/usr/bin/gcc-ar \
-DCMAKE_RANLIB=/usr/bin/gcc-ranlib \
-DCMAKE_NM=/usr/bin/gcc-nm \
-DSIMGEAR_SHARED=1 \
-DCMAKE_BUILD_TYPE=Release \
-DCMAKE_CXX_FLAGS:STRING="-Os march=native -mtune=native -msse3 -mfpmath=sse -flto"
</pre>
After applying one patch to SimGear he got it compiling.
The resulting binary is almost exactly 5Mb smaller:
* 14390984 fgfs-lto
* 19354528 fgfs
It did not alter the frame-rates much for him (he's got quite a decent videocard now with the GeForce GTX 750) but Erik did have the distinct feeling there were way less small-pauses/frame-rate glitches when compared to the regular build. The overall feeling was much smoother.<ref>{{cite web
  |url    =  https://sourceforge.net/p/flightgear/mailman/message/35478384/
  |title  =  <nowiki> [Flightgear-devel] Link Time Optimization </nowiki>
  |author =  <nowiki> Erik Hofman </nowiki>
  |date  =  Nov 8th, 2016
  |added  =  Nov 8th, 2016
  |script_version = 0.40
  }}</ref>


== XCode ==
== XCode ==

Navigation menu