BUG: Fixed flag-to-vcproj-attribute conversion code to work again (it was broken by the optimization changes). Added conversion of /nologo flag to SuppressStartupBanner attribute and /Gy flag to EnableFunctionLevelLinking attribute.

This commit is contained in:
Brad King 2005-11-18 10:36:52 -05:00
parent a9c2ff474e
commit 036a78056c
4 changed files with 47 additions and 41 deletions

View File

@ -4,9 +4,14 @@ INCLUDE( ${CMAKE_BINARY_DIR}/CMakeFiles/CMakeCPlatform.cmake OPTIONAL)
SET(CMAKE_LIBRARY_PATH_FLAG "-LIBPATH:") SET(CMAKE_LIBRARY_PATH_FLAG "-LIBPATH:")
SET(CMAKE_LINK_LIBRARY_FLAG "") SET(CMAKE_LINK_LIBRARY_FLAG "")
SET(WIN32 1) SET(WIN32 1)
IF(CMAKE_VERBOSE_MAKEFILE)
SET(CMAKE_CL_NOLOGO)
ELSE(CMAKE_VERBOSE_MAKEFILE)
SET(CMAKE_CL_NOLOGO "/nologo")
ENDIF(CMAKE_VERBOSE_MAKEFILE)
# create a shared C++ library # create a shared C++ library
SET(CMAKE_CXX_CREATE_SHARED_LIBRARY SET(CMAKE_CXX_CREATE_SHARED_LIBRARY
"link /nologo ${CMAKE_START_TEMP_FILE} /out:<TARGET> /dll <LINK_FLAGS> <OBJECTS> <LINK_LIBRARIES> ${CMAKE_END_TEMP_FILE}") "link ${CMAKE_CL_NOLOGO} ${CMAKE_START_TEMP_FILE} /out:<TARGET> /dll <LINK_FLAGS> <OBJECTS> <LINK_LIBRARIES> ${CMAKE_END_TEMP_FILE}")
SET(CMAKE_CXX_CREATE_SHARED_MODULE ${CMAKE_CXX_CREATE_SHARED_LIBRARY}) SET(CMAKE_CXX_CREATE_SHARED_MODULE ${CMAKE_CXX_CREATE_SHARED_LIBRARY})
@ -18,25 +23,25 @@ SET(CMAKE_C_CREATE_SHARED_MODULE ${CMAKE_C_CREATE_SHARED_LIBRARY})
# create a C++ static library # create a C++ static library
SET(CMAKE_CXX_CREATE_STATIC_LIBRARY "lib /nologo <LINK_FLAGS> /out:<TARGET> <OBJECTS> ") SET(CMAKE_CXX_CREATE_STATIC_LIBRARY "lib ${CMAKE_CL_NOLOGO} <LINK_FLAGS> /out:<TARGET> <OBJECTS> ")
# create a C static library # create a C static library
SET(CMAKE_C_CREATE_STATIC_LIBRARY ${CMAKE_CXX_CREATE_STATIC_LIBRARY}) SET(CMAKE_C_CREATE_STATIC_LIBRARY ${CMAKE_CXX_CREATE_STATIC_LIBRARY})
# compile a C++ file into an object file # compile a C++ file into an object file
SET(CMAKE_CXX_COMPILE_OBJECT SET(CMAKE_CXX_COMPILE_OBJECT
"<CMAKE_CXX_COMPILER> ${CMAKE_START_TEMP_FILE} /nologo <FLAGS> /TP -DWIN32 /Fo<OBJECT> -c <SOURCE>${CMAKE_END_TEMP_FILE}") "<CMAKE_CXX_COMPILER> ${CMAKE_START_TEMP_FILE} ${CMAKE_CL_NOLOGO} <FLAGS> /TP -DWIN32 /Fo<OBJECT> -c <SOURCE>${CMAKE_END_TEMP_FILE}")
# compile a C file into an object file # compile a C file into an object file
SET(CMAKE_C_COMPILE_OBJECT SET(CMAKE_C_COMPILE_OBJECT
"<CMAKE_C_COMPILER> ${CMAKE_START_TEMP_FILE} /nologo <FLAGS> -DWIN32 /Fo<OBJECT> -c <SOURCE>${CMAKE_END_TEMP_FILE}") "<CMAKE_C_COMPILER> ${CMAKE_START_TEMP_FILE} ${CMAKE_CL_NOLOGO} <FLAGS> -DWIN32 /Fo<OBJECT> -c <SOURCE>${CMAKE_END_TEMP_FILE}")
SET(CMAKE_C_LINK_EXECUTABLE SET(CMAKE_C_LINK_EXECUTABLE
"<CMAKE_C_COMPILER> /nologo ${CMAKE_START_TEMP_FILE} <FLAGS> <OBJECTS> /Fe<TARGET> -link <CMAKE_C_LINK_FLAGS> <LINK_FLAGS> <LINK_LIBRARIES>${CMAKE_END_TEMP_FILE}") "<CMAKE_C_COMPILER> ${CMAKE_CL_NOLOGO} ${CMAKE_START_TEMP_FILE} <FLAGS> <OBJECTS> /Fe<TARGET> -link <CMAKE_C_LINK_FLAGS> <LINK_FLAGS> <LINK_LIBRARIES>${CMAKE_END_TEMP_FILE}")
SET(CMAKE_CXX_LINK_EXECUTABLE SET(CMAKE_CXX_LINK_EXECUTABLE
"<CMAKE_CXX_COMPILER> /nologo ${CMAKE_START_TEMP_FILE} <FLAGS> <OBJECTS> /Fe<TARGET> -link <CMAKE_CXX_LINK_FLAGS> <LINK_FLAGS> <LINK_LIBRARIES>${CMAKE_END_TEMP_FILE}") "<CMAKE_CXX_COMPILER> ${CMAKE_CL_NOLOGO} ${CMAKE_START_TEMP_FILE} <FLAGS> <OBJECTS> /Fe<TARGET> -link <CMAKE_CXX_LINK_FLAGS> <LINK_FLAGS> <LINK_LIBRARIES>${CMAKE_END_TEMP_FILE}")
SET(CMAKE_CREATE_WIN32_EXE /subsystem:windows) SET(CMAKE_CREATE_WIN32_EXE /subsystem:windows)
SET(CMAKE_CREATE_CONSOLE_EXE /subsystem:console) SET(CMAKE_CREATE_CONSOLE_EXE /subsystem:console)

