Openembedded Core Discussions
 help / color / mirror / Atom feed
From: Richard Purdie <richard.purdie@linuxfoundation.org>
To: aszh07 <mail2szahir@gmail.com>, openembedded-core@lists.openembedded.org
Cc: ranjitsinh.rathod@kpit.com, Zahir Hussain <zahir.basha@kpit.com>
Subject: Re: [OE-core][master][PATCH] cmake: Unset CMAKE_CXX_IMPLICIT_INCLUDE_DIRECTORIES variable definition from toolchain file
Date: Wed, 29 Nov 2023 11:50:04 +0000	[thread overview]
Message-ID: <0e68fbea240a1dcbbdd6654ed21a026ed91eb71f.camel@linuxfoundation.org> (raw)
In-Reply-To: <20231129112843.4368-1-mail2szahir@gmail.com>

On Wed, 2023-11-29 at 16:58 +0530, aszh07 wrote:
> From: Zahir Hussain <zahir.basha@kpit.com>
> 
> As discussion in [YOCTO #14717] cmake contains a OEToolchainConfig.cmake
> file to configure the toolchain correctly in cross-compile build for recipes
> using cmake.
> 
> The variable CMAKE_CXX_IMPLICIT_INCLUDE_DIRECTORIES value updates incorrectly
> during do_compile the code. Due to this getting sporadic error like below,
> 
> fatal error: stdlib.h: No such file or directory
> >    75 | #include_next <stdlib.h>
> >       |               ^~~~~~~~~~
> > compilation terminated.
> > ninja: build stopped: subcommand failed.
> > WARNING: exit code 1 from a shell command.
> 
> As cmake already correctly initializes the variable from environment, So we have to
> unset it in the toolchain file to avoid overwriting the variable definition again.
> 
> Signed-off-by: aszh07 <mail2szahir@gmail.com>
> Signed-off-by: Zahir Hussain <zahir.basha@kpit.com>
> ---
>  meta/recipes-devtools/cmake/cmake/OEToolchainConfig.cmake | 3 +++
>  1 file changed, 3 insertions(+)
> 
> diff --git a/meta/recipes-devtools/cmake/cmake/OEToolchainConfig.cmake b/meta/recipes-devtools/cmake/cmake/OEToolchainConfig.cmake
> index d6a1e0464c..6434b27371 100644
> --- a/meta/recipes-devtools/cmake/cmake/OEToolchainConfig.cmake
> +++ b/meta/recipes-devtools/cmake/cmake/OEToolchainConfig.cmake
> @@ -18,3 +18,6 @@ file( GLOB toolchain_config_files "${CMAKE_CURRENT_LIST_FILE}.d/*.cmake" )
>  foreach(config ${toolchain_config_files})
>      include(${config})
>  endforeach()
> +
> +unset(CMAKE_C_IMPLICIT_INCLUDE_DIRECTORIES)
> +unset(CMAKE_CXX_IMPLICIT_INCLUDE_DIRECTORIES)

Can we add some kind of test cases for cmake so that we don't go in
circles with these bugs?

Cheers,

Richard


  reply	other threads:[~2023-11-29 11:50 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-11-29 11:28 [OE-core][master][PATCH] cmake: Unset CMAKE_CXX_IMPLICIT_INCLUDE_DIRECTORIES variable definition from toolchain file aszh07
2023-11-29 11:50 ` Richard Purdie [this message]
2023-11-30  9:11   ` [master][PATCH] " aszh07

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=0e68fbea240a1dcbbdd6654ed21a026ed91eb71f.camel@linuxfoundation.org \
    --to=richard.purdie@linuxfoundation.org \
    --cc=mail2szahir@gmail.com \
    --cc=openembedded-core@lists.openembedded.org \
    --cc=ranjitsinh.rathod@kpit.com \
    --cc=zahir.basha@kpit.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox