<feed xmlns='http://www.w3.org/2005/Atom'>
<title>staging/nbd/include/cmake.mk, branch master</title>
<subtitle>Felix Fietkaus staging tree</subtitle>
<id>https://git-03.infra.openwrt.org/openwrt/staging/nbd/atom?h=master</id>
<link rel='self' href='https://git-03.infra.openwrt.org/openwrt/staging/nbd/atom?h=master'/>
<link rel='alternate' type='text/html' href='https://git-03.infra.openwrt.org/openwrt/staging/nbd/'/>
<updated>2025-11-05T15:57:51Z</updated>
<entry>
<title>cmake: set CMAKE_FIND_ROOT_PATH_MODE_PROGRAM=NEVER</title>
<updated>2025-11-05T15:57:51Z</updated>
<author>
<name>Eneas U de Queiroz</name>
</author>
<published>2025-06-20T13:18:58Z</published>
<link rel='alternate' type='text/html' href='https://git-03.infra.openwrt.org/openwrt/staging/nbd/commit/?id=e4956451353b744fe15312366a09b0d17832332d'/>
<id>urn:sha1:e4956451353b744fe15312366a09b0d17832332d</id>
<content type='text'>
According to CMake documentation[1]:

  [CMAKE_FIND_ROOT_PATH] is a list of directories that contain the
  target environment.

  [CMAKE_FIND_ROOT_PATH_MODE_PROGRAM] sets the default behavior for the
  find_program command.

  In most cases, find_program is used to search for an executable which
  will then be executed, e.g. using execute_process or
  add_custom_command. So in most cases an executable from the build host
  is required, so setting CMAKE_FIND_ROOT_PATH_MODE_PROGRAM to NEVER is
  normally preferred.

Since CMAKE_FIND_ROOT_PATH is set to the target staging dir, and the
toolchain root dir, it will find target programs before the host ones.

An example of this problem is if you try to build antiblock from the
packages feed after llvm from the video feeds is built.  Antiblock will
search for clang-format, pickup the target version, and fail to build.

Signed-off-by: Eneas U de Queiroz &lt;cotequeiroz@gmail.com&gt;

[1] https://cmake.org/cmake/help/book/mastering-cmake/chapter/Cross%20Compiling%20With%20CMake.html
Link: https://github.com/openwrt/openwrt/pull/20656

