<div dir="ltr">Hi,<div><br></div><div>I&#39;m using CMake (2.8.10.1) to cross-compile from OS X and Linux x86_64 hosts to ARM EABI platform running eCos.</div><div><br></div><div style>I&#39;m looking for a way (and if possible, a clean one ;-)) to define C compiler flags that are not propagated to the final link stage.</div>
<div style><br></div><div style>My current CMake files use:</div><div style><br></div><div style><div>SET (CMAKE_SYSTEM_NAME eCos)</div><div style>  then</div><div style>SET (CMAKE_C_FLAGS …)</div><div style><br></div><div style>
It seems that the CMAKE_C_FLAGS is also expanded into the link command line, that is the &quot;&lt;FLAGS&gt;&quot; parameter in</div><div style><br></div><div style><div>  set(CMAKE_C_LINK_EXECUTABLE    &quot;&lt;CMAKE_C_COMPILER&gt;   &lt;FLAGS&gt; &lt;CMAKE_C_LINK_FLAGS&gt;   &lt;LINK_FLAGS&gt; &lt;OBJECTS&gt; -o &lt;TARGET&gt; -nostdlib -nostartfiles -L${ECOS_LIBTARGET_DIRECTORY} -Ttarget.ld  &lt;LINK_LIBRARIES&gt;&quot;)</div>
<div><br></div><div style>defined with CMake&#39;s Modules/Platform/eCos.cmake file (line 56).</div><div style><br></div><div style>As it seems there is no way to tweak &lt;FLAGS&gt; here, I guess there is a better way to define compiler C flags that are distinct from the linker flags. In other word, I guess I should not use CMAKE_C_FLAGS but another variable to define the flags that should appear at compile time but not at link time.</div>
<div style><br></div><div style>Anyway, any piece of advice would be warmly welcomed, as I&#39;m unable to find a clue within the documentation.</div><div style>It seems there are many way to deal with compiler flags, I tried several of them (inclusing the TARGET properties) but I&#39;ve not been able to find a working solution.</div>
<div style><br></div><div style>BTW, what does mean the &lt;...&gt; modifiers (rather than the common ${...} one) ? Can/could they be changed ?</div><div style><br></div><div style>Thanks in advance,</div><div style>Manu</div>
<div style><br></div><div><br></div></div></div></div>