From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from [87.239.111.99] (localhost [127.0.0.1]) by dev.tarantool.org (Postfix) with ESMTP id D98EC6ECE3; Wed, 15 Jun 2022 12:13:14 +0300 (MSK) DKIM-Filter: OpenDKIM Filter v2.11.0 dev.tarantool.org D98EC6ECE3 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=tarantool.org; s=dev; t=1655284395; bh=ok99znfDAvtIYT2GDqaedAeKv30JT96YEyFAWvrhtoY=; h=Date:To:Cc:References:In-Reply-To:Subject:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: From:Reply-To:From; b=a/sV2C82JPkfbTr6cg2YgDG++oImWNV4PJy5Z3XurBWQXV1JUMazN8tFLiZtFPGR/ trY7s7pCTY2a32j15xCrnJSvm12Cirh13oHsJnRrEMTHkPSP49FTOBUZLAuXuLy4zU zVsP3TfqmWmKs9OREFtqZSflN5IHQN223aSfJhHk= Received: from smtp41.i.mail.ru (smtp41.i.mail.ru [94.100.177.101]) (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 6764E6ECE3 for ; Wed, 15 Jun 2022 12:13:13 +0300 (MSK) DKIM-Filter: OpenDKIM Filter v2.11.0 dev.tarantool.org 6764E6ECE3 Received: by smtp41.i.mail.ru with esmtpa (envelope-from ) id 1o1P5M-0003sX-RZ; Wed, 15 Jun 2022 12:13:13 +0300 Date: Wed, 15 Jun 2022 12:10:55 +0300 To: Sergey Bronnikov Cc: tarantool-patches@dev.tarantool.org Message-ID: References: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-4EC0790: 10 X-7564579A: 646B95376F6C166E X-77F55803: 4F1203BC0FB41BD97D44297578DBEB86154F2FD640FB217D6E2915693C7339E7182A05F53808504069E6D4255CE2E045F3087E4EFA0F819352DE94D8DC5B19CBA23A937AF8A4E66B X-7FA49CB5: FF5795518A3D127A4AD6D5ED66289B5278DA827A17800CE7FCFCB92DA8654BB0EA1F7E6F0F101C67BD4B6F7A4D31EC0BCC500DACC3FED6E28638F802B75D45FF8AA50765F790063741EF31184B6C89658638F802B75D45FF36EB9D2243A4F8B5A6FCA7DBDB1FC311F39EFFDF887939037866D6147AF826D84040199279CBD99C4C59243BD2C5544F117882F4460429724CE54428C33FAD305F5C1EE8F4F765FC2EE5AD8F952D28FBA471835C12D1D9774AD6D5ED66289B52BA9C0B312567BB23117882F446042972877693876707352033AC447995A7AD18CB629EEF1311BF91D2E47CDBA5A96583BA9C0B312567BB2376E601842F6C81A19E625A9149C048EED76C6ED7039589DE03CEA74F0D118906D8FC6C240DEA7642DBF02ECDB25306B2B78CF848AE20165D0A6AB1C7CE11FEE37812A6222701F215C0837EA9F3D19764C4224003CC836476EA7A3FFF5B025636E2021AF6380DFAD1A18204E546F3947CB11811A4A51E3B096D1867E19FE1407959CC434672EE6371089D37D7C0E48F6C8AA50765F7900637A7EFCB0EB5ACB161EFF80C71ABB335746BA297DBC24807EABDAD6C7F3747799A X-8FC586DF: 6EFBBC1D9D64D975 X-C1DE0DAB: 9604B64F49C60606AD91A466A1DEF99B296C473AB1E14218C6CDE5D1141D2B1C30C1BB85674AB1834B61C97351157FA2B82C9D1A0603160EAD91A466A1DEF99B296C473AB1E14218B936CB490224F2464EEA7BD89490CAC0EDDA962BC3F61961 X-C8649E89: 4E36BF7865823D7055A7F0CF078B5EC49A30900B95165D34087368DEEB028F17E7074D0FE2CEBE8C6C262F7F5BF1DF3DCA548D2BD636FE094CA0BC75A11A047F1D7E09C32AA3244C32F9AA0C2195442AF0321847CFD7AE2463871F383B54D9B3729B2BEF169E0186 X-D57D3AED: 3ZO7eAau8CL7WIMRKs4sN3D3tLDjz0dLbV79QFUyzQ2Ujvy7cMT6pYYqY16iZVKkSc3dCLJ7zSJH7+u4VD18S7Vl4ZUrpaVfd2+vE6kuoey4m4VkSEu530nj6fImhcD4MUrOEAnl0W826KZ9Q+tr5ycPtXkTV4k65bRjmOUUP8cvGozZ33TWg5HZplvhhXbhDGzqmQDTd6OAevLeAnq3Ra9uf7zvY2zzsIhlcp/Y7m53TZgf2aB4JOg4gkr2biojF9WnY+1VDr7D2fkNFwdYFQ== X-Mailru-Sender: 07FBBCF39629D1142B587050E640F425251DDE6A957DB6B921E5F6376D868EF0B7CBEF92542CD7C88B0A2698F12F5C9EC77752E0C033A69E86920BD37369036789A8C6A0E60D2BB63A5DB60FBEB33A8A0DA7A0AF5A3A8387 X-Mras: Ok Subject: Re: [Tarantool-patches] [v2][PATCH 2/5] build/ninja: create target with cli binary only once X-BeenThere: tarantool-patches@dev.tarantool.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Tarantool development patches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , From: Sergey Kaplun via Tarantool-patches Reply-To: Sergey Kaplun Errors-To: tarantool-patches-bounces@dev.tarantool.org Sender: "Tarantool-patches" Hi, Sergey! Thanks for the patch! LGTM, except a few nits below. On 02.06.22, Sergey Bronnikov via Tarantool-patches wrote: > CMakeLists defines target for cli binary two times (for static and > shared build type) with the same output names. CMake generates two > targets with same names and it breaks Ninja: > > ninja: Entering directory `build/' > ninja: error: build.ninja:1656: multiple rules generate src/luajit [-w > dupbuild=err] > > Patch adds variables required for different build types and create Typo? s/create/creates/ > target for cli binary only once to avoid conflict. > --- > src/CMakeLists.txt | 40 ++++++++++++++++------------------------ > 1 file changed, 16 insertions(+), 24 deletions(-) > > diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt > index 8b651c5a..104ce999 100644 > --- a/src/CMakeLists.txt > +++ b/src/CMakeLists.txt > @@ -313,40 +313,32 @@ target_link_libraries(libluajit_shared ${TARGET_LIBS}) > > # Compiling and linking CLIs. > > if(NOT BUILDMODE STREQUAL "dynamic") > set(LIBLUAJIT_STATIC_DEPS libluajit_static) > set(LUAJIT_DEPS luajit_static) > + set(LUAJIT_BIN luajit_static) > + set(LUAJIT_LIB libluajit_static) > endif() > if(NOT BUILDMODE STREQUAL "static") > set(LIBLUAJIT_SHARED_DEPS libluajit_shared) > set(LUAJIT_DEPS luajit_shared) > + set(LUAJIT_BIN luajit_shared) > + set(LUAJIT_LIB libluajit_shared) > endif() > set(LIBLUAJIT_DEPS ${LIBLUAJIT_STATIC_DEPS} ${LIBLUAJIT_SHARED_DEPS}) Nit: Looks like the LUAJIT_DEPS variable duplicates work of LUAJIT_BIN variable now. > > +add_executable(${LUAJIT_BIN} EXCLUDE_FROM_ALL ${CLI_SOURCES}) > +set_target_properties(luajit_shared PROPERTIES > + OUTPUT_NAME "${LUAJIT_CLI_NAME}" > + COMPILE_FLAGS "${TARGET_C_FLAGS}" > + LINK_FLAGS "${TARGET_BIN_FLAGS}" > + RUNTIME_OUTPUT_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}" > +) > +target_include_directories(${LUAJIT_BIN} PRIVATE > + ${CMAKE_CURRENT_BINARY_DIR} > +) > +target_link_libraries(${LUAJIT_BIN} ${LUAJIT_LIB} ${TARGET_LIBS}) > + > # XXX: The variable is used in testing, so PARENT_SCOPE option > # is obligatory. > set(LUAJIT_BINARY $ PARENT_SCOPE) > -- > 2.25.1 > -- Best regards, Sergey Kaplun