<html>
  <head>

    <meta http-equiv="content-type" content="text/html; charset=UTF-8">
  </head>
  <body bgcolor="#FFFFFF" text="#000000">
    <font size="-2">Hi, CMake developers.<br>
      <br>
    </font><span id="result_box" class="" lang="en"><span class="hps">I
        have a problem</span> <span class="hps atn">with cross-</span><span>compiling</span>
      <span class="hps">for ARM7</span> <span class="hps">simple
        program</span> <span class="hps">like:<br>
        <br>
        int main()<br>
        {<br>
            return 0;<br>
        }<br>
        <br>
        To building I use the toolchain as yagarto:
        <a class="moz-txt-link-freetext" href="http://www.yagarto.de/">http://www.yagarto.de/</a><br>
        <br>
        The problem is that the build with Yagarto need to use LDFLAGS +
        = "-nostartfiles"<br>
        <br>
      </span></span><span id="result_box" class="" lang="en"><span
        class="hps">But</span> <span class="hps">during</span> <span
        class="hps">testing</span> <span class="hps">CMake</span> <span
        class="hps">compiler</span><span>, by default</span> <span
        class="hps">tries to</span> <span class="hps">compile the</span>
      <span class="hps">test code</span> <span class="hps">without this</span>
      <span class="hps">flag.<br>
      </span></span><span id="result_box" class="short_text" lang="en"><span
        class="hps">Therefore,</span> <span class="hps">testing of</span>
      <span class="hps">the compiler</span> <span class="hps">fails.<br>
        <br>
        I have toolchain.cmake file with content:<br>
        <br>
        SET (CMAKE_SYSTEM_NAME Generic)<br>
        SET (CMAKE_SYSTEM_VERSION 1)<br>
        SET (CMAKE_SYSTEM_PROCESSOR arm7tdmi)<br>
        SET_PROPERTY(GLOBAL PROPERTY TARGET_SUPPORTS_SHARED_LIBS FALSE)<br>
        <br>
        SET (DEVROOT "c:/yagarto/toolchain")<br>
        <br>
        SET (CMAKE_C_COMPILER "${DEVROOT}/bin/arm-none-eabi-gcc.exe")<br>
        SET (CMAKE_CXX_COMPILER "${DEVROOT}/bin/arm-none-eabi-g++.exe")<br>
        <br>
        SET (CMAKE_C_FLAGS "-nostartfiles")<br>
        SET (CMAKE_CXX_FLAGS "-nostartfiles")<br>
        SET (CMAKE_EXE_LINKER_FLAGS "-nostartfiles")<br>
        <br>
        INCLUDE_DIRECTORIES(SYSTEM "${DEVROOT}/arm-none-eabi/include")<br>
        LINK_DIRECTORIES("${DEVROOT}/arm-none-eabi/lib")<br>
        <br>
        SET (CMAKE_FIND_ROOT_PATH "${DEVROOT}" )<br>
        SET (CMAKE_FIND_ROOT_PATH_MODE_PROGRAM BOTH)<br>
        SET (CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY)<br>
        SET (CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY)<br>
        <br>
        And CMaleLists.txt with content:<br>
        <br>
        PROJECT(TEST)<br>
        <br>
        cmake_minimum_required(VERSION 2.8)<br>
        ADD_EXECUTABLE(test main.c)<br>
        target_link_libraries(test)<br>
        <br>
        <br>
      </span></span><span id="result_box" class="" lang="en"><span
        class="hps">Tell me,</span> <span class="hps">is there any</span>
      <span class="hps">solution to this problem</span><span>?</span> <span
        class="hps">How do I</span> <span class="hps">add this</span> <span
        class="hps">LDFLAG</span> <span class="hps">at the testing
        stage</span><span>?<br>
      </span></span><span id="result_box" class="short_text" lang="en"><span
        class="hps">Or</span> <span class="hps">maybe there is</span> <span
        class="hps">another solution</span><span class="">?<br>
        <br>
        Best regards,<br>
        Denis<br>
      </span></span>
  </body>
</html>