Create the command line for building the given target using the selected make
| 718 | // Create the command line for building the given target using the selected |
| 719 | // make |
| 720 | std::string cmExtraCodeBlocksGenerator::BuildMakeCommand( |
| 721 | std::string const& make, std::string const& makefile, |
| 722 | std::string const& target, std::string const& makeFlags) |
| 723 | { |
| 724 | std::string command = make; |
| 725 | if (!makeFlags.empty()) { |
| 726 | command += " "; |
| 727 | command += makeFlags; |
| 728 | } |
| 729 | |
| 730 | std::string generator = this->GlobalGenerator->GetName(); |
| 731 | if (generator == "NMake Makefiles" || generator == "NMake Makefiles JOM") { |
| 732 | // For Windows ConvertToOutputPath already adds quotes when required. |
| 733 | // These need to be escaped, see |
| 734 | // https://gitlab.kitware.com/cmake/cmake/-/issues/13952 |
| 735 | std::string makefileName = cmSystemTools::ConvertToOutputPath(makefile); |
| 736 | command += " /NOLOGO /f "; |
| 737 | command += makefileName; |
| 738 | command += " VERBOSE=1 "; |
| 739 | command += target; |
| 740 | } else if (generator == "MinGW Makefiles") { |
| 741 | // no escaping of spaces in this case, see |
| 742 | // https://gitlab.kitware.com/cmake/cmake/-/issues/10014 |
| 743 | std::string const& makefileName = makefile; |
| 744 | command += " -f \""; |
| 745 | command += makefileName; |
| 746 | command += "\" "; |
| 747 | command += " VERBOSE=1 "; |
| 748 | command += target; |
| 749 | } else if (generator == "Ninja") { |
| 750 | command += " -v "; |
| 751 | command += target; |
| 752 | } else { |
| 753 | std::string makefileName = cmSystemTools::ConvertToOutputPath(makefile); |
| 754 | command += " -f \""; |
| 755 | command += makefileName; |
| 756 | command += "\" "; |
| 757 | command += " VERBOSE=1 "; |
| 758 | command += target; |
| 759 | } |
| 760 | return command; |
| 761 | } |
no test coverage detected