summaryrefslogtreecommitdiffstats
path: root/meta
diff options
context:
space:
mode:
authorZahir Hussain <zahir.basha@kpit.com>2023-12-01 17:46:17 +0530
committerSteve Sakoman <steve@sakoman.com>2024-02-12 17:13:14 -1000
commit7ab6087536bc67c63094f08f863dcd3d5e35b8e7 (patch)
treec62debf5f48cd8c063ee3ac93504da9c8c898f8a /meta
parentfb448f87c0b3906b91d453451083dc003ac94ebe (diff)
downloadopenembedded-core-7ab6087536bc67c63094f08f863dcd3d5e35b8e7.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. 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.cmake3
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" )
foreach(config ${toolchain_config_files})
include(${config})
endforeach()
+
+unset(CMAKE_C_IMPLICIT_INCLUDE_DIRECTORIES)
+unset(CMAKE_CXX_IMPLICIT_INCLUDE_DIRECTORIES)