diff options
author | Zahir Hussain <zahir.basha@kpit.com> | 2023-12-01 17:46:17 +0530 |
---|---|---|
committer | Steve Sakoman <steve@sakoman.com> | 2024-01-16 07:54:08 -1000 |
commit | da81312c3d97af6d063c2114f4f6963bf8518bef (patch) | |
tree | f364e93ce744ea252573e87f2dec3ae70fe05498 | |
parent | bce087b5e8ccc598eaa6fb31bf5f3f9b37cb291d (diff) | |
download | poky-da81312c3d97af6d063c2114f4f6963bf8518bef.tar.gz |
cmake: Unset CMAKE_CXX_IMPLICIT_INCLUDE_DIRECTORIES
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.
(From OE-Core rev: 5599eaefee3818c865d71f5b7c3cc04fc01de848)
Signed-off-by: aszh07 <mail2szahir@gmail.com>
Signed-off-by: Zahir Hussain <zahir.basha@kpit.com>
Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
(cherry picked from commit 5aeada5793af53e8c93940952d4f314474dca4c2)
Signed-off-by: Steve Sakoman <steve@sakoman.com>
-rw-r--r-- | meta/recipes-devtools/cmake/cmake/OEToolchainConfig.cmake | 3 |
1 files changed, 3 insertions, 0 deletions
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" ) | |||
18 | foreach(config ${toolchain_config_files}) | 18 | foreach(config ${toolchain_config_files}) |
19 | include(${config}) | 19 | include(${config}) |
20 | endforeach() | 20 | endforeach() |
21 | |||
22 | unset(CMAKE_C_IMPLICIT_INCLUDE_DIRECTORIES) | ||
23 | unset(CMAKE_CXX_IMPLICIT_INCLUDE_DIRECTORIES) | ||