[CMake] LINKER FLAGS

Eric Noulard eric.noulard at gmail.com
Tue Sep 13 05:07:09 EDT 2011


2011/9/13 pellegrini <pellegrini at ill.fr>:
> Hi all,
>
> I would like to build a Fortran90 project using Fortran intel compiler. I
> would like to increase the stack by adding the "/stack"
> flag to the linker.
>
> Looking on the documentation, I think that "set(CMAKE_EXE_LINKERS_FLAG
> /stack:64000000)" will do the job but I was wondering if using this command
> will remove the list of flags that may be set by cmake (behaviour that I
> would like to avoid) or just append it to this list ?

May be you can try?
Beware that "S" is to be put at FLAG**S** and not at LINKER
i.e.
CMAKE_EXE_LINKER_FLAGS
and not
CMAKE_EXE_LINKERS_FLAG


Note that if you can do that on a per-target basis using the LINK_FLAGS property
LINK_FLAGS
       Additional flags to use when linking this target.

       The LINK_FLAGS property can be used to add extra flags to the link
       step of a target.  LINK_FLAGS_<CONFIG> will add to the configuration
       <CONFIG>, for example, DEBUG, RELEASE, MINSIZEREL, RELWITHDEBINFO.

which is just doing what you want that is adds extra flags for this
particular target.

-- 
Erk
Membre de l'April - « promouvoir et défendre le logiciel libre » -
http://www.april.org


More information about the CMake mailing list