<!doctype html>
<html>
<head>
<meta charset="UTF-8">
</head>
<body>
<div style="" class="default-style">
How do you use cmake + ccache to cross compile in combination with a toolchain compiler wrapper (from
<em>crosstool-NG</em>)?
<br>
</div>
<div style="" class="default-style">
<br>
</div>
<div style="" class="default-style">
The situation:
<br>
</div>
<div style="" class="default-style">
cross-compile for arm with a sdk + cmake + ccache
<br>
</div>
<div style="" class="default-style">
<br>The sdk installation
<br>
<pre><em>$ sdk-dat-arm$ ll host/usr/bin/
arm-am3354-linux-gnueabihf-c++ -> ext-toolchain-wrapper*
arm-am3354-linux-gnueabihf-cc -> ext-toolchain-wrapper*
arm-am3354-linux-gnueabihf-cpp -> ext-toolchain-wrapper*
arm-am3354-linux-gnueabihf-g++ -> ext-toolchain-wrapper*
arm-am3354-linux-gnueabihf-gcc -> ext-toolchain-wrapper*
arm-am3354-linux-gnueabihf-gcc-4.9.4 -> ext-toolchain-wrapper*</em></pre>
<br>
<div>
ccache configuration
<br>
</div>
<pre><em>/usr/local/bin$ ls -al
arm-am3354-linux-gnueabihf-g++ -> ccache
arm-am3354-linux-gnueabihf-gcc -> ccache
cc -> ccache
ccache
g++ -> ccache
gcc -> ccache<br><br>/usr/local/bin/arm-am3354-linux-gnueabihf-gcc --version<br>arm-am3354-linux-gnueabihf-gcc (crosstool-NG ) 4.9.4 20150629 (prerelease)
</em></pre>cmake configuration
<br>
<br>
<em>set(CMAKE_C_COMPILER_LAUNCHER ccache)</em>
<br>
<em>set(CMAKE_C_COMPILER arm-am3354-linux-gnueabihf-gcc)</em>
<br>
<em>set(CMAKE_CXX_COMPILER_LAUNCHER ccache)</em>
<br>
<em>set(CMAKE_CXX_COMPILER arm-am3354-linux-gnueabihf-g++)</em>
<em></em>
</div>
<div style="" class="default-style">
<em><br></em> Executing cmake
<br>
<em><br></em>
<em>$ cmake ....<br></em>
<em>-- Check for working C compiler: /usr/local/bin/arm-am3354-linux-gnueabihf-gcc<br>-- Check for working C compiler: /usr/local/bin/arm-am3354-linux-gnueabihf-gcc -- works</em>
<em>-- Check for working CXX compiler: /usr/local/bin/arm-am3354-linux-gnueabihf-g++<br>-- Check for working CXX compiler: /usr/local/bin/arm-am3354-linux-gnueabihf-g++ -- works</em>
<em></em>
</div>
<div style="" class="default-style">
<em><br></em>
<em>Compiling with the above cmake configuration fails ...<br></em>
<em><br></em>
<em>-- The CXX compiler identification is GNU 4.9.4<br>-- Check for working C compiler: /usr/local/bin/arm-am3354-linux-gnueabihf-gcc<br></em>
<em>-- Check for working CXX compiler: /usr/local/bin/arm-am3354-linux-gnueabihf-g++</em>
<em>-- Check for working CXX compiler: /usr/local/bin/arm-am3354-linux-gnueabihf-g++ -- works<br></em>
<em>In file included from ... fatal error: libudev.h: No such file or directory</em>
<em>compilation terminated.</em>
<em><br></em>
<em></em>
</div>
<div style="" class="default-style">
<em><br></em>
</div>
<div style="" class="default-style">
without the LAUNCHER it compiles successively.
<br>
</div>
<div style="" class="default-style">
<br>
</div>
<div style="" class="default-style">
The libudev.h is defined for inclusion in
<br>
</div>
<div style="" class="default-style">
path/CXX.includecache:libudev.h
</div>
<div style="" class="default-style">
<em><br></em>
</div>
<div style="" class="default-style">
<em><br></em>
</div>
<div style="" class="default-style">
<em></em>Any idea of whats the reason for the compilation failure, i.e. why with the LAUNCHER it wont find the include?
</div>
</body>
</html>