On 06/24/2014 09:15 AM, Piotr Bialek wrote:

This might have been more appropriate for the user's mailing list since it does not involve development of CMake itself.

I'm trying to cross compile with clang. I set cmake_compiler,
cmake_linker, etc.
During the linking CXX executable all flags, libs, files, etc. are
getting  from somehow created file ./Main/CMakeFiles/Build.dir/link.txt.

The problem is, that when I change linker by setting
CMAKE_CXX_LINK_EXECUTABLE, no files or flags are generated in link.txt
and I get message like: "x86_64-pc-linux-gnu-ld: no input files".

The CMAKE_CXX_LINK_EXECUTABLE variable does not refer to the linker executable.
It contains the rule used to link executables:

http://www.cmake.org/cmake/help/v3.0/variable/CMAKE_LANG_LINK_EXECUTABLE.html

You shouldn't have to modify it.

For a link CMake calls the compiler (and the compiler invokes the linker).

To set the compiler you can use: http://www.cmake.org/cmake/help/v3.0/variable/CMAKE_LANG_COMPILER.html

Or the CC and CXX environment variables.

The compilers have to be set on the initial CMake run.

For a native build with clang on GNU/Linux this can be as simple as e.g.:
  CC=clang CXX=clang++ cmake [...]

Nils
--

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:
http://public.kitware.com/mailman/listinfo/cmake-developers

Reply via email to