Skip to content

Commit f99e777

Browse files
authored
Add -d option to mob cmake to build in debug mode. (#137)
1 parent ecd210d commit f99e777

File tree

2 files changed

+8
-2
lines changed

2 files changed

+8
-2
lines changed

src/cmd/cmake.cpp

+6-1
Original file line numberDiff line numberDiff line change
@@ -33,12 +33,17 @@ namespace mob {
3333
(clipp::option("--install-prefix") & clipp::value("PATH") >> prefix_) %
3434
"sets CMAKE_INSTALL_PREFIX [default: empty]",
3535

36+
(clipp::option("-d", "--debug").set(debug_, true)) %
37+
"whether to configure for debug mode [default: false]",
38+
3639
(clipp::value("PATH") >> path_) % "path from which to run `cmake`");
3740
}
3841

3942
int cmake_command::do_run()
4043
{
41-
auto t = tasks::modorganizer::create_cmake_tool(fs::path(utf8_to_utf16(path_)));
44+
auto t = tasks::modorganizer::create_cmake_tool(
45+
fs::path(utf8_to_utf16(path_)), mob::cmake::generate,
46+
debug_ ? config::debug : config::relwithdebinfo);
4247

4348
t.generator(gen_);
4449
t.cmd(cmd_);

src/cmd/commands.h

+2-1
Original file line numberDiff line numberDiff line change
@@ -382,7 +382,8 @@ namespace mob {
382382
private:
383383
std::string gen_;
384384
std::string cmd_;
385-
bool x64_ = true;
385+
bool x64_ = true;
386+
bool debug_ = false;
386387
std::string prefix_;
387388
std::string path_;
388389
};

0 commit comments

Comments
 (0)