rtissera / libchdr

Standalone library for reading MAME's CHDv1-v5 formats.
BSD 3-Clause "New" or "Revised" License
98 stars 42 forks source link

cmake: add an option to enable lto if supported #62

Closed scribam closed 3 years ago

scribam commented 3 years ago

Easier for projects which include libchdr to choose if they want to use lto or not.

Clownacy commented 3 years ago

Why make the user pass -DBUILD_LTO=ON to CMake when they can just do -DCMAKE_INTERPROCEDURAL_OPTIMIZATION=ON instead and avoid the need for extra logic in the CMake file?

scribam commented 3 years ago

-DCMAKE_INTERPROCEDURAL_OPTIMIZATION=ON does not check if the compiler supports LTO