From 00543144bdeef8579205f58da521138550a2e3c2 Mon Sep 17 00:00:00 2001 From: wenxingsen Date: Fri, 3 Nov 2023 04:09:45 +0000 Subject: [PATCH] support set LTO_JOBS using sh build.sh rpm -DLTO_JOBS=NUM --- cmake/Env.cmake | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/cmake/Env.cmake b/cmake/Env.cmake index c6946e27e..87e487be8 100644 --- a/cmake/Env.cmake +++ b/cmake/Env.cmake @@ -23,6 +23,7 @@ ob_define(OB_CMAKE_RULES_CHECK ON) ob_define(OB_STATIC_LINK_LGPL_DEPS ON) ob_define(HOTFUNC_PATH "${CMAKE_SOURCE_DIR}/hotfuncs.txt") ob_define(OB_BUILD_CCLS OFF) +ob_define(LTO_JOBS 32) # get compiler from build.sh ob_define(OB_CC "") ob_define(OB_CXX "") @@ -62,7 +63,7 @@ ob_define(THIN_LTO_CONCURRENCY_LINK "") if(ENABLE_THIN_LTO) set(THIN_LTO_OPT "-flto=thin -fwhole-program-vtables") - set(THIN_LTO_CONCURRENCY_LINK "-Wl,--thinlto-jobs=32,--lto-whole-program-visibility") + set(THIN_LTO_CONCURRENCY_LINK "-Wl,--thinlto-jobs=${LTO_JOBS},--lto-whole-program-visibility") endif() set(ob_close_modules_static_name "")