Skip to content

Commit 432d686

Browse files
committed
Update for command changes.
1 parent 46cb004 commit 432d686

4 files changed

Lines changed: 50 additions & 50 deletions

File tree

src/client/main.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -730,8 +730,8 @@ std::optional<int> internal(const Strings &args)
730730
f >> std::quoted(prog) >> std::quoted(arg);
731731
primitives::Command c;
732732
c.working_directory = wd;
733-
c.program = prog;
734-
c.args.push_back(arg);
733+
c.setProgram(prog);
734+
c.arguments.push_back(arg);
735735
e.push([c]() mutable { c.execute(); });
736736
}
737737
e.wait();

src/common/program.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -88,8 +88,8 @@ String get_cmake_version()
8888
static const std::regex r("cmake version (\\S+)");
8989

9090
primitives::Command c;
91-
c.program = "cmake";
92-
c.args = { "--version" };
91+
c.setProgram("cmake");
92+
c.arguments = { "--version" };
9393
std::error_code ec;
9494
c.execute(ec);
9595
if (ec)

src/common/project.cpp

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -137,9 +137,9 @@ bool is_valid_file_type(const MimeTypes &types, const path &p, const String &s,
137137
bool is_valid_file_type(const MimeTypes &types, const path &p, String *error = nullptr, bool check_ext = false)
138138
{
139139
primitives::Command c;
140-
c.program = "file";
141-
c.args.push_back("-ib");
142-
c.args.push_back(p.string());
140+
c.setProgram("file");
141+
c.arguments.push_back("-ib");
142+
c.arguments.push_back(p.string());
143143
c.execute();
144144
return is_valid_file_type(types, p, c.out.text, error, check_ext);
145145
}
@@ -206,8 +206,8 @@ void check_file_types(const Files &files)
206206
o.close();
207207

208208
primitives::Command c;
209-
c.program = "sh";
210-
c.args.push_back(fn.string());
209+
c.setProgram("sh");
210+
c.arguments.push_back(fn.string());
211211
std::error_code ec;
212212
c.execute(ec);
213213
fs::remove(fn);

src/printers/cmake.cpp

Lines changed: 41 additions & 41 deletions
Original file line numberDiff line numberDiff line change
@@ -1343,45 +1343,45 @@ int CMakePrinter::generate(const BuildSettings &bs) const
13431343
auto &s = Settings::get_local_settings();
13441344

13451345
primitives::Command c;
1346-
c.args.push_back("cmake");
1347-
c.args.push_back("-H" + normalize_path(bs.source_directory));
1348-
c.args.push_back("-B" + normalize_path(bs.binary_directory));
1346+
c.arguments.push_back("cmake");
1347+
c.arguments.push_back("-H" + normalize_path(bs.source_directory));
1348+
c.arguments.push_back("-B" + normalize_path(bs.binary_directory));
13491349
if (!s.c_compiler.empty())
1350-
c.args.push_back("-DCMAKE_C_COMPILER=" + s.c_compiler);
1350+
c.arguments.push_back("-DCMAKE_C_COMPILER=" + s.c_compiler);
13511351
if (!s.cxx_compiler.empty())
1352-
c.args.push_back("-DCMAKE_CXX_COMPILER=" + s.cxx_compiler);
1352+
c.arguments.push_back("-DCMAKE_CXX_COMPILER=" + s.cxx_compiler);
13531353
if (!s.host_c_compiler.empty())
1354-
c.args.push_back("-DCPPAN_HOST_C_COMPILER=" + s.host_c_compiler);
1354+
c.arguments.push_back("-DCPPAN_HOST_C_COMPILER=" + s.host_c_compiler);
13551355
if (!s.host_cxx_compiler.empty())
1356-
c.args.push_back("-DCPPAN_HOST_CXX_COMPILER=" + s.host_cxx_compiler);
1356+
c.arguments.push_back("-DCPPAN_HOST_CXX_COMPILER=" + s.host_cxx_compiler);
13571357
if (s.crosscompilation)
1358-
c.args.push_back("-DCPPAN_CROSSCOMPILATION="s + (s.crosscompilation ? "1" : "0"));
1358+
c.arguments.push_back("-DCPPAN_CROSSCOMPILATION="s + (s.crosscompilation ? "1" : "0"));
13591359
if (!s.generator.empty())
13601360
{
1361-
c.args.push_back("-G");
1362-
c.args.push_back(s.generator);
1361+
c.arguments.push_back("-G");
1362+
c.arguments.push_back(s.generator);
13631363

13641364
//if (s.generator.find("Win64") != s.generator.npos)
1365-
//c.args.push_back("-Thost=x64");
1365+
//c.arguments.push_back("-Thost=x64");
13661366
}
13671367
if (!s.system_version.empty())
1368-
c.args.push_back("-DCMAKE_SYSTEM_VERSION=" + s.system_version);
1368+
c.arguments.push_back("-DCMAKE_SYSTEM_VERSION=" + s.system_version);
13691369
if (!s.toolset.empty())
13701370
{
1371-
c.args.push_back("-T");
1372-
c.args.push_back(s.toolset);
1371+
c.arguments.push_back("-T");
1372+
c.arguments.push_back(s.toolset);
13731373
}
1374-
c.args.push_back("-DCMAKE_BUILD_TYPE=" + s.configuration);
1374+
c.arguments.push_back("-DCMAKE_BUILD_TYPE=" + s.configuration);
13751375
if (s.debug_generated_cmake_configs)
1376-
c.args.push_back("-DCPPAN_CMAKE_VERBOSE="s + (s.cmake_verbose ? "1" : "0"));
1377-
c.args.push_back("-DCPPAN_BUILD_VERBOSE="s + (s.build_system_verbose ? "1" : "0"));
1378-
c.args.push_back("-DCPPAN_BUILD_WARNING_LEVEL="s + std::to_string(s.build_warning_level));
1379-
c.args.push_back("-DCPPAN_USE_CACHE="s + (s.use_cache ? "1" : "0"));
1376+
c.arguments.push_back("-DCPPAN_CMAKE_VERBOSE="s + (s.cmake_verbose ? "1" : "0"));
1377+
c.arguments.push_back("-DCPPAN_BUILD_VERBOSE="s + (s.build_system_verbose ? "1" : "0"));
1378+
c.arguments.push_back("-DCPPAN_BUILD_WARNING_LEVEL="s + std::to_string(s.build_warning_level));
1379+
c.arguments.push_back("-DCPPAN_USE_CACHE="s + (s.use_cache ? "1" : "0"));
13801380
if (s.short_local_names)
1381-
c.args.push_back("-DCPPAN_SHORT_LOCAL_NAMES="s + (s.short_local_names ? "1" : "0"));
1382-
//c.args.push_back("-DCPPAN_TEST_RUN="s + (bs.test_run ? "1" : "0"));
1381+
c.arguments.push_back("-DCPPAN_SHORT_LOCAL_NAMES="s + (s.short_local_names ? "1" : "0"));
1382+
//c.arguments.push_back("-DCPPAN_TEST_RUN="s + (bs.test_run ? "1" : "0"));
13831383
for (auto &o : s.cmake_options)
1384-
c.args.push_back(o);
1384+
c.arguments.push_back(o);
13851385
for (auto &o : s.env)
13861386
{
13871387
#ifdef _WIN32
@@ -1458,18 +1458,18 @@ int CMakePrinter::build(const BuildSettings &bs) const
14581458
LOG_INFO(logger, "Starting build process...");
14591459

14601460
primitives::Command c;
1461-
c.args.push_back("cmake");
1462-
c.args.push_back("--build");
1463-
c.args.push_back(normalize_path(bs.binary_directory));
1464-
c.args.push_back("--config");
1465-
c.args.push_back(settings.configuration);
1461+
c.arguments.push_back("cmake");
1462+
c.arguments.push_back("--build");
1463+
c.arguments.push_back(normalize_path(bs.binary_directory));
1464+
c.arguments.push_back("--config");
1465+
c.arguments.push_back(settings.configuration);
14661466

14671467
auto &us = Settings::get_local_settings();
14681468
if (!us.additional_build_args.empty())
14691469
{
1470-
c.args.push_back("--");
1470+
c.arguments.push_back("--");
14711471
for (auto &a : us.additional_build_args)
1472-
c.args.push_back(a);
1472+
c.arguments.push_back(a);
14731473
}
14741474

14751475
return (int)run_command(settings, c).value();
@@ -3500,20 +3500,20 @@ void CMakePrinter::parallel_vars_check(const ParallelCheckOptions &o) const
35003500

35013501
// run cmake
35023502
primitives::Command c;
3503-
c.args.push_back(o.cmake_binary.string());
3504-
c.args.push_back("-H" + normalize_path(d));
3505-
c.args.push_back("-B" + normalize_path(d));
3506-
c.args.push_back("-G");
3507-
c.args.push_back(o.generator);
3503+
c.arguments.push_back(o.cmake_binary.string());
3504+
c.arguments.push_back("-H" + normalize_path(d));
3505+
c.arguments.push_back("-B" + normalize_path(d));
3506+
c.arguments.push_back("-G");
3507+
c.arguments.push_back(o.generator);
35083508
if (!o.system_version.empty())
3509-
c.args.push_back("-DCMAKE_SYSTEM_VERSION=" + o.system_version);
3509+
c.arguments.push_back("-DCMAKE_SYSTEM_VERSION=" + o.system_version);
35103510
if (!o.toolset.empty())
35113511
{
3512-
c.args.push_back("-T");
3513-
c.args.push_back(o.toolset);
3512+
c.arguments.push_back("-T");
3513+
c.arguments.push_back(o.toolset);
35143514
}
35153515
if (!o.toolchain.empty())
3516-
c.args.push_back("-DCMAKE_TOOLCHAIN_FILE=" + o.toolchain);
3516+
c.arguments.push_back("-DCMAKE_TOOLCHAIN_FILE=" + o.toolchain);
35173517

35183518
//
35193519
auto print = [](const String &str, bool eof, String &out_line)
@@ -3557,11 +3557,11 @@ void CMakePrinter::parallel_vars_check(const ParallelCheckOptions &o) const
35573557
#ifndef _WIN32
35583558
// hide output for *nix as it very fast there
35593559
/*if (N >= 4)
3560-
ret = command::execute(args);
3560+
ret = command::execute(arguments);
35613561
else*/
35623562
#endif
3563-
//ret = command::execute_and_capture(args, o);
3564-
//ret = command::execute(args);
3563+
//ret = command::execute_and_capture(arguments, o);
3564+
//ret = command::execute(arguments);
35653565
std::error_code ec;
35663566
c.execute(ec);
35673567

0 commit comments

Comments
 (0)