mirror of
https://github.com/MobileGL-Dev/MobileGL
synced 2026-09-11 21:58:31 +09:00
[Chore] (CMake): Support using check_c*_compiler_flag to detect LTO capability.
This commit is contained in:
+4
-1
@@ -20,7 +20,10 @@ if (NOT CMAKE_BUILD_TYPE STREQUAL "Debug" OR MOBILEGL_FORCE_RELEASE_OPT)
|
|||||||
|
|
||||||
check_ipo_supported(RESULT LTOSupported OUTPUT LTOError)
|
check_ipo_supported(RESULT LTOSupported OUTPUT LTOError)
|
||||||
|
|
||||||
if (LTOSupported)
|
check_c_compiler_flag("-flto" HAS_LTO_C)
|
||||||
|
check_cxx_compiler_flag("-flto" HAS_LTO_CXX)
|
||||||
|
|
||||||
|
if (LTOSupported OR (HAS_LTO_C AND HAS_LTO_CXX))
|
||||||
# Check ThinLTO
|
# Check ThinLTO
|
||||||
check_c_compiler_flag("-flto=thin" HAS_THINLTO_C)
|
check_c_compiler_flag("-flto=thin" HAS_THINLTO_C)
|
||||||
check_cxx_compiler_flag("-flto=thin" HAS_THINLTO_CXX)
|
check_cxx_compiler_flag("-flto=thin" HAS_THINLTO_CXX)
|
||||||
|
|||||||
Reference in New Issue
Block a user