Merge pull request #72 from isanae/master

Suppress cmake deprecation warnings for zlib and gtest
This commit is contained in:
isanae
2020-12-08 20:44:49 -05:00
committed by GitHub
4 changed files with 16 additions and 6 deletions
+1
View File
@@ -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()));
}
+1
View File
@@ -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
View File
@@ -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
View File
@@ -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_;