diff options
| author | Bob Kast <bob.kast@emc.com> | 2018-11-13 15:48:26 -0500 |
|---|---|---|
| committer | Bob Kast <bob.kast@emc.com> | 2018-11-13 15:48:26 -0500 |
| commit | d9e39bb4056795a70028b228a746da4889ca7c15 (patch) | |
| tree | 4853304e1e71e45becedfba5d83e3f5321e0b9c9 /toolsrc/include | |
| parent | 1a9dadf855ab93ff0803fd1ce4ecceec5bf211f0 (diff) | |
| parent | ffa114aaa43e8bcdf880d6e2c47ee0ed46125070 (diff) | |
| download | vcpkg-d9e39bb4056795a70028b228a746da4889ca7c15.tar.gz vcpkg-d9e39bb4056795a70028b228a746da4889ca7c15.zip | |
Merge branch 'master' of https://github.com/EMCECS/vcpkg
# Conflicts:
# ports/ecsutil/CONTROL
# ports/ecsutil/portfile.cmake
Diffstat (limited to 'toolsrc/include')
| -rw-r--r-- | toolsrc/include/vcpkg/base/chrono.h | 8 | ||||
| -rw-r--r-- | toolsrc/include/vcpkg/base/files.h | 4 | ||||
| -rw-r--r-- | toolsrc/include/vcpkg/base/system.h | 10 | ||||
| -rw-r--r-- | toolsrc/include/vcpkg/commands.h | 6 | ||||
| -rw-r--r-- | toolsrc/include/vcpkg/globalstate.h | 22 | ||||
| -rw-r--r-- | toolsrc/include/vcpkg/visualstudio.h | 2 |
6 files changed, 43 insertions, 9 deletions
diff --git a/toolsrc/include/vcpkg/base/chrono.h b/toolsrc/include/vcpkg/base/chrono.h index aa764a597..6f6e2b317 100644 --- a/toolsrc/include/vcpkg/base/chrono.h +++ b/toolsrc/include/vcpkg/base/chrono.h @@ -52,8 +52,10 @@ namespace vcpkg::Chrono static Optional<CTime> get_current_date_time(); static Optional<CTime> parse(CStringView str); - constexpr CTime() noexcept : m_tm{0} {} - explicit constexpr CTime(tm t) noexcept : m_tm{t} {} + constexpr CTime() noexcept : m_tm {0} {} + explicit constexpr CTime(tm t) noexcept : m_tm {t} {} + + CTime add_hours(const int hours) const; std::string to_string() const; @@ -62,4 +64,6 @@ namespace vcpkg::Chrono private: mutable tm m_tm; }; + + tm get_current_date_time_local(); } diff --git a/toolsrc/include/vcpkg/base/files.h b/toolsrc/include/vcpkg/base/files.h index eee910841..b07ff25b3 100644 --- a/toolsrc/include/vcpkg/base/files.h +++ b/toolsrc/include/vcpkg/base/files.h @@ -20,7 +20,7 @@ namespace fs inline bool is_regular_file(file_status s) { return stdfs::is_regular_file(s); } inline bool is_directory(file_status s) { return stdfs::is_directory(s); } - inline bool status_known(file_status s) { return stdfs::status_known(s); } + inline bool is_symlink(file_status s) { return stdfs::is_symlink(s); } } namespace vcpkg::Files @@ -55,7 +55,9 @@ namespace vcpkg::Files const fs::path& newpath, fs::copy_options opts, std::error_code& ec) = 0; + virtual void copy_symlink(const fs::path& oldpath, const fs::path& newpath, std::error_code& ec) = 0; virtual fs::file_status status(const fs::path& path, std::error_code& ec) const = 0; + virtual fs::file_status symlink_status(const fs::path& path, std::error_code& ec) const = 0; virtual std::vector<fs::path> find_from_PATH(const std::string& name) const = 0; diff --git a/toolsrc/include/vcpkg/base/system.h b/toolsrc/include/vcpkg/base/system.h index 3c4326ade..af56e45c1 100644 --- a/toolsrc/include/vcpkg/base/system.h +++ b/toolsrc/include/vcpkg/base/system.h @@ -8,8 +8,6 @@ namespace vcpkg::System { - tm get_current_date_time(); - fs::path get_exe_path_of_current_process(); struct CMakeVariable @@ -32,15 +30,15 @@ namespace vcpkg::System }; int cmd_execute_clean(const CStringView cmd_line, - const std::unordered_map<std::string, std::string>& extra_env = {}); + const std::unordered_map<std::string, std::string>& extra_env = {}) noexcept; - int cmd_execute(const CStringView cmd_line); + int cmd_execute(const CStringView cmd_line) noexcept; #if defined(_WIN32) - void cmd_execute_no_wait(const CStringView cmd_line); + void cmd_execute_no_wait(const CStringView cmd_line) noexcept; #endif - ExitCodeAndOutput cmd_execute_and_capture_output(const CStringView cmd_line); + ExitCodeAndOutput cmd_execute_and_capture_output(const CStringView cmd_line) noexcept; enum class Color { diff --git a/toolsrc/include/vcpkg/commands.h b/toolsrc/include/vcpkg/commands.h index 1858a320f..fd7d832b3 100644 --- a/toolsrc/include/vcpkg/commands.h +++ b/toolsrc/include/vcpkg/commands.h @@ -119,6 +119,12 @@ namespace vcpkg::Commands void perform_and_exit(const VcpkgCmdArguments& args); } + namespace X_VSInstances + { + extern const CommandStructure COMMAND_STRUCTURE; + void perform_and_exit(const VcpkgCmdArguments& args, const VcpkgPaths& paths); + } + namespace Hash { void perform_and_exit(const VcpkgCmdArguments& args, const VcpkgPaths& paths); diff --git a/toolsrc/include/vcpkg/globalstate.h b/toolsrc/include/vcpkg/globalstate.h index bc28e3ff8..ae66ca355 100644 --- a/toolsrc/include/vcpkg/globalstate.h +++ b/toolsrc/include/vcpkg/globalstate.h @@ -18,5 +18,27 @@ namespace vcpkg static std::atomic<int> g_init_console_cp; static std::atomic<int> g_init_console_output_cp; + static std::atomic<bool> g_init_console_initialized; + + struct CtrlCStateMachine + { + CtrlCStateMachine(); + + void transition_to_spawn_process() noexcept; + void transition_from_spawn_process() noexcept; + void transition_handle_ctrl_c() noexcept; + + private: + enum class CtrlCState + { + normal, + blocked_on_child, + exit_requested, + }; + + std::atomic<CtrlCState> m_state; + }; + + static CtrlCStateMachine g_ctrl_c_state; }; } diff --git a/toolsrc/include/vcpkg/visualstudio.h b/toolsrc/include/vcpkg/visualstudio.h index b93b145d9..cd99db352 100644 --- a/toolsrc/include/vcpkg/visualstudio.h +++ b/toolsrc/include/vcpkg/visualstudio.h @@ -6,6 +6,8 @@ namespace vcpkg::VisualStudio
{
+ std::vector<std::string> get_visual_studio_instances(const VcpkgPaths& paths);
+
std::vector<Toolset> find_toolset_instances_preferred_first(const VcpkgPaths& paths);
}
|
