From 036a78056c4a0ba82ccb01438597f6847b681011 Mon Sep 17 00:00:00 2001 From: Brad King Date: Fri, 18 Nov 2005 10:36:52 -0500 Subject: 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. --- Modules/Platform/Windows-cl.cmake | 17 ++++++++----- Modules/Platform/Windows-icl.cmake | 17 ++++++++----- Modules/Platform/Windows-ifort.cmake | 13 ++++++---- Source/cmLocalVisualStudio7Generator.cxx | 41 +++++++++++++------------------- 4 files changed, 47 insertions(+), 41 deletions(-) diff --git a/Modules/Platform/Windows-cl.cmake b/Modules/Platform/Windows-cl.cmake index 87f905d..a0b9876 100644 --- a/Modules/Platform/Windows-cl.cmake +++ b/Modules/Platform/Windows-cl.cmake @@ -4,9 +4,14 @@ INCLUDE( ${CMAKE_BINARY_DIR}/CMakeFiles/CMakeCPlatform.cmake OPTIONAL) SET(CMAKE_LIBRARY_PATH_FLAG "-LIBPATH:") SET(CMAKE_LINK_LIBRARY_FLAG "") 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 SET(CMAKE_CXX_CREATE_SHARED_LIBRARY - "link /nologo ${CMAKE_START_TEMP_FILE} /out: /dll ${CMAKE_END_TEMP_FILE}") + "link ${CMAKE_CL_NOLOGO} ${CMAKE_START_TEMP_FILE} /out: /dll ${CMAKE_END_TEMP_FILE}") 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 -SET(CMAKE_CXX_CREATE_STATIC_LIBRARY "lib /nologo /out: ") +SET(CMAKE_CXX_CREATE_STATIC_LIBRARY "lib ${CMAKE_CL_NOLOGO} /out: ") # create a C static library SET(CMAKE_C_CREATE_STATIC_LIBRARY ${CMAKE_CXX_CREATE_STATIC_LIBRARY}) # compile a C++ file into an object file SET(CMAKE_CXX_COMPILE_OBJECT - " ${CMAKE_START_TEMP_FILE} /nologo /TP -DWIN32 /Fo -c ${CMAKE_END_TEMP_FILE}") + " ${CMAKE_START_TEMP_FILE} ${CMAKE_CL_NOLOGO} /TP -DWIN32 /Fo -c ${CMAKE_END_TEMP_FILE}") # compile a C file into an object file SET(CMAKE_C_COMPILE_OBJECT - " ${CMAKE_START_TEMP_FILE} /nologo -DWIN32 /Fo -c ${CMAKE_END_TEMP_FILE}") + " ${CMAKE_START_TEMP_FILE} ${CMAKE_CL_NOLOGO} -DWIN32 /Fo -c ${CMAKE_END_TEMP_FILE}") SET(CMAKE_C_LINK_EXECUTABLE - " /nologo ${CMAKE_START_TEMP_FILE} /Fe -link ${CMAKE_END_TEMP_FILE}") + " ${CMAKE_CL_NOLOGO} ${CMAKE_START_TEMP_FILE} /Fe -link ${CMAKE_END_TEMP_FILE}") SET(CMAKE_CXX_LINK_EXECUTABLE - " /nologo ${CMAKE_START_TEMP_FILE} /Fe -link ${CMAKE_END_TEMP_FILE}") + " ${CMAKE_CL_NOLOGO} ${CMAKE_START_TEMP_FILE} /Fe -link ${CMAKE_END_TEMP_FILE}") SET(CMAKE_CREATE_WIN32_EXE /subsystem:windows) SET(CMAKE_CREATE_CONSOLE_EXE /subsystem:console) diff --git a/Modules/Platform/Windows-icl.cmake b/Modules/Platform/Windows-icl.cmake index 5d61903..bad8949 100644 --- a/Modules/Platform/Windows-icl.cmake +++ b/Modules/Platform/Windows-icl.cmake @@ -1,9 +1,14 @@ SET(CMAKE_LIBRARY_PATH_FLAG "-LIBPATH:") SET(CMAKE_LINK_LIBRARY_FLAG "") 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 SET(CMAKE_CXX_CREATE_SHARED_LIBRARY - "link /nologo ${CMAKE_START_TEMP_FILE} /out: /dll ${CMAKE_END_TEMP_FILE}") + "link ${CMAKE_CL_NOLOGO} ${CMAKE_START_TEMP_FILE} /out: /dll ${CMAKE_END_TEMP_FILE}") 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 -SET(CMAKE_CXX_CREATE_STATIC_LIBRARY "lib /nologo /out: ") +SET(CMAKE_CXX_CREATE_STATIC_LIBRARY "lib ${CMAKE_CL_NOLOGO} /out: ") # create a C static library SET(CMAKE_C_CREATE_STATIC_LIBRARY ${CMAKE_CXX_CREATE_STATIC_LIBRARY}) # compile a C++ file into an object file SET(CMAKE_CXX_COMPILE_OBJECT - " ${CMAKE_START_TEMP_FILE} /nologo /TP -DWIN32 /Fo -c ${CMAKE_END_TEMP_FILE}") + " ${CMAKE_START_TEMP_FILE} ${CMAKE_CL_NOLOGO} /TP -DWIN32 /Fo -c ${CMAKE_END_TEMP_FILE}") # compile a C file into an object file SET(CMAKE_C_COMPILE_OBJECT - " ${CMAKE_START_TEMP_FILE} /nologo -DWIN32 /Fo -c ${CMAKE_END_TEMP_FILE}") + " ${CMAKE_START_TEMP_FILE} ${CMAKE_CL_NOLOGO} -DWIN32 /Fo -c ${CMAKE_END_TEMP_FILE}") SET(CMAKE_C_LINK_EXECUTABLE - " /nologo ${CMAKE_START_TEMP_FILE} /Fe -link ${CMAKE_END_TEMP_FILE}") + " ${CMAKE_CL_NOLOGO} ${CMAKE_START_TEMP_FILE} /Fe -link ${CMAKE_END_TEMP_FILE}") SET(CMAKE_COMPILE_RESOURCE "rc /fo ") SET(CMAKE_CXX_LINK_EXECUTABLE - " /nologo ${CMAKE_START_TEMP_FILE} /Fe -link ${CMAKE_END_TEMP_FILE}") + " ${CMAKE_CL_NOLOGO} ${CMAKE_START_TEMP_FILE} /Fe -link ${CMAKE_END_TEMP_FILE}") SET(CMAKE_CREATE_WIN32_EXE /subsystem:windows) SET(CMAKE_CREATE_CONSOLE_EXE /subsystem:console) diff --git a/Modules/Platform/Windows-ifort.cmake b/Modules/Platform/Windows-ifort.cmake index 7665422..a152864 100644 --- a/Modules/Platform/Windows-ifort.cmake +++ b/Modules/Platform/Windows-ifort.cmake @@ -1,23 +1,28 @@ SET(CMAKE_LIBRARY_PATH_FLAG "-LIBPATH:") SET(CMAKE_LINK_LIBRARY_FLAG "") 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 - "link /nologo ${CMAKE_START_TEMP_FILE} /out: /dll ${CMAKE_END_TEMP_FILE}") + "link ${CMAKE_CL_NOLOGO} ${CMAKE_START_TEMP_FILE} /out: /dll ${CMAKE_END_TEMP_FILE}") SET(CMAKE_Fortran_CREATE_SHARED_MODULE ${CMAKE_Fortran_CREATE_SHARED_LIBRARY}) # create a C++ static library -SET(CMAKE_Fortran_CREATE_STATIC_LIBRARY "lib /nologo /out: ") +SET(CMAKE_Fortran_CREATE_STATIC_LIBRARY "lib ${CMAKE_CL_NOLOGO} /out: ") # compile a C++ file into an object file SET(CMAKE_Fortran_COMPILE_OBJECT - " ${CMAKE_START_TEMP_FILE} /nologo /Fo -c ${CMAKE_END_TEMP_FILE}") + " ${CMAKE_START_TEMP_FILE} ${CMAKE_CL_NOLOGO} /Fo -c ${CMAKE_END_TEMP_FILE}") SET(CMAKE_COMPILE_RESOURCE "rc /fo ") SET(CMAKE_Fortran_LINK_EXECUTABLE - " /nologo ${CMAKE_START_TEMP_FILE} /Fe -link ${CMAKE_END_TEMP_FILE}") + " ${CMAKE_CL_NOLOGO} ${CMAKE_START_TEMP_FILE} /Fe -link ${CMAKE_END_TEMP_FILE}") SET(CMAKE_CREATE_WIN32_EXE /subsystem:windows) SET(CMAKE_CREATE_CONSOLE_EXE /subsystem:console) diff --git a/Source/cmLocalVisualStudio7Generator.cxx b/Source/cmLocalVisualStudio7Generator.cxx index fb307d7..d038040 100644 --- a/Source/cmLocalVisualStudio7Generator.cxx +++ b/Source/cmLocalVisualStudio7Generator.cxx @@ -254,6 +254,7 @@ cmVS7FlagTable cmLocalVisualStudio7GeneratorFlagTable[] = // boolean flags {"BufferSecurityCheck", "GS", "Buffer security check", "TRUE"}, {"EnableFibreSafeOptimization", "GT", "OmitFramePointers", "TRUE"}, + {"EnableFunctionLevelLinking", "Gy", "EnableFunctionLevelLinking", "TRUE"}, {"EnableIntrinsicFunctions", "Oi", "EnableIntrinsicFunctions", "TRUE"}, {"ExceptionHandling", "EHsc", "enable c++ exceptions", "TRUE"}, {"ExceptionHandling", "GX", "enable c++ exceptions", "TRUE"}, @@ -264,6 +265,7 @@ cmVS7FlagTable cmLocalVisualStudio7GeneratorFlagTable[] = {"OptimizeForWindowsApplication", "GA", "Optimize for windows", "TRUE"}, {"RuntimeTypeInfo", "GR", "Turn on Run time type information for c++", "TRUE"}, {"SmallerTypeCheck", "RTCc", "smaller type check", "TRUE"}, + {"SuppressStartupBanner", "nologo", "SuppressStartupBanner", "TRUE"}, {"WarnAsError", "WX", "Treat warnings as errors", "TRUE"}, {0,0,0,0 } }; @@ -513,11 +515,6 @@ void cmLocalVisualStudio7Generator::WriteConfiguration(std::ostream& fout, fout << "\"\n"; fout << "\t\t\t\tAssemblerListingLocation=\"" << configName << "\"\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()) { fout << programDatabase << "\n"; @@ -551,8 +548,9 @@ void cmLocalVisualStudio7Generator::FillFlagMapFromCommandFlags( std::string option; while(flagTable->IDEName) { - option.reserve(strlen(flagTable->commandFlag+2)); + option.reserve(strlen(flagTable->commandFlag)+2); // first do the - version + option.clear(); option.insert(static_cast(0), static_cast(1), '-'); @@ -576,6 +574,18 @@ void cmLocalVisualStudio7Generator::FillFlagMapFromCommandFlags( // move to next flag 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"; } - - 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=\""; this->OutputLibraryDirectories(fout, configName, libName, target); fout << "\"\n"; @@ -751,15 +751,6 @@ void cmLocalVisualStudio7Generator::OutputBuildTool(std::ostream& fout, { 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=\""; this->OutputLibraryDirectories(fout, configName, libName, target); fout << "\"\n"; -- cgit v0.12