View File

@ -1,9 +1,14 @@
SET(CMAKE_LIBRARY_PATH_FLAG "-LIBPATH:") SET(CMAKE_LIBRARY_PATH_FLAG "-LIBPATH:")
SET(CMAKE_LINK_LIBRARY_FLAG "") SET(CMAKE_LINK_LIBRARY_FLAG "")
SET(WIN32 1) SET(WIN32 1)
IF(CMAKE_VERBOSE_MAKEFILE)
SET(CMAKE_CL_NOLOGO)
ELSE(CMAKE_VERBOSE_MAKEFILE)
SET(CMAKE_CL_NOLOGO "/nologo")
ENDIF(CMAKE_VERBOSE_MAKEFILE)
# create a shared C++ library # create a shared C++ library
SET(CMAKE_CXX_CREATE_SHARED_LIBRARY SET(CMAKE_CXX_CREATE_SHARED_LIBRARY
"link /nologo ${CMAKE_START_TEMP_FILE} /out:<TARGET> /dll <LINK_FLAGS> <OBJECTS> <LINK_LIBRARIES> ${CMAKE_END_TEMP_FILE}") "link ${CMAKE_CL_NOLOGO} ${CMAKE_START_TEMP_FILE} /out:<TARGET> /dll <LINK_FLAGS> <OBJECTS> <LINK_LIBRARIES> ${CMAKE_END_TEMP_FILE}")
SET(CMAKE_CXX_CREATE_SHARED_MODULE ${CMAKE_CXX_CREATE_SHARED_LIBRARY}) SET(CMAKE_CXX_CREATE_SHARED_MODULE ${CMAKE_CXX_CREATE_SHARED_LIBRARY})
@ -15,27 +20,27 @@ SET(CMAKE_C_CREATE_SHARED_MODULE ${CMAKE_C_CREATE_SHARED_LIBRARY})
# create a C++ static library # create a C++ static library
SET(CMAKE_CXX_CREATE_STATIC_LIBRARY "lib /nologo <LINK_FLAGS> /out:<TARGET> <OBJECTS> ") SET(CMAKE_CXX_CREATE_STATIC_LIBRARY "lib ${CMAKE_CL_NOLOGO} <LINK_FLAGS> /out:<TARGET> <OBJECTS> ")
# create a C static library # create a C static library
SET(CMAKE_C_CREATE_STATIC_LIBRARY ${CMAKE_CXX_CREATE_STATIC_LIBRARY}) SET(CMAKE_C_CREATE_STATIC_LIBRARY ${CMAKE_CXX_CREATE_STATIC_LIBRARY})
# compile a C++ file into an object file # compile a C++ file into an object file
SET(CMAKE_CXX_COMPILE_OBJECT SET(CMAKE_CXX_COMPILE_OBJECT
"<CMAKE_CXX_COMPILER> ${CMAKE_START_TEMP_FILE} /nologo /TP -DWIN32 /Fo<OBJECT> <FLAGS> -c <SOURCE>${CMAKE_END_TEMP_FILE}") "<CMAKE_CXX_COMPILER> ${CMAKE_START_TEMP_FILE} ${CMAKE_CL_NOLOGO} /TP -DWIN32 /Fo<OBJECT> <FLAGS> -c <SOURCE>${CMAKE_END_TEMP_FILE}")
# compile a C file into an object file # compile a C file into an object file
SET(CMAKE_C_COMPILE_OBJECT SET(CMAKE_C_COMPILE_OBJECT
"<CMAKE_C_COMPILER> ${CMAKE_START_TEMP_FILE} /nologo -DWIN32 /Fo<OBJECT> <FLAGS> -c <SOURCE>${CMAKE_END_TEMP_FILE}") "<CMAKE_C_COMPILER> ${CMAKE_START_TEMP_FILE} ${CMAKE_CL_NOLOGO} -DWIN32 /Fo<OBJECT> <FLAGS> -c <SOURCE>${CMAKE_END_TEMP_FILE}")
SET(CMAKE_C_LINK_EXECUTABLE SET(CMAKE_C_LINK_EXECUTABLE
"<CMAKE_C_COMPILER> /nologo ${CMAKE_START_TEMP_FILE} <FLAGS> <OBJECTS> /Fe<TARGET> -link <CMAKE_C_LINK_FLAGS> <LINK_FLAGS> <LINK_LIBRARIES>${CMAKE_END_TEMP_FILE}") "<CMAKE_C_COMPILER> ${CMAKE_CL_NOLOGO} ${CMAKE_START_TEMP_FILE} <FLAGS> <OBJECTS> /Fe<TARGET> -link <CMAKE_C_LINK_FLAGS> <LINK_FLAGS> <LINK_LIBRARIES>${CMAKE_END_TEMP_FILE}")
SET(CMAKE_COMPILE_RESOURCE "rc <FLAGS> /fo<OBJECT> <SOURCE>") SET(CMAKE_COMPILE_RESOURCE "rc <FLAGS> /fo<OBJECT> <SOURCE>")
SET(CMAKE_CXX_LINK_EXECUTABLE SET(CMAKE_CXX_LINK_EXECUTABLE
"<CMAKE_CXX_COMPILER> /nologo ${CMAKE_START_TEMP_FILE} <FLAGS> <OBJECTS> /Fe<TARGET> -link <CMAKE_CXX_LINK_FLAGS> <LINK_FLAGS> <LINK_LIBRARIES>${CMAKE_END_TEMP_FILE}") "<CMAKE_CXX_COMPILER> ${CMAKE_CL_NOLOGO} ${CMAKE_START_TEMP_FILE} <FLAGS> <OBJECTS> /Fe<TARGET> -link <CMAKE_CXX_LINK_FLAGS> <LINK_FLAGS> <LINK_LIBRARIES>${CMAKE_END_TEMP_FILE}")
SET(CMAKE_CREATE_WIN32_EXE /subsystem:windows) SET(CMAKE_CREATE_WIN32_EXE /subsystem:windows)
SET(CMAKE_CREATE_CONSOLE_EXE /subsystem:console) SET(CMAKE_CREATE_CONSOLE_EXE /subsystem:console)