Signed-off-by: Christian Marangi &lt;ansuelsmth@gmail.com&gt;
</content>
</entry>
<entry>
<title>cmake: use RelWithDebInfo, not Debug, with CONFIG_DEBUG</title>
<updated>2025-05-10T10:41:26Z</updated>
<author>
<name>Nathaniel Wesley Filardo</name>
</author>
<published>2025-05-04T20:40:13Z</published>
<link rel='alternate' type='text/html' href='https://git-03.infra.openwrt.org/openwrt/staging/nbd/commit/?id=703e7d2d5b58e68528cb5fadfc1185bd3904b3d9'/>
<id>urn:sha1:703e7d2d5b58e68528cb5fadfc1185bd3904b3d9</id>
<content type='text'>
Given the description of the configuration option at its definition in
target/sdk/files/Config.in ("Compile packages with debugging info" and "Adds -g3
to the CFLAGS", the more appropriate CMAKE build type is `RelWithDebInfo` rather
than `Debug`.

Signed-off-by: Nathaniel Wesley Filardo &lt;nwfilardo@gmail.com&gt;
Link: https://github.com/openwrt/openwrt/pull/18709
Signed-off-by: Robert Marko &lt;robimarko@gmail.com&gt;
</content>
</entry>
<entry>
<title>include: cmake.mk: honor CONFIG_DEBUG</title>
<updated>2024-11-12T02:31:06Z</updated>
<author>
<name>Daniel Golle</name>
</author>
<published>2024-11-09T23:31:18Z</published>
<link rel='alternate' type='text/html' href='https://git-03.infra.openwrt.org/openwrt/staging/nbd/commit/?id=fc9ec5bd3d22d50654af154fc779517fa7aecb33'/>
<id>urn:sha1:fc9ec5bd3d22d50654af154fc779517fa7aecb33</id>
<content type='text'>
Set CMAKE_BUILD_TYPE according to CONFIG_DEBUG.

Signed-off-by: Daniel Golle &lt;daniel@makrotopia.org&gt;
</content>
</entry>
<entry>
<title>cmake.mk: disable shared libs for host packages</title>
<updated>2024-10-06T20:39:32Z</updated>
<author>
<name>Rosen Penev</name>
</author>
<published>2024-09-26T23:29:43Z</published>
<link rel='alternate' type='text/html' href='https://git-03.infra.openwrt.org/openwrt/staging/nbd/commit/?id=c80792e666f9a1f40d7b4b846874cdd66d22bd95'/>
<id>urn:sha1:c80792e666f9a1f40d7b4b846874cdd66d22bd95</id>
<content type='text'>
Disable for host to avoid having to use rpath hacks.

Signed-off-by: Rosen Penev &lt;rosenp@gmail.com&gt;
Link: https://github.com/openwrt/openwrt/pull/16586
Signed-off-by: Robert Marko &lt;robimarko@gmail.com&gt;
</content>
</entry>
<entry>
<title>build: fix CMake generator for non-Ninja builds</title>
<updated>2024-08-29T17:46:48Z</updated>
<author>
<name>Ivan Romanov</name>
</author>
<published>2024-08-26T07:45:38Z</published>
<link rel='alternate' type='text/html' href='https://git-03.infra.openwrt.org/openwrt/staging/nbd/commit/?id=4646aa169986036772b9f75393c08508d20ddf8b'/>
<id>urn:sha1:4646aa169986036772b9f75393c08508d20ddf8b</id>
<content type='text'>
OpenWRT by default uses the Ninja generator, but some packages disable
Ninja and use the default Unix Makefiles generator. This generator can
be overridden in the user environment with `CMAKE_GENERATOR`. This patch
explicitly sets the correct generator when `PKG_USE_NINJA:=0`.

In particular, the `mt76` package uses the Makefiles generator.

Signed-off-by: Ivan Romanov &lt;drizt72@zoho.eu&gt;
Link: https://github.com/openwrt/openwrt/pull/16263
Signed-off-by: Hauke Mehrtens &lt;hauke@hauke-m.de&gt;
</content>
</entry>
<entry>
<title>treewide: make use of new toolchain define</title>
<updated>2023-10-20T14:13:56Z</updated>
<author>
<name>Christian Marangi</name>
</author>
<published>2023-10-19T16:16:25Z</published>
<link rel='alternate' type='text/html' href='https://git-03.infra.openwrt.org/openwrt/staging/nbd/commit/?id=d82c5884c6164856e830894d9bfacd218d430ba4'/>
<id>urn:sha1:d82c5884c6164856e830894d9bfacd218d430ba4</id>
<content type='text'>
Make use of new toolchain define. TOOLCHAIN_DIR should be used only for
toolchain related packages and for everything else TOOLCHAIN_ROOT_DIR
and other define should be used instead.

Switch to new entry where possible.

Signed-off-by: Christian Marangi &lt;ansuelsmth@gmail.com&gt;
</content>
</entry>
<entry>
<title>build: suppress cmake warnings about unused vars</title>
<updated>2023-10-04T10:28:45Z</updated>
<author>
<name>Tjalling Hattink</name>
</author>
<published>2023-09-26T13:10:52Z</published>
<link rel='alternate' type='text/html' href='https://git-03.infra.openwrt.org/openwrt/staging/nbd/commit/?id=29a56e0412668f197353001254125ae40824db1e'/>
<id>urn:sha1:29a56e0412668f197353001254125ae40824db1e</id>
<content type='text'>
When cmake is invoked to build a package it usually reports a warning
about unused variables passed to it. This is caused by openwrt passing
all supported variables to cmake, even if they are not all required by
the package being compiled.

To reduce clutter when compiling such packages these warnings are now
suppressed.

Approved-by: Rosen Penev &lt;rosenp@gmail.com&gt;
Reviewed-by: Robert Marko &lt;robimarko@gmail.com&gt;
Signed-off-by: Tjalling Hattink &lt;t.hattink@fugro.com&gt;
</content>
</entry>
<entry>
<title>treewide: drop use of which</title>
<updated>2022-01-17T08:14:26Z</updated>
<author>
<name>Ansuel Smith</name>
</author>
<published>2021-11-25T01:12:58Z</published>
<link rel='alternate' type='text/html' href='https://git-03.infra.openwrt.org/openwrt/staging/nbd/commit/?id=88204bfa82f982a986d2aa3e166a4c5946040308'/>
<id>urn:sha1:88204bfa82f982a986d2aa3e166a4c5946040308</id>
<content type='text'>
Ubuntu started to flag which as deprecated and it
seems which is not really standard and may vary
across Distro.
Drop the use of which and use the standard 'command -v'
for this simple task.
Which is still present in the prereq if some package/script
still use which.
A utility script called command_all.sh is implemented that
will just mimic the output of which -a.

Signed-off-by: Ansuel Smith &lt;ansuelsmth@gmail.com&gt;
</content>
</entry>
<entry>
<title>include/cmake.mk: add support for overriding the host install prefix</title>
<updated>2021-11-04T15:55:04Z</updated>
<author>
<name>Felix Fietkau</name>
</author>
<published>2021-11-02T17:08:47Z</published>
<link rel='alternate' type='text/html' href='https://git-03.infra.openwrt.org/openwrt/staging/nbd/commit/?id=a6a9f9be278e718f3f8a5cb7640dd8035cc802b9'/>
<id>urn:sha1:a6a9f9be278e718f3f8a5cb7640dd8035cc802b9</id>
<content type='text'>
Signed-off-by: Felix Fietkau &lt;nbd@nbd.name&gt;
</content>
</entry>
<entry>
<title>include/cmake.mk: fix host builds with CMAKE_BINARY_SUBDIR</title>
<updated>2021-10-20T09:35:34Z</updated>
<author>
<name>Felix Fietkau</name>
</author>
<published>2021-10-17T15:01:23Z</published>
<link rel='alternate' type='text/html' href='https://git-03.infra.openwrt.org/openwrt/staging/nbd/commit/?id=1c07eab9f81f1ee99cc2ae36596bda81c12d5dbc'/>
<id>urn:sha1:1c07eab9f81f1ee99cc2ae36596bda81c12d5dbc</id>
<content type='text'>
Use it in the same way as for target builds

Signed-off-by: Felix Fietkau &lt;nbd@nbd.name&gt;
</content>
</entry>
</feed>
