Skip to content
Closed
Changes from 4 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
25 changes: 25 additions & 0 deletions src/vcpkg/postbuildlint.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -320,7 +320,31 @@ namespace vcpkg::PostBuildLint

return LintStatus::SUCCESS;
}
static LintStatus check_share_folder_names(const Filesystem& fs, const Path& package_dir)
{
const auto cmake_folder_name = package_dir / "share";
std::error_code ec;
const auto share_folders = fs.get_directories_non_recursive(cmake_folder_name, ec);
for (auto&& share_folder : share_folders)
{
auto folder_name = share_folder.filename().to_string();
Comment thread
JackBoosY marked this conversation as resolved.
const auto orig_folder_name = folder_name;
Strings::ascii_to_lowercase(folder_name.data(), folder_name.data() + folder_name.size());

if (orig_folder_name != folder_name)
{
vcpkg::printf(Color::warning,
"Folders in /share must use lowercase ascii characters. Please rename it.\n"
" file(RENAME \"${CURRENT_PACKAGES_DIR}/share/%s\" "
"\"${CURRENT_PACKAGES_DIR}/share/%s\")\n",
orig_folder_name,
folder_name);
Comment thread
JackBoosY marked this conversation as resolved.
Outdated
return LintStatus::PROBLEM_DETECTED;
}
}

return LintStatus::SUCCESS;
}
static LintStatus check_for_dlls_in_lib_dir(const Filesystem& fs, const Path& package_dir)
{
std::vector<Path> dlls = fs.get_regular_files_recursive(package_dir / "lib", IgnoreErrors{});
Expand Down Expand Up @@ -1053,6 +1077,7 @@ namespace vcpkg::PostBuildLint
error_count += check_folder_lib_cmake(fs, package_dir, spec);
error_count += check_for_misplaced_cmake_files(fs, package_dir, spec);
error_count += check_folder_debug_lib_cmake(fs, package_dir, spec);
error_count += check_share_folder_names(fs, package_dir);
error_count += check_for_dlls_in_lib_dir(fs, package_dir);
error_count += check_for_dlls_in_lib_dir(fs, package_dir / "debug");
error_count += check_for_copyright_file(fs, spec, paths);
Expand Down