[Cmake] Trouble with missing linker flags
Mathews, Rob
rmathews at envoyww . com
Wed, 24 Sep 2003 10:51:21 -0400
Reading the code, it looks very much like I could use the variable
"LINK_FLAGS" in order to set the flags globally. However, it also looks like
there is a missing test in and around lines 398 of
VisualStudio7Generator.cxx. Those lines read something like below. They seem
to have a test for every target type EXCEPT cmTarget::WIN32_EXECUTABLE.
<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
std::string extraLinkOptions;
if(target.GetType() == cmTarget::EXECUTABLE)
{
extraLinkOptions = m_Makefile->GetDefinition("CMAKE_EXE_LINKER_FLAGS");
}
if(target.GetType() == cmTarget::SHARED_LIBRARY)
{
extraLinkOptions =
m_Makefile->GetDefinition("CMAKE_SHARED_LINKER_FLAGS");
}
if(target.GetType() == cmTarget::MODULE_LIBRARY)
{
extraLinkOptions =
m_Makefile->GetDefinition("CMAKE_MODULE_LINKER_FLAGS");
}
>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
> -----Original Message-----
> From: Mathews, Rob [mailto:rmathews at envoyww . com]
> Sent: Wednesday, September 24, 2003 10:29 AM
> To: cmake at www . cmake . org
> Subject: [Cmake] Trouble with missing linker flags
>
>
> I'm noticing that when I specify CMAKE_EXE_LINKER_FLAGS like this:
>
> SET(CMAKE_EXE_LINKER_FLAGS ${LINK_FLAGS} CACHE STRING "Flags
> used by the
> linker during the creation of exe's." FORCE)
> SET(CMAKE_SHARED_LINKER_FLAGS ${LINK_FLAGS} CACHE STRING
> "Flags used by the
> linker during the creation of dll's." FORCE)
>
> that they are used for regular executables specified like this:
>
> ADD_EXECUTABLE(foo ${SRC})
>
> but for executables with the "WIN32" option, the linker flags
> are missing.
>
> ie something like this is missing all the linker options:
>
> ADD_EXECUTABLE(bar WIN32 ${SRC})
>
> If you look in the project, "AdditionalOptions" for the
> VCLinkerTool is
> empty.
>
> The target is .NET 2003, cmake is version 1.8.1
>
> Any thoughts?
>
> Rob.
> _______________________________________________
> Cmake mailing list
> Cmake at www . cmake . org
> http://www . cmake . org/mailman/listinfo/cmake
>