How do you use cmake + ccache to cross compile in combination with a toolchain 
compiler wrapper (from crosstool-NG)?

The situation:
cross-compile for arm with a sdk + cmake + ccache

The sdk installation

$ 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*


ccache configuration

/usr/local/bin$ ls -al
arm-am3354-linux-gnueabihf-g++ -> ccache
arm-am3354-linux-gnueabihf-gcc -> ccache
cc -> ccache
ccache
g++ -> ccache
gcc -> ccache

/usr/local/bin/arm-am3354-linux-gnueabihf-gcc --version
arm-am3354-linux-gnueabihf-gcc (crosstool-NG ) 4.9.4 20150629 (prerelease)

cmake configuration

set(CMAKE_C_COMPILER_LAUNCHER ccache)
set(CMAKE_C_COMPILER arm-am3354-linux-gnueabihf-gcc)
set(CMAKE_CXX_COMPILER_LAUNCHER ccache)
set(CMAKE_CXX_COMPILER arm-am3354-linux-gnueabihf-g++)

Executing cmake

$ cmake ....
-- Check for working C compiler: /usr/local/bin/arm-am3354-linux-gnueabihf-gcc
-- Check for working C compiler: /usr/local/bin/arm-am3354-linux-gnueabihf-gcc 
-- works -- Check for working CXX compiler: 
/usr/local/bin/arm-am3354-linux-gnueabihf-g++
-- Check for working CXX compiler: 
/usr/local/bin/arm-am3354-linux-gnueabihf-g++ -- works

Compiling with the above cmake configuration fails ...

-- The CXX compiler identification is GNU 4.9.4
-- Check for working C compiler: /usr/local/bin/arm-am3354-linux-gnueabihf-gcc
-- Check for working CXX compiler: 
/usr/local/bin/arm-am3354-linux-gnueabihf-g++ -- Check for working CXX 
compiler: /usr/local/bin/arm-am3354-linux-gnueabihf-g++ -- works
In file included from ... fatal error: libudev.h: No such file or directory 
compilation terminated.

without the LAUNCHER it compiles successively.

The libudev.h is defined for inclusion in
path/CXX.includecache:libudev.h


Any idea of whats the reason for the compilation failure, i.e. why with the 
LAUNCHER it wont find the include?
-- 

Powered by www.kitware.com

Please keep messages on-topic and check the CMake FAQ at: 
http://www.cmake.org/Wiki/CMake_FAQ

Kitware offers various services to support the CMake community. For more 
information on each offering, please visit:

CMake Support: http://cmake.org/cmake/help/support.html
CMake Consulting: http://cmake.org/cmake/help/consulting.html
CMake Training Courses: http://cmake.org/cmake/help/training.html

Visit other Kitware open-source projects at 
http://www.kitware.com/opensource/opensource.html

Follow this link to subscribe/unsubscribe:
https://cmake.org/mailman/listinfo/cmake

Reply via email to