cmake: Unset CMAKE_CXX_IMPLICIT_INCLUDE_DIRECTORIES
PATCH 1/1 cmake: Unset CMAKE_CXX_IMPLICIT_INCLUDE_DIRECTORIES
From: Zahir Hussain <[email protected]>
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 <[email protected]>
Signed-off-by Zahir Hussain <[email protected]>
--- meta/recipes-devtools/cmake/cmake/OEToolchainConfig.cmake | 3 +++ 1 file changed, 3 insertions(+)
meta/recipes-devtools/cmake/cmake/OEToolchainConfig.cmake +3 -0
@@ -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)
Signature · 1 line
2.17.1