diff options
| author | Cristian Adam <cristian.adam@gmail.com> | 2020-07-18 17:48:01 +0200 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2020-07-18 08:48:01 -0700 |
| commit | f4bd64233ae875b6b3315fe4fab279335a6adf2b (patch) | |
| tree | 76203f90a07094662dfffd4f90f383f0a4559c0b /toolsrc/src | |
| parent | 751fc627ef4f1c319b04e1c364e24b4da965e273 (diff) | |
| download | vcpkg-f4bd64233ae875b6b3315fe4fab279335a6adf2b.tar.gz vcpkg-f4bd64233ae875b6b3315fe4fab279335a6adf2b.zip | |
Build fix with MinGW GCC 9.2.0 (#12084)
* Build fix with MinGW GCC 9.2.0
* Fix MinGW tripplets
Fixes #12065
* clang-format
* Fix unused read_symlink_implementation warning marked as error
read_symlink_implementation was used only in copy_symlink_implementation
when #if defined(_WIN32) && !VCPKG_USE_STD_FILESYSTEM was true.
Removed the warning otherwise.
Co-authored-by: JackBoosY <yuzaiyang@beyondsoft.com>
Diffstat (limited to 'toolsrc/src')
| -rw-r--r-- | toolsrc/src/vcpkg/base/files.cpp | 6 | ||||
| -rw-r--r-- | toolsrc/src/vcpkg/base/system.process.cpp | 4 | ||||
| -rw-r--r-- | toolsrc/src/vcpkg/build.cpp | 8 |
3 files changed, 10 insertions, 8 deletions
diff --git a/toolsrc/src/vcpkg/base/files.cpp b/toolsrc/src/vcpkg/base/files.cpp index 704f5c24f..902b482d2 100644 --- a/toolsrc/src/vcpkg/base/files.cpp +++ b/toolsrc/src/vcpkg/base/files.cpp @@ -102,9 +102,9 @@ namespace vcpkg::Files return status_implementation(false, p, ec); } +#if defined(_WIN32) && !VCPKG_USE_STD_FILESYSTEM fs::path read_symlink_implementation(const fs::path& oldpath, std::error_code& ec) { -#if defined(_WIN32) && !VCPKG_USE_STD_FILESYSTEM ec.clear(); auto handle = CreateFileW(oldpath.c_str(), 0, // open just the metadata @@ -132,10 +132,8 @@ namespace vcpkg::Files } CloseHandle(handle); return target; -#else // ^^^ defined(_WIN32) && !VCPKG_USE_STD_FILESYSTEM // !defined(_WIN32) || VCPKG_USE_STD_FILESYSTEM vvv - return fs::stdfs::read_symlink(oldpath, ec); -#endif // ^^^ !defined(_WIN32) || VCPKG_USE_STD_FILESYSTEM } +#endif // ^^^ !defined(_WIN32) || VCPKG_USE_STD_FILESYSTEM void copy_symlink_implementation(const fs::path& oldpath, const fs::path& newpath, std::error_code& ec) { diff --git a/toolsrc/src/vcpkg/base/system.process.cpp b/toolsrc/src/vcpkg/base/system.process.cpp index fba866fb8..bc67c1114 100644 --- a/toolsrc/src/vcpkg/base/system.process.cpp +++ b/toolsrc/src/vcpkg/base/system.process.cpp @@ -598,7 +598,7 @@ namespace vcpkg #if defined(_WIN32) using vcpkg::g_ctrl_c_state; g_ctrl_c_state.transition_to_spawn_process(); - auto proc_info = windows_create_process(cmd_line, env, NULL); + auto proc_info = windows_create_process(cmd_line, env, 0); auto long_exit_code = [&]() -> unsigned long { if (auto p = proc_info.get()) return p->wait(); @@ -660,7 +660,7 @@ namespace vcpkg using vcpkg::g_ctrl_c_state; g_ctrl_c_state.transition_to_spawn_process(); - auto maybe_proc_info = windows_create_process_redirect(cmd_line, env, NULL); + auto maybe_proc_info = windows_create_process_redirect(cmd_line, env, 0); auto exit_code = [&]() -> unsigned long { if (auto p = maybe_proc_info.get()) return p->wait_and_stream_output(data_cb); diff --git a/toolsrc/src/vcpkg/build.cpp b/toolsrc/src/vcpkg/build.cpp index 147ad46b2..bcd0a7f89 100644 --- a/toolsrc/src/vcpkg/build.cpp +++ b/toolsrc/src/vcpkg/build.cpp @@ -490,7 +490,7 @@ namespace vcpkg::Build std::ofstream out_file(stdoutlog.native().c_str(), std::ios::out | std::ios::binary | std::ios::trunc); Checks::check_exit(VCPKG_LINE_INFO, out_file, "Failed to open '%s' for writing", stdoutlog.u8string()); std::string compiler_hash; - const int return_code = System::cmd_execute_and_stream_lines( + System::cmd_execute_and_stream_lines( command, [&](const std::string& s) { static const StringLiteral s_marker = "#COMPILER_HASH#"; @@ -616,6 +616,10 @@ namespace vcpkg::Build { return m_paths.scripts / fs::u8path("toolchains/ios.cmake"); } + else if (cmake_system_name == "MinGW") + { + return m_paths.scripts / fs::u8path("toolchains/mingw.cmake"); + } else if (cmake_system_name.empty() || cmake_system_name == "Windows" || cmake_system_name == "WindowsStore") { return m_paths.scripts / fs::u8path("toolchains/windows.cmake"); @@ -1148,7 +1152,7 @@ namespace vcpkg::Build PreBuildInfo::PreBuildInfo(const VcpkgPaths& paths, Triplet triplet, const std::unordered_map<std::string, std::string>& cmakevars) - : m_paths(paths), triplet(triplet) + : triplet(triplet), m_paths(paths) { enum class VcpkgTripletVar { |