View File

@ -1,23 +1,28 @@
SET(CMAKE_LIBRARY_PATH_FLAG "-LIBPATH:") SET(CMAKE_LIBRARY_PATH_FLAG "-LIBPATH:")
SET(CMAKE_LINK_LIBRARY_FLAG "") SET(CMAKE_LINK_LIBRARY_FLAG "")
SET(WIN32 1) SET(WIN32 1)
IF(CMAKE_VERBOSE_MAKEFILE)
SET(CMAKE_CL_NOLOGO)
ELSE(CMAKE_VERBOSE_MAKEFILE)
SET(CMAKE_CL_NOLOGO "/nologo")
ENDIF(CMAKE_VERBOSE_MAKEFILE)
SET(CMAKE_Fortran_CREATE_SHARED_LIBRARY SET(CMAKE_Fortran_CREATE_SHARED_LIBRARY
"link /nologo ${CMAKE_START_TEMP_FILE} /out:<TARGET> /dll <LINK_FLAGS> <OBJECTS> <LINK_LIBRARIES> ${CMAKE_END_TEMP_FILE}") "link ${CMAKE_CL_NOLOGO} ${CMAKE_START_TEMP_FILE} /out:<TARGET> /dll <LINK_FLAGS> <OBJECTS> <LINK_LIBRARIES> ${CMAKE_END_TEMP_FILE}")
SET(CMAKE_Fortran_CREATE_SHARED_MODULE ${CMAKE_Fortran_CREATE_SHARED_LIBRARY}) SET(CMAKE_Fortran_CREATE_SHARED_MODULE ${CMAKE_Fortran_CREATE_SHARED_LIBRARY})
# create a C++ static library # create a C++ static library
SET(CMAKE_Fortran_CREATE_STATIC_LIBRARY "lib /nologo <LINK_FLAGS> /out:<TARGET> <OBJECTS> ") SET(CMAKE_Fortran_CREATE_STATIC_LIBRARY "lib ${CMAKE_CL_NOLOGO} <LINK_FLAGS> /out:<TARGET> <OBJECTS> ")
# compile a C++ file into an object file # compile a C++ file into an object file
SET(CMAKE_Fortran_COMPILE_OBJECT SET(CMAKE_Fortran_COMPILE_OBJECT
"<CMAKE_Fortran_COMPILER> ${CMAKE_START_TEMP_FILE} /nologo /Fo<OBJECT> <FLAGS> -c <SOURCE>${CMAKE_END_TEMP_FILE}") "<CMAKE_Fortran_COMPILER> ${CMAKE_START_TEMP_FILE} ${CMAKE_CL_NOLOGO} /Fo<OBJECT> <FLAGS> -c <SOURCE>${CMAKE_END_TEMP_FILE}")
SET(CMAKE_COMPILE_RESOURCE "rc <FLAGS> /fo<OBJECT> <SOURCE>") SET(CMAKE_COMPILE_RESOURCE "rc <FLAGS> /fo<OBJECT> <SOURCE>")
SET(CMAKE_Fortran_LINK_EXECUTABLE SET(CMAKE_Fortran_LINK_EXECUTABLE
"<CMAKE_Fortran_COMPILER> /nologo ${CMAKE_START_TEMP_FILE} <FLAGS> <OBJECTS> /Fe<TARGET> -link <CMAKE_Fortran_LINK_FLAGS> <LINK_FLAGS> <LINK_LIBRARIES>${CMAKE_END_TEMP_FILE}") "<CMAKE_Fortran_COMPILER> ${CMAKE_CL_NOLOGO} ${CMAKE_START_TEMP_FILE} <FLAGS> <OBJECTS> /Fe<TARGET> -link <CMAKE_Fortran_LINK_FLAGS> <LINK_FLAGS> <LINK_LIBRARIES>${CMAKE_END_TEMP_FILE}")
SET(CMAKE_CREATE_WIN32_EXE /subsystem:windows) SET(CMAKE_CREATE_WIN32_EXE /subsystem:windows)
SET(CMAKE_CREATE_CONSOLE_EXE /subsystem:console) SET(CMAKE_CREATE_CONSOLE_EXE /subsystem:console)

