mirror of
https://github.com/microsoft/vcpkg.git
synced 2024-12-12 22:19:07 +08:00
[vcpkg] fix cmake paths in tags (alternative 2) (#14661)
* [vcpkg] fix cmake paths in tags (alternative 2) * fix compile on VS2019 unnecessary and invalid SFINAE'd constructor
This commit is contained in:
parent
88de49b139
commit
e803bf1129
@ -32,11 +32,6 @@ namespace vcpkg
|
|||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
template<size_t N, class = std::enable_if_t<std::is_const<T>::value>>
|
|
||||||
constexpr Span(std::remove_const_t<T> (&arr)[N]) noexcept : m_ptr(arr), m_count(N)
|
|
||||||
{
|
|
||||||
}
|
|
||||||
|
|
||||||
template<class Range,
|
template<class Range,
|
||||||
class = decltype(std::declval<Range>().data()),
|
class = decltype(std::declval<Range>().data()),
|
||||||
class = std::enable_if_t<!std::is_same<std::decay_t<Range>, Span>::value>>
|
class = std::enable_if_t<!std::is_same<std::decay_t<Range>, Span>::value>>
|
||||||
|
@ -85,17 +85,29 @@ namespace vcpkg::CMakeVars
|
|||||||
{
|
{
|
||||||
emitted_triplets[spec_abi_setting.first->package_spec.triplet()] = emitted_triplet_id++;
|
emitted_triplets[spec_abi_setting.first->package_spec.triplet()] = emitted_triplet_id++;
|
||||||
}
|
}
|
||||||
|
|
||||||
Strings::append(extraction_file, "macro(vcpkg_triplet_file VCPKG_TRIPLET_ID)\n");
|
Strings::append(extraction_file, "macro(vcpkg_triplet_file VCPKG_TRIPLET_ID)\n");
|
||||||
|
Strings::append(extraction_file,
|
||||||
|
"set(_vcpkg_triplet_file_BACKUP_CURRENT_LIST_FILE \"${CMAKE_CURRENT_LIST_FILE}\")\n");
|
||||||
|
|
||||||
for (auto& p : emitted_triplets)
|
for (auto& p : emitted_triplets)
|
||||||
{
|
{
|
||||||
Strings::append(extraction_file,
|
auto path_to_triplet = paths.get_triplet_file_path(p.first);
|
||||||
"if(VCPKG_TRIPLET_ID EQUAL ",
|
Strings::append(extraction_file, "if(VCPKG_TRIPLET_ID EQUAL ", p.second, ")\n");
|
||||||
p.second,
|
Strings::append(
|
||||||
")\n",
|
extraction_file, "set(CMAKE_CURRENT_LIST_FILE \"", fs::generic_u8string(path_to_triplet), "\")\n");
|
||||||
fs.read_contents(paths.get_triplet_file_path(p.first), VCPKG_LINE_INFO),
|
Strings::append(
|
||||||
"\nendif()\n");
|
extraction_file,
|
||||||
|
"get_filename_component(CMAKE_CURRENT_LIST_DIR \"${CMAKE_CURRENT_LIST_FILE}\" DIRECTORY)\n");
|
||||||
|
Strings::append(extraction_file, fs.read_contents(paths.get_triplet_file_path(p.first), VCPKG_LINE_INFO));
|
||||||
|
Strings::append(extraction_file, "\nendif()\n");
|
||||||
}
|
}
|
||||||
|
Strings::append(extraction_file,
|
||||||
|
"set(CMAKE_CURRENT_LIST_FILE \"${_vcpkg_triplet_file_BACKUP_CURRENT_LIST_FILE}\")\n");
|
||||||
|
Strings::append(extraction_file,
|
||||||
|
"get_filename_component(CMAKE_CURRENT_LIST_DIR \"${CMAKE_CURRENT_LIST_FILE}\" DIRECTORY)\n");
|
||||||
Strings::append(extraction_file, "endmacro()\n");
|
Strings::append(extraction_file, "endmacro()\n");
|
||||||
|
|
||||||
for (const auto& spec_abi_setting : spec_abi_settings)
|
for (const auto& spec_abi_setting : spec_abi_settings)
|
||||||
{
|
{
|
||||||
const FullPackageSpec& spec = *spec_abi_setting.first;
|
const FullPackageSpec& spec = *spec_abi_setting.first;
|
||||||
|
Loading…
Reference in New Issue
Block a user