From patchwork Thu Jan 18 12:38:03 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ross Burton X-Patchwork-Id: 124940 Delivered-To: patch@linaro.org Received: by 10.46.64.27 with SMTP id n27csp108376lja; Thu, 18 Jan 2018 04:38:18 -0800 (PST) X-Google-Smtp-Source: ACJfBosB7iOVzCQyAnF8o8g2NwjCevvCi3IUmW0d8m0rg2gWUaCdowvWnn5+IAC4zy3boEqWWH6D X-Received: by 10.99.178.78 with SMTP id t14mr35143642pgo.296.1516279098794; Thu, 18 Jan 2018 04:38:18 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1516279098; cv=none; d=google.com; s=arc-20160816; b=oo3W9nwR2sJkiEzqe/kkIkLDMh2dRjOl2J0Reaqayw6e9u3m944Ep/ZA9xU0Vu8Jo7 ZAEc/3Qj6t/3CPV07gk8EDtecVQG8oxUenr44hvfAMdDkMyYWlAi33EwLLuUkbF5eM0/ 6hGtFAktlB1+pHpYKhR+Ug0y4rZI+6qY32vRw4kFBlRwzvy55kDNKmgYSHMLC35Xalhn qcfWdmdea8CrlqSt4/8bDYD3Kjw+odeySBX6iGzrgHHCfehgCSX18uQVj9MdxWRPZRXw fITUixPvTkyfX8FDbdfbY9Zkw5vn7WxlDz51nJnNIcDNd+lzujhrlwEdr4GWGLhJwYH4 EfHQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=errors-to:sender:content-transfer-encoding:mime-version :list-subscribe:list-help:list-post:list-archive:list-unsubscribe :list-id:precedence:subject:message-id:date:to:from:dkim-signature :delivered-to:arc-authentication-results; bh=aLJ0aN1j8f+t9/PNVA9hFi+wetr133cfff3rL4v6HDs=; b=kboh/FQcyG0jwQ4YxU4GGYQKGHmTwh4FHLGBRYuqzjxaI99jsd1e2zwbLOK2w8FowL 8EZGQm7nt/Wy429VQCT5O8mP3AzzV+JQEzZp103FLrjEzZjZJYZWgCQQrd0dMcTlEf06 riafd04uIn//elI8CfBy/gfprauQr03c1aG9q3CDM9lTXx+5fBH6y0es1U3IL+3RFz5S qH/QbatN8ubK74H3nQb10kngnkFGKpeAowLnk7ToJwFUTRkk9QHmGnwccYl37qZ4g6CS SCMWRjKZUjq42qboOKD0CGSzwg4GrPDHmLI6iJhMo0pxoD0ro2/40uHwNVfdhAsql8ub HrMw== ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@intel-com.20150623.gappssmtp.com header.s=20150623 header.b=VKquec7t; spf=pass (google.com: best guess record for domain of openembedded-core-bounces@lists.openembedded.org designates 140.211.169.62 as permitted sender) smtp.mailfrom=openembedded-core-bounces@lists.openembedded.org Return-Path: Received: from mail.openembedded.org (mail.openembedded.org. [140.211.169.62]) by mx.google.com with ESMTP id f12si5773809pgo.493.2018.01.18.04.38.18; Thu, 18 Jan 2018 04:38:18 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of openembedded-core-bounces@lists.openembedded.org designates 140.211.169.62 as permitted sender) client-ip=140.211.169.62; Authentication-Results: mx.google.com; dkim=neutral (body hash did not verify) header.i=@intel-com.20150623.gappssmtp.com header.s=20150623 header.b=VKquec7t; spf=pass (google.com: best guess record for domain of openembedded-core-bounces@lists.openembedded.org designates 140.211.169.62 as permitted sender) smtp.mailfrom=openembedded-core-bounces@lists.openembedded.org Received: from layers.openembedded.org (localhost [127.0.0.1]) by mail.openembedded.org (Postfix) with ESMTP id F0ACA7828D; Thu, 18 Jan 2018 12:38:11 +0000 (UTC) X-Original-To: openembedded-core@lists.openembedded.org Delivered-To: openembedded-core@lists.openembedded.org Received: from mail-wm0-f66.google.com (mail-wm0-f66.google.com [74.125.82.66]) by mail.openembedded.org (Postfix) with ESMTP id C679B7828D for ; Thu, 18 Jan 2018 12:38:09 +0000 (UTC) Received: by mail-wm0-f66.google.com with SMTP id 141so22431419wme.3 for ; Thu, 18 Jan 2018 04:38:11 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=intel-com.20150623.gappssmtp.com; s=20150623; h=from:to:subject:date:message-id; bh=B7/ERnraLIy4VdIvE09jbouhMmJROYpJfMs+T5I5NdU=; b=VKquec7tDbhQE+ew0npEPejC5y/OVIYdcLnZ/Epf6HtXjX4a7Y2RKGxlQT5NPFtilh DtCy1ExsX6tr+3+BOm/gzaMRAoBcLCZUKANzfhdBnVKPdMzonlr3A9P649jnTR3OqdvU sfP0tW5j+WxtBGprHlAduX3Ngq63/DQyQZC4xsptZYLSda1gYilaKFq4XNW0e8cuBw+Y YdBo86QRx6azwZ2JLnXbro3r9X+MNpamDaiZobZFlPmybFhy95IHf8X9JgbqcY47hZq8 0Q8LlquIG4MZBTOy4ChYkfUVkhJQoKJ6vSjcxfUyLv4fnzoHTJBRP5/fn5Giic8tYiSU MFXQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:subject:date:message-id; bh=B7/ERnraLIy4VdIvE09jbouhMmJROYpJfMs+T5I5NdU=; b=I2D3LfMTdRxIeh35bEdToulN4AkWDfQuucVhd5OKtdqZ+xNTFW+nwSwot2//KZjJrG k/6SuP4SQRlQNZZ8axF4nXnQBs/YmjGU9ebkiH9JoouFwKMRaP/WssZGfRa7kJ0pBOg8 zTUYh7aK42EBBHMAoafuzHmShSnNGi9xnUWWVsxMyqtvkoii0HDH7HH8katKXMPAqe8s duAux0DUYt073bv30M3x8N6u5FtbRJ10BUOIHx9r2l5ep8dyZpi+OoIQ21y+vF/J3mhD HrTGc8nzndZnrjOVRGKwzQZSM8abdbb6Pllyv0huDcKKUktvwrVnJQz+R5HOlyGQcj8T Gcwg== X-Gm-Message-State: AKwxytdA10fiieXbGodlU8YA7neIKml9NdplUsFF0bAn2orjcjJt2Ucq zLInerCpiYkRQVCdxt3OOQPXiHEw X-Received: by 10.28.170.195 with SMTP id t186mr5199615wme.3.1516279090085; Thu, 18 Jan 2018 04:38:10 -0800 (PST) Received: from flashheart.burtonini.com (home.burtonini.com. [81.2.106.35]) by smtp.gmail.com with ESMTPSA id f48sm4464635wra.72.2018.01.18.04.38.09 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 18 Jan 2018 04:38:09 -0800 (PST) From: Ross Burton To: openembedded-core@lists.openembedded.org Date: Thu, 18 Jan 2018 12:38:03 +0000 Message-Id: <20180118123804.2465-1-ross.burton@intel.com> X-Mailer: git-send-email 2.11.0 Subject: [OE-core] [PATCH 1/2] cmake: allow the generator to be changed X-BeenThere: openembedded-core@lists.openembedded.org X-Mailman-Version: 2.1.12 Precedence: list List-Id: Patches and discussions about the oe-core layer List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: openembedded-core-bounces@lists.openembedded.org Errors-To: openembedded-core-bounces@lists.openembedded.org Add OECMAKE_GENERATOR variable to control which generator is used by CMake, defaulting to the upstream default of Unix Makefiles for now. The other supported option is Ninja, which is faster than Make for large projects (for example, using Ninja takes three minutes off webkitgtk:do_compile for me). Signed-off-by: Ross Burton --- meta/classes/cmake.bbclass | 20 ++++++++++++++++++-- 1 file changed, 18 insertions(+), 2 deletions(-) -- 2.11.0 -- _______________________________________________ Openembedded-core mailing list Openembedded-core@lists.openembedded.org http://lists.openembedded.org/mailman/listinfo/openembedded-core Acked-by: Otavio Salvador diff --git a/meta/classes/cmake.bbclass b/meta/classes/cmake.bbclass index 55698e60e53..74a952142ff 100644 --- a/meta/classes/cmake.bbclass +++ b/meta/classes/cmake.bbclass @@ -7,6 +7,23 @@ B = "${WORKDIR}/build" # We need to unset CCACHE otherwise cmake gets too confused CCACHE = "" +# What CMake generator to use. +# The supported options are "Unix Makefiles" or "Ninja". +OECMAKE_GENERATOR ?= "Unix Makefiles" + +python() { + generator = d.getVar("OECMAKE_GENERATOR") + if generator == "Unix Makefiles": + args = "-G 'Unix Makefiles' -DCMAKE_MAKE_PROGRAM=" + d.getVar("MAKE") + d.setVar("OECMAKE_GENERATOR_ARGS", args) + d.setVarFlag("do_compile", "progress", "percent") + elif generator == "Ninja": + d.appendVar("DEPENDS", " ninja-native") + d.setVar("OECMAKE_GENERATOR_ARGS", "-G Ninja -DCMAKE_MAKE_PROGRAM=ninja") + d.setVarFlag("do_compile", "progress", "outof:^\[(\d+)/(\d+)\]\s+") + else: + bb.fatal("Unknown CMake Generator %s" % generator) +} # C/C++ Compiler (without cpu arch/tune arguments) OECMAKE_C_COMPILER ?= "`echo ${CC} | sed 's/^\([^ ]*\).*/\1/'`" OECMAKE_CXX_COMPILER ?= "`echo ${CXX} | sed 's/^\([^ ]*\).*/\1/'`" @@ -121,9 +138,9 @@ cmake_do_configure() { fi cmake \ + ${OECMAKE_GENERATOR_ARGS} \ $oecmake_sitefile \ ${OECMAKE_SOURCEPATH} \ - -DCMAKE_MAKE_PROGRAM=${MAKE} \ -DCMAKE_INSTALL_PREFIX:PATH=${prefix} \ -DCMAKE_INSTALL_BINDIR:PATH=${@os.path.relpath(d.getVar('bindir'), d.getVar('prefix'))} \ -DCMAKE_INSTALL_SBINDIR:PATH=${@os.path.relpath(d.getVar('sbindir'), d.getVar('prefix'))} \ @@ -142,7 +159,6 @@ cmake_do_configure() { -Wno-dev } -do_compile[progress] = "percent" cmake_do_compile() { bbnote VERBOSE=1 cmake --build '${B}' --target ${OECMAKE_TARGET_COMPILE} -- ${EXTRA_OECMAKE_BUILD} VERBOSE=1 cmake --build '${B}' --target ${OECMAKE_TARGET_COMPILE} -- ${EXTRA_OECMAKE_BUILD} From patchwork Thu Jan 18 12:38:04 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ross Burton X-Patchwork-Id: 124941 Delivered-To: patch@linaro.org Received: by 10.46.64.27 with SMTP id n27csp108477lja; Thu, 18 Jan 2018 04:38:43 -0800 (PST) X-Google-Smtp-Source: ACJfBotqSgUebWRo8Dbwl5zpRPFazYYolCpk2jkEJOPbKy2tzDutd/V4aSpuLqScAN1fDITy7r8j X-Received: by 10.98.160.25 with SMTP id r25mr26687803pfe.218.1516279123492; Thu, 18 Jan 2018 04:38:43 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1516279123; cv=none; d=google.com; s=arc-20160816; b=IWsUjkgK7MzQ/xZbyRb0JfZU4zWakhGvqmPB/o2bjUKrKinQPAk64GPoKalCo7MGMx Yz9IhF0V6ZtZZSZD6K5yeB3AGllL0BiHF59nsNaWb/PEd/XezrUuuYOnLLLFofWBu9wY ZbFGHOrQfauQo3MnIIAQ0S32s3o8y4Q7NltlBp/7P6p+N5HVumi3XtwcLBWwRWradYRi rYVwNkOhbzNFljxMHhSAiJYNskLsXGVhGSpwr3QS0IW8459NBZi6oHiiavYrXOGF5Q80 PpexbcqsLUT98YGaerZAjsEM/TATW1ygCue/bRTt4+wSj+UqcZB7OojjyVMGOXn+asux gAcg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=errors-to:sender:content-transfer-encoding:mime-version :list-subscribe:list-help:list-post:list-archive:list-unsubscribe :list-id:precedence:subject:references:in-reply-to:message-id:date :to:from:dkim-signature:delivered-to:arc-authentication-results; bh=/7J7JGM1udbj6e0YzeFypZoNZJ+5Lsy63FsG/FfjzXo=; b=F2ZkAIMNWlqGJL9ZapZ4s6KZSipa7R2ERvnVZzsdu7EZ2eU7+r/yRcAwGQjCKS87Xc 60PDtkQMYOSJ747rdXzbxbKJw9dSLsrbP/zYpeKpC4d9CKhxHVf7hWRDmGuCb+8tjl8R ebc77d5TZ1srvBcUGoImXTj0+nRerTwpkL3oeo0AMqy3a+Ap/tARRYadj4jFKGlv+oim 60gdBCaV6tZ4rHKjBs9dMwVms1Xkjt1fP+TivNBi3BMw78d2tQDmRvzqoZViaVO5JoxL IciZ4bj5CYL+7ickCpowoLfrCGQar64nMKplc3vRaulm9xIi+MIByEbwnw0I6XL6Kq6H ABNg== ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@intel-com.20150623.gappssmtp.com header.s=20150623 header.b=oUxFgYaL; spf=pass (google.com: best guess record for domain of openembedded-core-bounces@lists.openembedded.org designates 140.211.169.62 as permitted sender) smtp.mailfrom=openembedded-core-bounces@lists.openembedded.org Return-Path: Received: from mail.openembedded.org (mail.openembedded.org. [140.211.169.62]) by mx.google.com with ESMTP id j1si5839649pgp.293.2018.01.18.04.38.43; Thu, 18 Jan 2018 04:38:43 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of openembedded-core-bounces@lists.openembedded.org designates 140.211.169.62 as permitted sender) client-ip=140.211.169.62; Authentication-Results: mx.google.com; dkim=neutral (body hash did not verify) header.i=@intel-com.20150623.gappssmtp.com header.s=20150623 header.b=oUxFgYaL; spf=pass (google.com: best guess record for domain of openembedded-core-bounces@lists.openembedded.org designates 140.211.169.62 as permitted sender) smtp.mailfrom=openembedded-core-bounces@lists.openembedded.org Received: from layers.openembedded.org (localhost [127.0.0.1]) by mail.openembedded.org (Postfix) with ESMTP id 1F765787E0; Thu, 18 Jan 2018 12:38:41 +0000 (UTC) X-Original-To: openembedded-core@lists.openembedded.org Delivered-To: openembedded-core@lists.openembedded.org Received: from mail-wm0-f67.google.com (mail-wm0-f67.google.com [74.125.82.67]) by mail.openembedded.org (Postfix) with ESMTP id 892007828D for ; Thu, 18 Jan 2018 12:38:10 +0000 (UTC) Received: by mail-wm0-f67.google.com with SMTP id v71so22620307wmv.2 for ; Thu, 18 Jan 2018 04:38:11 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=intel-com.20150623.gappssmtp.com; s=20150623; h=from:to:subject:date:message-id:in-reply-to:references; bh=Q62S9Skor6mFowuqIjdFwwsQyj2C4PDhbW2IblswgoU=; b=oUxFgYaL8d25LSo07xggbxUvMGJcOwXJX8XBNBKtbkCxyP0uimpvj3ES4QN1TBULlV sa+x9s/gKRhWFp5nx16RHvJPcvp6WszkQFWV9IT8TcTp9Dlw2qTwarTbcL+Fv5sb/Bid w6fPe/WEi4s2jxHu/NYCyWERGO8jOdFac6OW6Rc/yfd4rdAoZyKnyrjN1YuoO+seMGxu QDTu6zq/boqG87LCGomsGiNOj/TbAp7DsdY96/aaOaHNzYxyfghGSUj9Nsr6mblRrMWI MU67ZiDBBIhJTxBfriJWxBIbgQ+sS9NpwCAyMVci1XmU/gyUuo7xFdhF78ni70WrH9F6 1WOQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:subject:date:message-id:in-reply-to :references; bh=Q62S9Skor6mFowuqIjdFwwsQyj2C4PDhbW2IblswgoU=; b=s3BLGpcA3XT+83wT1qQYk5/urWoLgm2jvDEE4LpcSVoyP+u/jhb0WEkdA9S0KREJuy iK4vLzwrCKVOjb8LbTyvMLUW2QBpcpqzXIHB4lsqK8ZS+Nj+ktqnWJN11NIM6jcrx7gL 6zNx1j5Nn5KUmftX5lQUZL2c7ODf7dakzagYsQZhYsPRe9tIkuuLHcUpw4JjKlVWlMhF gvM1/rnZskz48CvUyiV+Eevi6o8BWln1d+pXKicJlz3W5c4upUVPkbMYohI3BaoiyvN+ nkIPBmQ7mKg3EaKbsUVdYmjPKK6EYowfagVsEcPgnDLPHwYbCnb25QCV0Z33y9+x7Snr a+oA== X-Gm-Message-State: AKwxyteGg+Zcow4ikx2iT8l5/h4jZ/xFjyhveqPml4MjIbrT1O6El8ih 9PnVz1Vpn26xEYEsDpabAXxzQdzf X-Received: by 10.28.7.68 with SMTP id 65mr3947035wmh.9.1516279091078; Thu, 18 Jan 2018 04:38:11 -0800 (PST) Received: from flashheart.burtonini.com (home.burtonini.com. [81.2.106.35]) by smtp.gmail.com with ESMTPSA id f48sm4464635wra.72.2018.01.18.04.38.10 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 18 Jan 2018 04:38:10 -0800 (PST) From: Ross Burton To: openembedded-core@lists.openembedded.org Date: Thu, 18 Jan 2018 12:38:04 +0000 Message-Id: <20180118123804.2465-2-ross.burton@intel.com> X-Mailer: git-send-email 2.11.0 In-Reply-To: <20180118123804.2465-1-ross.burton@intel.com> References: <20180118123804.2465-1-ross.burton@intel.com> Subject: [OE-core] [PATCH 2/2] cmake: use Ninja by default X-BeenThere: openembedded-core@lists.openembedded.org X-Mailman-Version: 2.1.12 Precedence: list List-Id: Patches and discussions about the oe-core layer List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: openembedded-core-bounces@lists.openembedded.org Errors-To: openembedded-core-bounces@lists.openembedded.org This changes the cmake class to use Ninja instead of Make by default. If a recipe is broken with Ninja then the recipe can set OECMAKE_GENERATOR="Unix Makefiles" to change back to Make. Signed-off-by: Ross Burton --- meta/classes/cmake.bbclass | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) -- 2.11.0 -- _______________________________________________ Openembedded-core mailing list Openembedded-core@lists.openembedded.org http://lists.openembedded.org/mailman/listinfo/openembedded-core Acked-by: Otavio Salvador diff --git a/meta/classes/cmake.bbclass b/meta/classes/cmake.bbclass index 74a952142ff..d60dad8d66b 100644 --- a/meta/classes/cmake.bbclass +++ b/meta/classes/cmake.bbclass @@ -9,7 +9,7 @@ CCACHE = "" # What CMake generator to use. # The supported options are "Unix Makefiles" or "Ninja". -OECMAKE_GENERATOR ?= "Unix Makefiles" +OECMAKE_GENERATOR ?= "Ninja" python() { generator = d.getVar("OECMAKE_GENERATOR")