diff options
author | Vitaly Stakhovsky <vvs31415@gitlab.org> | 2019-02-11 15:30:00 (GMT) |
---|---|---|
committer | Vitaly Stakhovsky <vvs31415@gitlab.org> | 2019-02-11 15:32:43 (GMT) |
commit | 950c099d83757acd57cec78a3579ea1f6aaddf96 (patch) | |
tree | 87862c59076f42dc9c4be9c8c002e1fccfdb90cd /Source/cmakemain.cxx | |
parent | 8a1d25afdf92cabab88598cc9b9e5a9fb2a9493b (diff) | |
download | CMake-950c099d83757acd57cec78a3579ea1f6aaddf96.zip CMake-950c099d83757acd57cec78a3579ea1f6aaddf96.tar.gz CMake-950c099d83757acd57cec78a3579ea1f6aaddf96.tar.bz2 |
cmake: Progress functions use `std::string` param
Diffstat (limited to 'Source/cmakemain.cxx')
-rw-r--r-- | Source/cmakemain.cxx | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/Source/cmakemain.cxx b/Source/cmakemain.cxx index a49246b..09068f8 100644 --- a/Source/cmakemain.cxx +++ b/Source/cmakemain.cxx @@ -148,14 +148,15 @@ static void cmakemainMessageCallback(const std::string& m, std::cerr << m << cmakemainGetStack(cm) << std::endl << std::flush; } -static void cmakemainProgressCallback(const char* m, float prog, cmake* cm) +static void cmakemainProgressCallback(const std::string& m, float prog, + cmake* cm) { cmMakefile* mf = cmakemainGetMakefile(cm); std::string dir; - if ((mf) && (strstr(m, "Configuring") == m) && (prog < 0)) { + if (mf && cmHasLiteralPrefix(m, "Configuring") && (prog < 0)) { dir = " "; dir += mf->GetCurrentSourceDirectory(); - } else if ((mf) && (strstr(m, "Generating") == m)) { + } else if (mf && cmHasLiteralPrefix(m, "Generating")) { dir = " "; dir += mf->GetCurrentBinaryDirectory(); } @@ -323,7 +324,7 @@ int do_cmake(int ac, char const* const* av) [&cm](const std::string& msg, const char* title) { cmakemainMessageCallback(msg, title, &cm); }); - cm.SetProgressCallback([&cm](const char* msg, float prog) { + cm.SetProgressCallback([&cm](const std::string& msg, float prog) { cmakemainProgressCallback(msg, prog, &cm); }); cm.SetWorkingMode(workingMode); @@ -504,7 +505,7 @@ static int do_build(int ac, char const* const* av) [&cm](const std::string& msg, const char* title) { cmakemainMessageCallback(msg, title, &cm); }); - cm.SetProgressCallback([&cm](const char* msg, float prog) { + cm.SetProgressCallback([&cm](const std::string& msg, float prog) { cmakemainProgressCallback(msg, prog, &cm); }); return cm.Build(jobs, dir, target, config, nativeOptions, clean, verbose); @@ -547,7 +548,7 @@ static int do_open(int ac, char const* const* av) [&cm](const std::string& msg, const char* title) { cmakemainMessageCallback(msg, title, &cm); }); - cm.SetProgressCallback([&cm](const char* msg, float prog) { + cm.SetProgressCallback([&cm](const std::string& msg, float prog) { cmakemainProgressCallback(msg, prog, &cm); }); return cm.Open(dir, false) ? 0 : 1; |