ldc/cmake/Modules
Johan Engelen 305fcddd57 [CMake] Add option to build LDC using LTO: -DLDC_BUILD_WITH_LTO={OFF, ON, FULL, THIN}.
When LDC_BUILD_WITH_LTO is set, the script adds -flto switch for the C++ compiler and D compiler, but only if they can create an executable with it.

Tested on OSX with ThinLTO (both with and without ThinLTO LLVM build). Some extra work is probably needed on Linux. On Windows, it won't do anything as the cmdline flag checks will fail.
On Linux, we should also enable the thinlto cache if possible.
Quick measurements indicate ~3% percent increased performance for -O0 and -O3 compilation, and a ~20% ldc2 file size reduction. Future step is adding PGO ;-)
2017-02-04 16:03:57 +01:00
..
CheckDSourceCompiles.cmake [CMake] Add CheckDSourceCompiles.cmake macro that can check whether a piece of D code compiles with some optional compiler flags. 2017-01-25 22:54:55 +01:00
ExtractDMDSystemLinker.cmake [cmake] Fix CMake for when multiple D_COMPILER_FLAGS are passed. 2016-08-08 16:22:03 +02:00
FindDCompiler.cmake [cmake] Remove code that tries to resolve "~" in host compiler variable passed by the user. It conflicts with -DD_COMPILER="dmd", which is much more important to support. 2016-08-08 16:47:45 +02:00
FindLibConfig.cmake
FindLLVM.cmake Add support for LLVM 5.0 (current LLVM trunk) (#1985) 2017-01-25 20:36:20 +01:00
GetGitRevisionDescription.cmake For non-tagged commits, change version string to e.g. "1.1.0git-c693e26" (#1887) 2016-11-17 22:33:36 +01:00
GetGitRevisionDescription.cmake.in 2nd try at issue #874. 2015-03-28 19:01:48 +01:00
GetLinuxDistribution.cmake
HandleLTOPGOBuildOptions.cmake [CMake] Add option to build LDC using LTO: -DLDC_BUILD_WITH_LTO={OFF, ON, FULL, THIN}. 2017-02-04 16:03:57 +01:00