mirror of
https://github.com/ModOrganizer2/mob.git
synced 2026-07-27 14:07:05 -07:00
Add possibility to specify host for VS generator.
This commit is contained in:
@@ -15,6 +15,7 @@ github_key =
|
||||
|
||||
[cmake]
|
||||
install_message = never
|
||||
host =
|
||||
|
||||
[aliases]
|
||||
super = cmake_common modorganizer* githubpp
|
||||
|
||||
@@ -756,6 +756,11 @@ conf_cmake::cmake_constant conf_cmake::install_message() const
|
||||
return read_cmake_constant("install_message", { ALWAYS, LAZY, NEVER });
|
||||
}
|
||||
|
||||
std::string conf_cmake::host() const
|
||||
{
|
||||
return details::get_string(name(), "host");
|
||||
}
|
||||
|
||||
conf_cmake::cmake_constant conf_cmake::read_cmake_constant(
|
||||
std::string_view key, std::vector<cmake_constant> const& allowed) const
|
||||
{
|
||||
|
||||
@@ -192,8 +192,17 @@ public:
|
||||
public:
|
||||
conf_cmake();
|
||||
|
||||
// specify the value for CMAKE_INSTALL_MESSAGE
|
||||
//
|
||||
cmake_constant install_message() const;
|
||||
|
||||
// specify the toolset host configuration, if any, this is equivalent
|
||||
// to -T host=XXX on the command line
|
||||
//
|
||||
// an empty string means no host configured
|
||||
//
|
||||
std::string host() const;
|
||||
|
||||
private:
|
||||
cmake_constant read_cmake_constant(
|
||||
std::string_view key, std::vector<cmake_constant> const& allowed) const;
|
||||
|
||||
+11
-1
@@ -145,7 +145,8 @@ void cmake::do_generate()
|
||||
// string
|
||||
p
|
||||
.arg("-G", "\"" + g.name + "\"")
|
||||
.arg(g.get_arch(arch_));
|
||||
.arg(g.get_arch(arch_))
|
||||
.arg(g.get_host(conf().cmake().host()));
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -240,6 +241,15 @@ std::string cmake::gen_info::get_arch(arch a) const
|
||||
}
|
||||
}
|
||||
|
||||
std::string cmake::gen_info::get_host(std::string_view conf_host) const
|
||||
{
|
||||
if (conf_host.empty()) {
|
||||
return {};
|
||||
}
|
||||
|
||||
return "-T host=" + std::string{ conf_host };
|
||||
}
|
||||
|
||||
std::string cmake::gen_info::output_dir(arch a) const
|
||||
{
|
||||
switch (a)
|
||||
|
||||
@@ -135,6 +135,14 @@ private:
|
||||
//
|
||||
std::string get_arch(arch a) const;
|
||||
|
||||
// for generator that supports it, returns a toolset configuration to set
|
||||
// the host as specified in the configuration
|
||||
//
|
||||
// for VS generator, this returns "-T host=XXX" if conf_host is not empty,
|
||||
// otherwise returns an empty string
|
||||
//
|
||||
std::string get_host(std::string_view conf_host) const;
|
||||
|
||||
// return either `dir` for 64-bit or `dir` + "_32" for 32-bit
|
||||
//
|
||||
std::string output_dir(arch a) const;
|
||||
|
||||
Reference in New Issue
Block a user