diff options
author | Zahir Hussain <zahir.basha@kpit.com> | 2023-12-01 17:46:17 +0530 |
---|---|---|
committer | Steve Sakoman <steve@sakoman.com> | 2024-02-16 03:35:51 -1000 |
commit | aa02dc871fd0cc799e85d1730be9039975f3b822 (patch) | |
tree | e57c351dcf06ddcd4cca49a91da821ad75a76389 /meta | |
parent | c846f0d89c71ed31b8fc486fd1350bd83d1ea071 (diff) | |
download | poky-aa02dc871fd0cc799e85d1730be9039975f3b822.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: 7ab6087536bc67c63094f08f863dcd3d5e35b8e7)
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>
Diffstat (limited to 'meta')
-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 a7020da9c7..870009c2ba 100644 --- a/meta/recipes-devtools/cmake/cmake/OEToolchainConfig.cmake +++ b/meta/recipes-devtools/cmake/cmake/OEToolchainConfig.cmake | |||
@@ -19,3 +19,6 @@ file( GLOB toolchain_config_files "${CMAKE_TOOLCHAIN_FILE}.d/*.cmake" ) | |||
19 | foreach(config ${toolchain_config_files}) | 19 | foreach(config ${toolchain_config_files}) |
20 | include(${config}) | 20 | include(${config}) |
21 | endforeach() | 21 | endforeach() |
22 | |||
23 | unset(CMAKE_C_IMPLICIT_INCLUDE_DIRECTORIES) | ||
24 | unset(CMAKE_CXX_IMPLICIT_INCLUDE_DIRECTORIES) | ||