Use cwstring_view in CMakeVariable

This commit is contained in:
Robert Schumacher 2017-03-31 16:42:06 -07:00 коммит произвёл Alexander Karatarakis
Родитель 60445c1150
Коммит a7c13ce724
2 изменённых файлов: 8 добавлений и 8 удалений

Просмотреть файл

@ -24,10 +24,10 @@ namespace vcpkg
struct CMakeVariable
{
CMakeVariable(const std::wstring& varname, const wchar_t* varvalue);
CMakeVariable(const std::wstring& varname, const std::string& varvalue);
CMakeVariable(const std::wstring& varname, const std::wstring& varvalue);
CMakeVariable(const std::wstring& varname, const fs::path& path);
CMakeVariable(const cwstring_view varname, const wchar_t* varvalue);
CMakeVariable(const cwstring_view varname, const std::string& varvalue);
CMakeVariable(const cwstring_view varname, const std::wstring& varvalue);
CMakeVariable(const cwstring_view varname, const fs::path& path);
std::wstring s;
};

Просмотреть файл

@ -215,10 +215,10 @@ namespace vcpkg
return installed_files;
}
CMakeVariable::CMakeVariable(const std::wstring& varname, const wchar_t* varvalue) : s(Strings::wformat(LR"("-D%s=%s")", varname, varvalue)) { }
CMakeVariable::CMakeVariable(const std::wstring& varname, const std::string& varvalue) : CMakeVariable(varname, Strings::utf8_to_utf16(varvalue).c_str()) { }
CMakeVariable::CMakeVariable(const std::wstring& varname, const std::wstring& varvalue) : CMakeVariable(varname, varvalue.c_str()) {}
CMakeVariable::CMakeVariable(const std::wstring& varname, const fs::path& path) : CMakeVariable(varname, path.generic_wstring()) {}
CMakeVariable::CMakeVariable(const cwstring_view varname, const wchar_t* varvalue) : s(Strings::wformat(LR"("-D%s=%s")", varname, varvalue)) { }
CMakeVariable::CMakeVariable(const cwstring_view varname, const std::string& varvalue) : CMakeVariable(varname, Strings::utf8_to_utf16(varvalue).c_str()) { }
CMakeVariable::CMakeVariable(const cwstring_view varname, const std::wstring& varvalue) : CMakeVariable(varname, varvalue.c_str()) {}
CMakeVariable::CMakeVariable(const cwstring_view varname, const fs::path& path) : CMakeVariable(varname, path.generic_wstring()) {}
std::wstring make_cmake_cmd(const fs::path& cmake_exe, const fs::path& cmake_script, const std::vector<CMakeVariable>& pass_variables)
{