From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from smtp16.mail.ru (smtp16.mail.ru [94.100.176.153]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dev.tarantool.org (Postfix) with ESMTPS id 7BBE14429E1 for ; Thu, 25 Jun 2020 12:19:58 +0300 (MSK) From: "Timur Safin" References: <20200312100549.31608-1-arkholga@tarantool.org> <20200616010232.3j2zvwo7z6lmnody@tkn_work_nb> <20200616173402.4m5nuqi4quernvho@tkn_work_nb> In-Reply-To: <20200616173402.4m5nuqi4quernvho@tkn_work_nb> Date: Thu, 25 Jun 2020 12:19:55 +0300 Message-ID: <144f01d64ad1$ca678310$5f368930$@tarantool.org> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Content-Language: ru Subject: Re: [Tarantool-patches] [PATCH] cmake: add LTO support for building luajit List-Id: Tarantool development patches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: 'Alexander Turenko' , 'Olga Arkhangelskaia' Cc: tarantool-patches@dev.tarantool.org : From: Alexander Turenko : Subject: Re: [PATCH] cmake: add LTO support for building luajit :=20 : > + # Enablibg LTO for luajit if DENABLE_LTO set. : > + if (${ENABLE_LTO}) : > +`......message(STATUS "Enablig LTO for luajit") : > + set (luajit_ld ${CMAKE_C_LINK_OPTIONS_IPO}) : > +`......set (luajit_cflags ${luajit_cflags} ${CFLAGS_LTO}) : > +`......set (CMAKE_AR ${AR_LTO}) : > endif() :=20 : It seems I forgot to mention one point in the previous message. :=20 : Please, set luajit_ar variable and use it below, not reassign = CMAKE_AR. : `include(luajit)` directive does not open a new variables scope, so if : we'll reassign CMAKE_AR here, it may affect static libraries creation : for code outside luajit. We should not change outside build rules in : luajit.cmake. In general I'd agree with Sasha here, and would advise to introduce = scoped variable, (if we were talking about average local variable), but = here we are talking about CMAKE_* variable, which is toolchain, and = better be used consistently across whole project. But this might be debatable, though... Timur