From 2a408ff99b26615e1072e2f27990d19ca1997429 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mika=C3=ABl=20Capelle?= Date: Wed, 19 Jun 2024 20:44:04 +0200 Subject: [PATCH] Add -d option to mob cmake to build in debug mode. --- src/cmd/cmake.cpp | 7 ++++++- src/cmd/commands.h | 3 ++- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/src/cmd/cmake.cpp b/src/cmd/cmake.cpp index 8e63d76..f6ef356 100644 --- a/src/cmd/cmake.cpp +++ b/src/cmd/cmake.cpp @@ -33,12 +33,17 @@ namespace mob { (clipp::option("--install-prefix") & clipp::value("PATH") >> prefix_) % "sets CMAKE_INSTALL_PREFIX [default: empty]", + (clipp::option("-d", "--debug").set(debug_, true)) % + "whether to configure for debug mode [default: false]", + (clipp::value("PATH") >> path_) % "path from which to run `cmake`"); } int cmake_command::do_run() { - auto t = tasks::modorganizer::create_cmake_tool(fs::path(utf8_to_utf16(path_))); + auto t = tasks::modorganizer::create_cmake_tool( + fs::path(utf8_to_utf16(path_)), mob::cmake::generate, + debug_ ? config::debug : config::relwithdebinfo); t.generator(gen_); t.cmd(cmd_); diff --git a/src/cmd/commands.h b/src/cmd/commands.h index 59d975e..267a133 100644 --- a/src/cmd/commands.h +++ b/src/cmd/commands.h @@ -382,7 +382,8 @@ namespace mob { private: std::string gen_; std::string cmd_; - bool x64_ = true; + bool x64_ = true; + bool debug_ = false; std::string prefix_; std::string path_; };