From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from smtp55.i.mail.ru (smtp55.i.mail.ru [217.69.128.35]) (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 797C941C5DB for ; Tue, 16 Jun 2020 20:34:48 +0300 (MSK) Date: Tue, 16 Jun 2020 20:34:02 +0300 From: Alexander Turenko Message-ID: <20200616173402.4m5nuqi4quernvho@tkn_work_nb> References: <20200312100549.31608-1-arkholga@tarantool.org> <20200616010232.3j2zvwo7z6lmnody@tkn_work_nb> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: 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: Olga Arkhangelskaia Cc: tarantool-patches@dev.tarantool.org > +    # 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() It seems I forgot to mention one point in the previous message. 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.