Gentoo Archives: gentoo-dev

From: Fabulous Zhang Zheng <zheng1181822466@×××××.com>
To: gentoo-dev@l.g.o
Subject: [gentoo-dev] USE=ninja to compile by ninja, otherwise by make
Date: Fri, 29 Jul 2022 16:39:56
Message-Id: CAJwjFt3yWCnoQg6uTvk0oXCMQhooWBNpd_L1mQ5a0-OdMCK1Ug@mail.gmail.com
1 Dear everyone,
2
3
4 While gentoo-devhelp is a better place for questions, it's been inactive
5 for years so I sent an email here. Apologies if this is solely for gentoo
6 developers.
7
8 I'm writing an ebuild of ddnet, <http://github.com/ddnet/ddnet> a cmake
9 argument of which is "-GNinja" controlling the build system to be ninja or
10 make. Naturally I decided to add a USE flag "ninja"
11
12 Part of my src_configure function is as below:
13
14 local mycmakeargs=(
15 ......
16 -DVULKAN=$(usex vulkan ON OFF)
17 )
18 use ninja && mycmakeargs+=( -GNinja )
19 cmake_src_configure
20
21 What confuses me is that portage seems to always use ninja to build, for
22 htop always indicates user portage is running ( ninja -v -j5 ), whenever
23 USE=ninja is enabled or disabled.
24
25 After trying to read cmake.eclass source code, I think separately denoting
26 ninja/make in src_compile and src_install might be possible. But
27 cmake_build still automatically detects the build type so I am confused.
28
29 My drafted ebuild file is attached below. It will be much appreciated if
30 anyone could help :)
31
32
33 Best regards.

Attachments

File name MIME type
ddnet-16.2.2.ebuild application/octet-stream

Replies

Subject Author
Re: [gentoo-dev] USE=ninja to compile by ninja, otherwise by make waebbl-gentoo@××××××.net