mirror of
https://github.com/ModOrganizer2/mob.git
synced 2026-07-27 14:07:05 -07:00
Merge pull request #72 from isanae/master
Suppress cmake deprecation warnings for zlib and gtest
This commit is contained in:
@@ -14,6 +14,7 @@ cmake create_cmake_tool(arch a, cmake::ops o=cmake::generate)
|
||||
return std::move(cmake(o)
|
||||
.generator(cmake::vs)
|
||||
.architecture(a)
|
||||
.arg("-Wno-deprecated")
|
||||
.prefix(gtest::source_path() / build_dir)
|
||||
.root(gtest::source_path()));
|
||||
}
|
||||
|
||||
@@ -87,6 +87,7 @@ cmake zlib::create_cmake_tool(cmake::ops o)
|
||||
return std::move(cmake(o)
|
||||
.generator(cmake::vs)
|
||||
.root(source_path())
|
||||
.arg("-Wno-deprecated")
|
||||
.prefix(source_path()));
|
||||
}
|
||||
|
||||
|
||||
+8
-4
@@ -47,7 +47,7 @@ cmake& cmake::prefix(const fs::path& s)
|
||||
|
||||
cmake& cmake::def(const std::string& name, const std::string& value)
|
||||
{
|
||||
def_.emplace_back(name, value);
|
||||
arg("-D" + name + "=" + value);
|
||||
return *this;
|
||||
}
|
||||
|
||||
@@ -63,6 +63,12 @@ cmake& cmake::def(const std::string& name, const char* s)
|
||||
return *this;
|
||||
}
|
||||
|
||||
cmake& cmake::arg(std::string s)
|
||||
{
|
||||
args_.push_back(std::move(s));
|
||||
return *this;
|
||||
}
|
||||
|
||||
cmake& cmake::architecture(arch a)
|
||||
{
|
||||
arch_ = a;
|
||||
@@ -150,9 +156,7 @@ void cmake::do_generate()
|
||||
if (!prefix_.empty())
|
||||
p.arg("-DCMAKE_INSTALL_PREFIX=", prefix_);
|
||||
|
||||
// macros
|
||||
for (auto&& [name, value] : def_)
|
||||
p.arg("-D" + name + "=" + value + "");
|
||||
p.args(args_);
|
||||
|
||||
// `..` by default, overriden by cmd()
|
||||
if (cmd_.empty())
|
||||
|
||||
+6
-2
@@ -79,6 +79,10 @@ public:
|
||||
cmake& def(const std::string& name, const fs::path& p);
|
||||
cmake& def(const std::string& name, const char* s);
|
||||
|
||||
// adds an arbitrary argument, passed verbatim
|
||||
//
|
||||
cmake& arg(std::string s);
|
||||
|
||||
// sets the architecture, used along with the generator to create the
|
||||
// output directory name, but also to get the proper vcvars environment
|
||||
// variables for the build environment
|
||||
@@ -149,8 +153,8 @@ private:
|
||||
// passed as -DCMAKE_INSTALL_PREFIX
|
||||
fs::path prefix_;
|
||||
|
||||
// passed as -Dkey=value
|
||||
std::vector<std::pair<std::string, std::string>> def_;
|
||||
// passed verbatim
|
||||
std::vector<std::string> args_;
|
||||
|
||||
// overrides build directory name
|
||||
fs::path output_;
|
||||
|
||||
Reference in New Issue
Block a user