aboutsummaryrefslogtreecommitdiff
path: root/toolsrc
diff options
context:
space:
mode:
Diffstat (limited to 'toolsrc')
-rw-r--r--toolsrc/include/vcpkg/base/files.h7
-rw-r--r--toolsrc/src/vcpkg/base/system.cpp13
2 files changed, 14 insertions, 6 deletions
diff --git a/toolsrc/include/vcpkg/base/files.h b/toolsrc/include/vcpkg/base/files.h
index b24778308..b07ff25b3 100644
--- a/toolsrc/include/vcpkg/base/files.h
+++ b/toolsrc/include/vcpkg/base/files.h
@@ -2,7 +2,7 @@
#include <vcpkg/base/expected.h>
-#if defined(_WIN32) || defined(__cpp_lib_filesystem)
+#if defined(_WIN32)
#include <filesystem>
#else
#include <experimental/filesystem>
@@ -10,12 +10,7 @@
namespace fs
{
-// VS2015 (_MSC_VER 1900) uses std::experimental::filesystem
-#if (defined(_MSC_VER) && _MSC_VER > 1900) || defined(__cpp_lib_filesystem)
- namespace stdfs = std::filesystem;
-#else
namespace stdfs = std::experimental::filesystem;
-#endif
using stdfs::copy_options;
using stdfs::file_status;
diff --git a/toolsrc/src/vcpkg/base/system.cpp b/toolsrc/src/vcpkg/base/system.cpp
index 90b9c34b3..6ddf17496 100644
--- a/toolsrc/src/vcpkg/base/system.cpp
+++ b/toolsrc/src/vcpkg/base/system.cpp
@@ -178,6 +178,19 @@ namespace vcpkg::System
L"ANDROID_NDK_HOME",
};
+ const Optional<std::string> keep_vars = System::get_environment_variable("VCPKG_KEEP_ENV_VARS");
+ const auto k = keep_vars.get();
+
+ if (k && !k->empty())
+ {
+ auto vars = Strings::split(*k, ";");
+
+ for (auto&& var : vars)
+ {
+ env_wstrings.push_back(Strings::to_utf16(var.c_str()));
+ }
+ }
+
std::wstring env_cstr;
for (auto&& env_wstring : env_wstrings)