<div dir="ltr">Hi,<div><br></div><div>I'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'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 "<FLAGS>" parameter in</div><div style><br></div><div style><div> set(CMAKE_C_LINK_EXECUTABLE "<CMAKE_C_COMPILER> <FLAGS> <CMAKE_C_LINK_FLAGS> <LINK_FLAGS> <OBJECTS> -o <TARGET> -nostdlib -nostartfiles -L${ECOS_LIBTARGET_DIRECTORY} -Ttarget.ld <LINK_LIBRARIES>")</div>
<div><br></div><div style>defined with CMake's Modules/Platform/eCos.cmake file (line 56).</div><div style><br></div><div style>As it seems there is no way to tweak <FLAGS> 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'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've not been able to find a working solution.</div>
<div style><br></div><div style>BTW, what does mean the <...> 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>