diff options
author | Brad King <brad.king@kitware.com> | 2019-01-29 14:19:31 (GMT) |
---|---|---|
committer | Kitware Robot <kwrobot@kitware.com> | 2019-01-29 14:19:39 (GMT) |
commit | 9620cb935a49e7b4955f5b1d0ffa2e93b4327591 (patch) | |
tree | d0e011b3649793502929e4e0597b6d636fdc57ec /Source/cmGlobalVisualStudio10Generator.cxx | |
parent | 60c06620a690f0cbeeaa3fba762e19cd031669ca (diff) | |
parent | 66801f4d40227c46904ad54848bd1da959604cbf (diff) | |
download | CMake-9620cb935a49e7b4955f5b1d0ffa2e93b4327591.zip CMake-9620cb935a49e7b4955f5b1d0ffa2e93b4327591.tar.gz CMake-9620cb935a49e7b4955f5b1d0ffa2e93b4327591.tar.bz2 |
Merge topic 'add_consistent_verbose_build_flag'
66801f4d40 cmake: Add tests for verbose output to --build mode
439fe2e253 cmake: Add options for verbose output to --build mode
638667efa2 cmake: cmcmd.cxx fix "The arguments are" comments
3ca4402966 ctest: Fix --build-and-test without --build-target on Xcode
cb6c233ecc cmake: Add -hideShellScriptEnvironment xcodebuild option
1a45266cb5 cmGlobalGenerator: Add a class that represent the build command
Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !2708
Diffstat (limited to 'Source/cmGlobalVisualStudio10Generator.cxx')
-rw-r--r-- | Source/cmGlobalVisualStudio10Generator.cxx | 35 |
1 files changed, 21 insertions, 14 deletions
diff --git a/Source/cmGlobalVisualStudio10Generator.cxx b/Source/cmGlobalVisualStudio10Generator.cxx index 99e9173..07656ed 100644 --- a/Source/cmGlobalVisualStudio10Generator.cxx +++ b/Source/cmGlobalVisualStudio10Generator.cxx @@ -879,7 +879,7 @@ bool cmGlobalVisualStudio10Generator::FindVCTargetsPath(cmMakefile* mf) } void cmGlobalVisualStudio10Generator::GenerateBuildCommand( - std::vector<std::string>& makeCommand, const std::string& makeProgram, + GeneratedMakeCommand& makeCommand, const std::string& makeProgram, const std::string& projectName, const std::string& projectDir, const std::string& targetName, const std::string& config, bool fast, int jobs, bool verbose, std::vector<std::string> const& makeOptions) @@ -894,6 +894,10 @@ void cmGlobalVisualStudio10Generator::GenerateBuildCommand( bool useDevEnv = (makeProgramLower.find("devenv") != std::string::npos || makeProgramLower.find("vcexpress") != std::string::npos); + // Workaround to convince VCExpress.exe to produce output. + makeCommand.RequiresOutputForward = + (makeProgramLower.find("vcexpress") != std::string::npos); + // MSBuild is preferred (and required for VS Express), but if the .sln has // an Intel Fortran .vfproj then we have to use devenv. Parse it to find out. cmSlnData slnData; @@ -927,7 +931,7 @@ void cmGlobalVisualStudio10Generator::GenerateBuildCommand( return; } - makeCommand.push_back(makeProgramSelected); + makeCommand.add(makeProgramSelected); std::string realTarget = targetName; // msbuild.exe CxxOnly.sln /t:Build /p:Configuration=Debug /target:ALL_BUILD @@ -936,8 +940,8 @@ void cmGlobalVisualStudio10Generator::GenerateBuildCommand( realTarget = "ALL_BUILD"; } if (realTarget == "clean") { - makeCommand.push_back(std::string(projectName) + ".sln"); - makeCommand.push_back("/t:Clean"); + makeCommand.add(std::string(projectName) + ".sln"); + makeCommand.add("/t:Clean"); } else { std::string targetProject(realTarget); targetProject += ".vcxproj"; @@ -949,7 +953,7 @@ void cmGlobalVisualStudio10Generator::GenerateBuildCommand( cmSystemTools::ConvertToUnixSlashes(targetProject); } } - makeCommand.push_back(targetProject); + makeCommand.add(std::move(targetProject)); } std::string configArg = "/p:Configuration="; if (!config.empty()) { @@ -957,23 +961,26 @@ void cmGlobalVisualStudio10Generator::GenerateBuildCommand( } else { configArg += "Debug"; } - makeCommand.push_back(configArg); - makeCommand.push_back("/p:Platform=" + this->GetPlatformName()); - makeCommand.push_back(std::string("/p:VisualStudioVersion=") + - this->GetIDEVersion()); + makeCommand.add(configArg); + makeCommand.add(std::string("/p:Platform=") + this->GetPlatformName()); + makeCommand.add(std::string("/p:VisualStudioVersion=") + + this->GetIDEVersion()); if (jobs != cmake::NO_BUILD_PARALLEL_LEVEL) { if (jobs == cmake::DEFAULT_BUILD_PARALLEL_LEVEL) { - makeCommand.push_back("/m"); + makeCommand.add("/m"); } else { - makeCommand.push_back(std::string("/m:") + std::to_string(jobs)); + makeCommand.add(std::string("/m:") + std::to_string(jobs)); } // Having msbuild.exe and cl.exe using multiple jobs is discouraged - makeCommand.push_back("/p:CL_MPCount=1"); + makeCommand.add("/p:CL_MPCount=1"); } - makeCommand.insert(makeCommand.end(), makeOptions.begin(), - makeOptions.end()); + // Respect the verbosity: 'n' normal will show build commands + // 'm' minimal only the build step's title + makeCommand.add(std::string("/v:") + ((verbose) ? "n" : "m")); + + makeCommand.add(makeOptions.begin(), makeOptions.end()); } bool cmGlobalVisualStudio10Generator::Find64BitTools(cmMakefile* mf) |