mirror of
https://github.com/ModOrganizer2/mob.git
synced 2026-07-27 14:07:05 -07:00
Merge pull request #77 from isanae/master
Add BOOST_PATH to the environment for usvfs
This commit is contained in:
+2
-2
@@ -436,7 +436,7 @@ env this_env::get()
|
||||
// keep track of the current directory, those start with an equal sign,
|
||||
// so just ignore them
|
||||
if (!key.empty())
|
||||
g_sys_env.set(utf16_to_utf8(key), utf16_to_utf8(value));
|
||||
g_sys_env.set(key, value);
|
||||
|
||||
// next string is one past end of value to account for null byte
|
||||
name = value_start + value.length() + 1;
|
||||
@@ -481,7 +481,7 @@ void this_env::set(const std::string& k, const std::string& v, env::flags f)
|
||||
{
|
||||
std::scoped_lock lock(g_sys_env_mutex);
|
||||
if (g_sys_env_inited)
|
||||
g_sys_env.set(k, utf16_to_utf8(wv));
|
||||
g_sys_env.set(utf8_to_utf16(k), wv);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
+7
-1
@@ -173,11 +173,17 @@ msbuild usvfs::create_msbuild_tool(arch a, msbuild::ops o) const
|
||||
|
||||
// udis requires python in its custom build step, so make sure it's on the
|
||||
// path
|
||||
//
|
||||
// BOOST_PATH is in the env because external_dependencies.props will
|
||||
// use it if it exists or reverts to a hardcoded path which might not be using
|
||||
// the same version as mob if it wasn't updated
|
||||
return std::move(msbuild(o)
|
||||
.platform(plat)
|
||||
.targets({"usvfs_proxy"})
|
||||
.solution(source_path() / "vsbuild" / "usvfs.sln")
|
||||
.prepend_path(python::build_path()));
|
||||
.env(env::vs(a)
|
||||
.prepend_path(python::build_path())
|
||||
.set("BOOST_PATH", path_to_utf8(boost::source_path()))));
|
||||
}
|
||||
|
||||
std::vector<std::shared_ptr<downloader>>
|
||||
|
||||
@@ -2,6 +2,7 @@
|
||||
#include "tools.h"
|
||||
#include "../core/conf.h"
|
||||
#include "../core/process.h"
|
||||
#include "../core/env.h"
|
||||
|
||||
namespace mob
|
||||
{
|
||||
@@ -59,9 +60,9 @@ msbuild& msbuild::flags(flags_t f)
|
||||
return *this;
|
||||
}
|
||||
|
||||
msbuild& msbuild::prepend_path(const fs::path& p)
|
||||
msbuild& msbuild::env(const mob::env& e)
|
||||
{
|
||||
prepend_path_.push_back(p);
|
||||
env_ = e;
|
||||
return *this;
|
||||
}
|
||||
|
||||
@@ -184,14 +185,10 @@ void msbuild::run_for_targets(const std::vector<std::string>& targets)
|
||||
for (auto&& prop : props_)
|
||||
p.arg("-property:" + prop);
|
||||
|
||||
env e = env::vs(arch_);
|
||||
for (auto&& path : prepend_path_)
|
||||
e.prepend_path(path);
|
||||
|
||||
p
|
||||
.arg(sln_)
|
||||
.cwd(sln_.parent_path())
|
||||
.env(e);
|
||||
.env(env_ ? *env_ : env::vs(arch_));
|
||||
|
||||
execute_and_join(p);
|
||||
}
|
||||
|
||||
+6
-3
@@ -1,5 +1,7 @@
|
||||
#pragma once
|
||||
|
||||
#include "../core/env.h"
|
||||
|
||||
namespace mob
|
||||
{
|
||||
|
||||
@@ -62,10 +64,10 @@ public:
|
||||
// flags
|
||||
msbuild& flags(flags_t f);
|
||||
|
||||
// can be called multiple times, the given paths will be prepended to PATH
|
||||
// before invoking msbuild
|
||||
// override the environment variables, which normally defaults to env::vs()
|
||||
// for the arch given in architecture()
|
||||
//
|
||||
msbuild& prepend_path(const fs::path& p);
|
||||
msbuild& env(const mob::env& e);
|
||||
|
||||
// exit code
|
||||
//
|
||||
@@ -83,6 +85,7 @@ private:
|
||||
std::string platform_;
|
||||
arch arch_;
|
||||
flags_t flags_;
|
||||
std::optional<mob::env> env_;
|
||||
std::vector<fs::path> prepend_path_;
|
||||
|
||||
// runs msbuild with ":Clean" for each target given in targets(), giving
|
||||
|
||||
Reference in New Issue
Block a user