diff mbox series

[2/2] cmake: use Ninja by default

Message ID 20180118123804.2465-2-ross.burton@intel.com
State New
Headers show
Series [1/2] cmake: allow the generator to be changed | expand

Commit Message

Ross Burton Jan. 18, 2018, 12:38 p.m. UTC
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 <ross.burton@intel.com>

---
 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

Comments

Otavio Salvador Jan. 18, 2018, 1:04 p.m. UTC | #1
On Thu, Jan 18, 2018 at 10:38 AM, Ross Burton <ross.burton@intel.com> wrote:
> 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 <ross.burton@intel.com>


Acked-by: Otavio Salvador <otavio@ossystems.com.br>




-- 
Otavio Salvador                             O.S. Systems
http://www.ossystems.com.br        http://code.ossystems.com.br
Mobile: +55 (53) 9981-7854            Mobile: +1 (347) 903-9750
-- 
_______________________________________________
Openembedded-core mailing list
Openembedded-core@lists.openembedded.org
http://lists.openembedded.org/mailman/listinfo/openembedded-core
Zoltán Böszörményi Jan. 18, 2018, 3:02 p.m. UTC | #2
2018-01-18 13:38 keltezéssel, Ross Burton írta:
> This changes the cmake class to use Ninja instead of Make by default.


Can we still use "oe_runmake [-C subdir] target" with Ninja or
is it considered a broken build and forced to use the "Unix Makefiles" generator?
I have a working mariadb 10.2.12 recipe and the native build is trimmed down
to the absolute necessary pieces:

oe_runmake import_executables
oe_runmake -C libmariadb

Best regards,
Zoltán Böszörményi

> 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 <ross.burton@intel.com>

> ---

>   meta/classes/cmake.bbclass | 2 +-

>   1 file changed, 1 insertion(+), 1 deletion(-)

> 

> 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")

> 


-- 
_______________________________________________
Openembedded-core mailing list
Openembedded-core@lists.openembedded.org
http://lists.openembedded.org/mailman/listinfo/openembedded-core
Ross Burton Jan. 18, 2018, 4:02 p.m. UTC | #3
On 18 January 2018 at 15:02, Böszörményi Zoltán <zboszor@pr.hu> wrote:

> 2018-01-18 13:38 keltezéssel, Ross Burton írta:

>

>> This changes the cmake class to use Ninja instead of Make by default.

>>

>

> Can we still use "oe_runmake [-C subdir] target" with Ninja or

> is it considered a broken build and forced to use the "Unix Makefiles"

> generator?

> I have a working mariadb 10.2.12 recipe and the native build is trimmed

> down

> to the absolute necessary pieces:

>

> oe_runmake import_executables

> oe_runmake -C libmariadb

>


Because you're doing -C I suspect you'll need to force it to use makefiles
explicitly, but you can tell cmake what targets to build and the target
names are universal so if you can find a way of doing that without -C then
you can tell cmake to build the specific targets (OECMAKE_TARGET_COMPILE
and _INSTALL)  and then the choice of generator doesn't matter.

Ross
<div dir="ltr">On 18 January 2018 at 15:02, Böszörményi Zoltán <span dir="ltr">&lt;<a href="mailto:zboszor@pr.hu" target="_blank">zboszor@pr.hu</a>&gt;</span> wrote:<br><div class="gmail_extra"><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><span class="">2018-01-18 13:38 keltezéssel, Ross Burton írta:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
This changes the cmake class to use Ninja instead of Make by default.<br>
</blockquote>
<br></span>
Can we still use &quot;oe_runmake [-C subdir] target&quot; with Ninja or<br>
is it considered a broken build and forced to use the &quot;Unix Makefiles&quot; generator?<br>
I have a working mariadb 10.2.12 recipe and the native build is trimmed down<br>
to the absolute necessary pieces:<br>
<br>
oe_runmake import_executables<br>
oe_runmake -C libmariadb<br></blockquote><div><br></div><div>Because you&#39;re doing -C I suspect you&#39;ll need to force it to use makefiles explicitly, but you can tell cmake what targets to build and the target names are universal so if you can find a way of doing that without -C then you can tell cmake to build the specific targets (OECMAKE_TARGET_COMPILE and _INSTALL)  and then the choice of generator doesn&#39;t matter.</div><div><br></div><div>Ross <br></div></div></div></div>
-- 
_______________________________________________
Openembedded-core mailing list
Openembedded-core@lists.openembedded.org
http://lists.openembedded.org/mailman/listinfo/openembedded-core
Alejandro Enedino Hernandez Samaniego Jan. 19, 2018, 11:33 p.m. UTC | #4
On 01/18/2018 04:38 AM, Ross Burton wrote:
> 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 <ross.burton@intel.com>

> ---

>   meta/classes/cmake.bbclass | 2 +-

>   1 file changed, 1 insertion(+), 1 deletion(-)

>

> 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")


Awesome, testing it now!

Alejandro
-- 
_______________________________________________
Openembedded-core mailing list
Openembedded-core@lists.openembedded.org
http://lists.openembedded.org/mailman/listinfo/openembedded-core
diff mbox series

Patch

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")