mirror of
https://github.com/cemu-project/vcpkg.git
synced 2024-11-24 19:59:43 +00:00
[vcpkg] Fix regressions in WSL build.
This commit is contained in:
parent
7b7e7dac3b
commit
63a23cf0ca
@ -3,10 +3,12 @@ project(vcpkg CXX)
|
||||
|
||||
add_compile_options(-std=c++1z)
|
||||
|
||||
if(CMAKE_COMPILER_IS_GNUXX)
|
||||
if(CMAKE_COMPILER_IS_GNUXX OR CMAKE_CXX_COMPILER_ID MATCHES "GNU")
|
||||
set(GCC 1)
|
||||
elseif(CMAKE_CXX_COMPILER_ID MATCHES "[Cc]lang")
|
||||
set(CLANG 1)
|
||||
else()
|
||||
message(FATAL_ERROR "Unknown compiler: ${CMAKE_CXX_COMPILER_ID}")
|
||||
endif()
|
||||
|
||||
file(GLOB_RECURSE VCPKGLIB_SOURCES src/vcpkg/*.cpp)
|
||||
|
@ -53,10 +53,8 @@ namespace vcpkg
|
||||
// Constructors are intentionally implicit
|
||||
constexpr Optional(NullOpt) {}
|
||||
|
||||
Optional(const T& t) : m_base(t) {}
|
||||
|
||||
template<class = std::enable_if_t<!std::is_reference<T>::value>>
|
||||
Optional(T&& t) : m_base(std::move(t))
|
||||
template<class U>
|
||||
Optional(U&& t) : m_base(std::forward<U>(t))
|
||||
{
|
||||
}
|
||||
|
||||
|
@ -92,7 +92,13 @@ namespace vcpkg::Chrono
|
||||
Optional<CTime> CTime::parse(CStringView str)
|
||||
{
|
||||
CTime ret;
|
||||
auto assigned = sscanf_s(str.c_str(),
|
||||
auto assigned =
|
||||
#if defined(_WIN32)
|
||||
sscanf_s
|
||||
#else
|
||||
sscanf
|
||||
#endif
|
||||
(str.c_str(),
|
||||
"%d-%d-%dT%d:%d:%d.",
|
||||
&ret.m_tm.tm_year,
|
||||
&ret.m_tm.tm_mon,
|
||||
|
@ -5,6 +5,7 @@
|
||||
#include <vcpkg/paragraphs.h>
|
||||
#include <vcpkg/userconfig.h>
|
||||
|
||||
#if defined(_WIN32)
|
||||
namespace
|
||||
{
|
||||
static vcpkg::Lazy<fs::path> s_localappdata;
|
||||
@ -24,13 +25,14 @@ namespace
|
||||
});
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
namespace vcpkg
|
||||
{
|
||||
UserConfig UserConfig::try_read_data(const Files::Filesystem& fs)
|
||||
{
|
||||
UserConfig ret;
|
||||
|
||||
#if defined(_WIN32)
|
||||
try
|
||||
{
|
||||
auto maybe_pghs = Paragraphs::get_paragraphs(fs, get_localappdata() / "vcpkg" / "config");
|
||||
@ -56,12 +58,14 @@ namespace vcpkg
|
||||
catch (...)
|
||||
{
|
||||
}
|
||||
#endif
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
void UserConfig::try_write_data(Files::Filesystem& fs) const
|
||||
{
|
||||
#if defined(_WIN32)
|
||||
try
|
||||
{
|
||||
std::error_code ec;
|
||||
@ -79,5 +83,6 @@ namespace vcpkg
|
||||
catch (...)
|
||||
{
|
||||
}
|
||||
#endif
|
||||
}
|
||||
}
|
||||
|
@ -185,7 +185,6 @@
|
||||
<ClInclude Include="..\include\vcpkg\versiont.h" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ClCompile Include="..\src\commands.upgrade.cpp" />
|
||||
<ClCompile Include="..\src\pch.cpp">
|
||||
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">Create</PrecompiledHeader>
|
||||
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">Create</PrecompiledHeader>
|
||||
@ -221,6 +220,7 @@
|
||||
<ClCompile Include="..\src\vcpkg\commands.owns.cpp" />
|
||||
<ClCompile Include="..\src\vcpkg\commands.portsdiff.cpp" />
|
||||
<ClCompile Include="..\src\vcpkg\commands.search.cpp" />
|
||||
<ClCompile Include="..\src\vcpkg\commands.upgrade.cpp" />
|
||||
<ClCompile Include="..\src\vcpkg\commands.version.cpp" />
|
||||
<ClCompile Include="..\src\vcpkg\dependencies.cpp" />
|
||||
<ClCompile Include="..\src\vcpkg\export.cpp" />
|
||||
|
@ -195,7 +195,7 @@
|
||||
<ClCompile Include="..\src\vcpkg\userconfig.cpp">
|
||||
<Filter>Source Files\vcpkg</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\src\commands.upgrade.cpp">
|
||||
<ClCompile Include="..\src\vcpkg\commands.upgrade.cpp">
|
||||
<Filter>Source Files\vcpkg</Filter>
|
||||
</ClCompile>
|
||||
</ItemGroup>
|
||||
|
Loading…
Reference in New Issue
Block a user