Hello,
I am trying to cross-compile Ceres-solver for an ARM system. I have created a toolchain file with settings based on a known, working configuration.
When I try to cross-compile Ceres-solver using my toolchain:cmake -DCMAKE_TOOLCHAIN_FILE=../ceres-solver-2.2.0/cmake/toolchain.cmake ../ceres-solver-2.2.0
The build fails with errors like:
path/to/compiler/ld: cannot find -lstdc++
These types of errors are the ones you would see by calling the compiler without any flags. My toolchain file has CMAKE_CXX_COMPILER and CMAKE_CXX_FLAGS defined and these are carried over to the CMakeLists.txt from Ceres-solver.
As far as I am aware, CMAKE_CXX_FLAGS is never overwritten.
Interestingly, the CMakeOutput.log file (which seems to identify the compiler and run some checks) shows that CMake does use the CMAKE_CXX_FLAGS correctly and cross-compiles small test executables that work.
Is there any reason why CMake would not use CMAKE_CXX_FLAGS when cross-compiling?
Regards,
R.J.