View File

@ -254,6 +254,7 @@ cmVS7FlagTable cmLocalVisualStudio7GeneratorFlagTable[] =
// boolean flags // boolean flags
{"BufferSecurityCheck", "GS", "Buffer security check", "TRUE"}, {"BufferSecurityCheck", "GS", "Buffer security check", "TRUE"},
{"EnableFibreSafeOptimization", "GT", "OmitFramePointers", "TRUE"}, {"EnableFibreSafeOptimization", "GT", "OmitFramePointers", "TRUE"},
{"EnableFunctionLevelLinking", "Gy", "EnableFunctionLevelLinking", "TRUE"},
{"EnableIntrinsicFunctions", "Oi", "EnableIntrinsicFunctions", "TRUE"}, {"EnableIntrinsicFunctions", "Oi", "EnableIntrinsicFunctions", "TRUE"},
{"ExceptionHandling", "EHsc", "enable c++ exceptions", "TRUE"}, {"ExceptionHandling", "EHsc", "enable c++ exceptions", "TRUE"},
{"ExceptionHandling", "GX", "enable c++ exceptions", "TRUE"}, {"ExceptionHandling", "GX", "enable c++ exceptions", "TRUE"},
@ -264,6 +265,7 @@ cmVS7FlagTable cmLocalVisualStudio7GeneratorFlagTable[] =
{"OptimizeForWindowsApplication", "GA", "Optimize for windows", "TRUE"}, {"OptimizeForWindowsApplication", "GA", "Optimize for windows", "TRUE"},
{"RuntimeTypeInfo", "GR", "Turn on Run time type information for c++", "TRUE"}, {"RuntimeTypeInfo", "GR", "Turn on Run time type information for c++", "TRUE"},
{"SmallerTypeCheck", "RTCc", "smaller type check", "TRUE"}, {"SmallerTypeCheck", "RTCc", "smaller type check", "TRUE"},
{"SuppressStartupBanner", "nologo", "SuppressStartupBanner", "TRUE"},
{"WarnAsError", "WX", "Treat warnings as errors", "TRUE"}, {"WarnAsError", "WX", "Treat warnings as errors", "TRUE"},
{0,0,0,0 } {0,0,0,0 }
}; };
@ -513,11 +515,6 @@ void cmLocalVisualStudio7Generator::WriteConfiguration(std::ostream& fout,
fout << "\"\n"; fout << "\"\n";
fout << "\t\t\t\tAssemblerListingLocation=\"" << configName << "\"\n"; fout << "\t\t\t\tAssemblerListingLocation=\"" << configName << "\"\n";
fout << "\t\t\t\tObjectFile=\"$(IntDir)\\\"\n"; fout << "\t\t\t\tObjectFile=\"$(IntDir)\\\"\n";
if(m_Makefile->IsOn("CMAKE_VERBOSE_MAKEFILE"))
{
fout << "\t\t\t\tSuppressStartupBanner=\"FALSE\"\n";
}
if(programDatabase.size()) if(programDatabase.size())
{ {
fout << programDatabase << "\n"; fout << programDatabase << "\n";
@ -551,8 +548,9 @@ void cmLocalVisualStudio7Generator::FillFlagMapFromCommandFlags(
std::string option; std::string option;
while(flagTable->IDEName) while(flagTable->IDEName)
{ {
option.reserve(strlen(flagTable->commandFlag+2)); option.reserve(strlen(flagTable->commandFlag)+2);
// first do the - version // first do the - version
option.clear();
option.insert(static_cast<std::string::size_type>(0), option.insert(static_cast<std::string::size_type>(0),
static_cast<std::string::size_type>(1), static_cast<std::string::size_type>(1),
'-'); '-');
@ -576,6 +574,18 @@ void cmLocalVisualStudio7Generator::FillFlagMapFromCommandFlags(
// move to next flag // move to next flag
flagTable++; flagTable++;
} }
// If verbose makefiles have been requested and the /nologo option
// was not given explicitly in the flags we want to add an attribute
// to the generated project to disable logo suppression. Otherwise
// the GUI default is to enable suppression.
if(m_Makefile->IsOn("CMAKE_VERBOSE_MAKEFILE"))
{
if(flagMap.find("SuppressStartupBanner") == flagMap.end())
{
flagMap["SuppressStartupBanner"] = "FALSE";
}
}
} }
@ -663,16 +673,6 @@ void cmLocalVisualStudio7Generator::OutputBuildTool(std::ostream& fout,
{ {
fout << "\t\t\t\t" << i->first << "=\"" << i->second << "\"\n"; fout << "\t\t\t\t" << i->first << "=\"" << i->second << "\"\n";
} }
if(m_Makefile->IsOn("CMAKE_VERBOSE_MAKEFILE"))
{
fout << "\t\t\t\tSuppressStartupBanner=\"FALSE\"\n";
}
else
{
fout << "\t\t\t\tSuppressStartupBanner=\"TRUE\"\n";
}
fout << "\t\t\t\tAdditionalLibraryDirectories=\""; fout << "\t\t\t\tAdditionalLibraryDirectories=\"";
this->OutputLibraryDirectories(fout, configName, libName, target); this->OutputLibraryDirectories(fout, configName, libName, target);
fout << "\"\n"; fout << "\"\n";
@ -751,15 +751,6 @@ void cmLocalVisualStudio7Generator::OutputBuildTool(std::ostream& fout,
{ {
fout << "\t\t\t\t" << i->first << "=\"" << i->second << "\"\n"; fout << "\t\t\t\t" << i->first << "=\"" << i->second << "\"\n";
} }
if(m_Makefile->IsOn("CMAKE_VERBOSE_MAKEFILE"))
{
fout << "\t\t\t\tSuppressStartupBanner=\"FALSE\"\n";
}
else
{
fout << "\t\t\t\tSuppressStartupBanner=\"TRUE\"\n";
}
fout << "\t\t\t\tAdditionalLibraryDirectories=\""; fout << "\t\t\t\tAdditionalLibraryDirectories=\"";
this->OutputLibraryDirectories(fout, configName, libName, target); this->OutputLibraryDirectories(fout, configName, libName, target);
fout << "\"\n"; fout << "\"\n";