Hi,

i'm trying to setup a toolchain file for cross-compilation with target specfic
options and afaics cmake dosen't use flags from such file:

$ cat CMakeLists.txt 
cmake_minimum_required( VERSION 2.8.7 )
project( test CXX )
add_executable( main main.cpp )

$ cat CMakeToolchain-x86_64-gnu-linux.txt
set( CMAKE_SYSTEM_NAME Linux )
set( CMAKE_SYSTEM_VERSION 1 )
set( CMAKE_CXX_COMPILER 
/local/devel/toolchain46/x86_64-gnu-linux/bin/x86_64-gnu-linux-g++ )
set( CMAKE_CXX_FLAGS "-Wall -O1 -gdwarf-4 -g2 -std=gnu++0x" )
set( CMAKE_FIND_ROOT_PATH /usr )

$ LANG=C sh -x ./build.sh
+ rm -rf build
+ mkdir build
+ cd build
+ cmake ../ -DCMAKE_TOOLCHAIN_FILE=../CMakeToolchain-x86_64-gnu-linux.txt
-- The CXX compiler identification is GNU
-- Check for working CXX compiler: 
/local/devel/toolchain46/x86_64-gnu-linux/bin/x86_64-gnu-linux-g++
-- Check for working CXX compiler: 
/local/devel/toolchain46/x86_64-gnu-linux/bin/x86_64-gnu-linux-g++ -- works
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Configuring done
-- Generating done
(...)
[100%] Building CXX object CMakeFiles/main.dir/main.cpp.o
/local/devel/toolchain46/x86_64-gnu-linux/bin/x86_64-gnu-linux-g++     -o 
CMakeFiles/main.dir/main.cpp.o -c 
/home/users/pluto/src/cmake-cross-build/main.cpp
                                                                   ^^^ no cxx 
flags.

is it a bug or a feature?

BR,
Paweł.

--

Powered by www.kitware.com

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

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

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

Reply via email to