Make lto detection more robust and not resetting cxx flags when lto fails.
Make lto detection more robust and not resetting cxx flags when lto fails.

This refines the last commit of parallelizing lto.

Discussion: this is ugly as hell, dispatching 1/ on the availability of
the `-flto` flag, then 2/ on the compiler since GCC allows `-flto=n`
whereas Clang for example does not.

I tried setting the CMake property `INTERPROCEDURAL_OPTIMIZATION`,
without any effect. All I could see was some lto related utilities in
the cmake debug output, but not in the actual compiler or linker
invocation.

This would eliminate the need for our hacks, with 1/ using an option
`WITH_LTO` setting `ON` by default, and based on this value setting the
`INTERPROCEDURAL_OPTIMIZATION` flag with CMake doing the actual work of
selecting the best LTO method on the target platform.

By the way, this also fixes a bug where we reset the `CMAKE_CXX_FLAGS`
to a variable that was never defined, resulting in setting the flags to
an empty string. Yay CMake, as usual.

References:

- http://www.cmake.org/cmake/help/v3.0/prop_tgt/INTERPROCEDURAL_OPTIMIZATION.html

Project-OSRM/osrm-backend,frodrigo/osrm-backend,oxidase/osrm-backend,arnekaiser/osrm-backend,beemogmbh/osrm-backend,beemogmbh/osrm-backend,duizendnegen/osrm-backend,duizendnegen/osrm-backend,oxidase/osrm-backend,frodrigo/osrm-backend,frodrigo/osrm-backend,Project-OSRM/osrm-backend,deniskoronchik/osrm-backend,hydrays/osrm-backend,bjtaylor1/osrm-backend,yuryleb/osrm-backend,hydrays/osrm-backend,beemogmbh/osrm-backend,yuryleb/osrm-backend,neilbu/osrm-backend,yuryleb/osrm-backend,beemogmbh/osrm-backend,KnockSoftware/osrm-backend,felixguendling/osrm-backend,duizendnegen/osrm-backend,deniskoronchik/osrm-backend,KnockSoftware/osrm-backend,neilbu/osrm-backend,hydrays/osrm-backend,arnekaiser/osrm-backend,KnockSoftware/osrm-backend,deniskoronchik/osrm-backend,arnekaiser/osrm-backend,oxidase/osrm-backend,raymond0/osrm-backend,raymond0/osrm-backend,neilbu/osrm-backend,bjtaylor1/osrm-backend,deniskoronchik/osrm-backend,frodrigo/osrm-backend,Project-OSRM/osrm-backend,yuryleb/osrm-backend,bjtaylor1/osrm-backend,bjtaylor1/osrm-backend,Project-OSRM/osrm-backend,arnekaiser/osrm-backend,felixguendling/osrm-backend,oxidase/osrm-backend,neilbu/osrm-backend,felixguendling/osrm-backend,duizendnegen/osrm-backend,raymond0/osrm-backend,KnockSoftware/osrm-backend,hydrays/osrm-backend,raymond0/osrm-backend