CMake cross-compile with specific linker doesn't pass arguments to armlink

后端 未结 3 690
一整个雨季
一整个雨季 2020-12-02 00:36

I am trying to cross-compile a project for embedded ARM Cortex builds, but I am unable to get the linker working. I want to use armlink, but no files are passed to armlink a

3条回答
  •  离开以前
    2020-12-02 00:51

    From my experience, you cannot set CMAKE_EXE_LINKER_FLAGS in a CMakeLists.txt file. It has to be passed via a CMAKE_TOOLCHAIN_FILE when CMake is invoked the very first time in a build directory.

    I don't find any documentation regarding this problem, but there is the cross-compilation with CMake page which you should use it if you do cross-compilation.

    For a start, just put your set-calls in a toolchain file and run

    cmake -DCMAKE_TOOLCHAIN_FILE=
    

    in a clean build directory.

提交回复
热议问题