Move to VCPKG. (#46)

This commit is contained in:
Mikaël Capelle
2025-05-29 11:03:38 +02:00
committed by GitHub
parent a7dad4a353
commit de1d783fbb
62 changed files with 262 additions and 129 deletions
+7
View File
@@ -0,0 +1,7 @@
# Set the default behavior, in case people don't have core.autocrlf set.
* text=auto
# Explicitly declare text files you want to always be normalized and converted
# to native line endings on checkout.
*.cpp text eol=crlf
*.h text eol=crlf
+20
View File
@@ -0,0 +1,20 @@
name: Build BSA Packer
on:
push:
branches: [master]
pull_request:
types: [opened, synchronize, reopened]
env:
VCPKG_BINARY_SOURCES: clear;x-azblob,${{ vars.AZ_BLOB_VCPKG_URL }},${{ secrets.AZ_BLOB_SAS }},readwrite
jobs:
build:
runs-on: windows-2022
steps:
- name: Build BSA Packer
id: build-bsa-packer
uses: ModOrganizer2/build-with-mob-action@master
with:
mo2-dependencies: uibase
+20
View File
@@ -0,0 +1,20 @@
repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v5.0.0
hooks:
- id: trailing-whitespace
- id: end-of-file-fixer
- id: check-merge-conflict
- id: check-case-conflict
# - repo: https://github.com/pre-commit/mirrors-clang-format
# rev: v19.1.5
# hooks:
# - id: clang-format
# 'types_or': [c++, c]
ci:
autofix_commit_msg: "[pre-commit.ci] Auto fixes from pre-commit.com hooks."
autofix_prs: true
autoupdate_commit_msg: "[pre-commit.ci] Pre-commit autoupdate."
autoupdate_schedule: quarterly
submodules: false
+4 -7
View File
@@ -1,16 +1,13 @@
cmake_minimum_required(VERSION 3.16)
if(DEFINED DEPENDENCIES_DIR)
include(${DEPENDENCIES_DIR}/modorganizer_super/cmake_common/mo2.cmake)
else()
include(${CMAKE_CURRENT_LIST_DIR}/../cmake_common/mo2.cmake)
endif()
set(MO2_CMAKE_DEPRECATED_UIBASE_INCLUDE ON)
project(bsa_packer)
add_subdirectory(src)
set(BSAPACKER_TESTS ${BSAPACKER_TESTS} CACHE BOOL "build tests for bsapacker plugin")
if(BSAPACKER_TESTS)
set(BUILD_TESTING ${BUILD_TESTING} CACHE BOOL "build tests for bsapacker plugin")
if(BUILD_TESTING)
enable_testing()
add_subdirectory(tests)
endif()
+63
View File
@@ -0,0 +1,63 @@
{
"configurePresets": [
{
"errors": {
"deprecated": true
},
"hidden": true,
"name": "cmake-dev",
"warnings": {
"deprecated": true,
"dev": true
}
},
{
"cacheVariables": {
"VCPKG_MANIFEST_NO_DEFAULT_FEATURES": {
"type": "BOOL",
"value": "ON"
}
},
"toolchainFile": "$env{VCPKG_ROOT}/scripts/buildsystems/vcpkg.cmake",
"hidden": true,
"name": "vcpkg"
},
{
"cacheVariables": {
"VCPKG_MANIFEST_FEATURES": {
"type": "STRING",
"value": "testing"
}
},
"hidden": true,
"inherits": ["vcpkg"],
"name": "vcpkg-dev"
},
{
"binaryDir": "${sourceDir}/vsbuild",
"architecture": {
"strategy": "set",
"value": "x64"
},
"cacheVariables": {
"CMAKE_CXX_FLAGS": "/EHsc /MP /W4",
"VCPKG_TARGET_TRIPLET": {
"type": "STRING",
"value": "x64-windows-static-md"
}
},
"generator": "Visual Studio 17 2022",
"inherits": ["cmake-dev", "vcpkg-dev"],
"name": "vs2022-windows",
"toolset": "v143"
}
],
"buildPresets": [
{
"name": "vs2022-windows",
"resolvePackageReferences": "on",
"configurePreset": "vs2022-windows"
}
],
"version": 4
}
-41
View File
@@ -1,41 +0,0 @@
version: 1.0.{build}
skip_branch_with_pr: true
image: Visual Studio 2019
environment:
WEBHOOK_URL:
secure: gOKbXaZM9ImtMD5XrYITvdyZUW/az082G9OIN1EC1Vbg57wBaeLhi49uGjxPw5GVujHku6kxN6ab89zhbS5GVeluR76GM83IbKV4Sh7udXzoYZZdg6YudtYHzdhCgUeiedpswbuczTq9ceIkkfSEWZuh/lMAAVVwvcGsJAnoPFw=
build_script:
- pwsh: >-
$ErrorActionPreference = 'Stop'
git clone --depth=1 --no-single-branch https://github.com/ModOrganizer2/modorganizer-umbrella.git c:\projects\modorganizer-umbrella
New-Item -ItemType Directory -Path c:\projects\modorganizer-build
cd c:\projects\modorganizer-umbrella
($env:APPVEYOR_PULL_REQUEST_HEAD_REPO_BRANCH -eq $null) ? ($branch = $env:APPVEYOR_REPO_BRANCH) : ($branch = $env:APPVEYOR_PULL_REQUEST_HEAD_REPO_BRANCH)
git checkout $(git show-ref --verify --quiet refs/remotes/origin/${branch} || echo '-b') ${branch}
C:\Python37-x64\python.exe unimake.py -d c:\projects\modorganizer-build -s Appveyor_Build=True ${env:APPVEYOR_PROJECT_NAME}
if($LastExitCode -ne 0) { $host.SetShouldExit($LastExitCode ) }
artifacts:
- path: vsbuild\src\RelWithDebInfo\bsa_packer.dll
name: bsa_packer_dll
- path: vsbuild\src\RelWithDebInfo\bsa_packer.pdb
name: bsa_packer_pdb
- path: vsbuild\src\RelWithDebInfo\bsa_packer.lib
name: bsa_packer_lib
- path: build\tests\bsa_packer_tests.exe
on_success:
- ps: Set-Location -Path $env:APPVEYOR_BUILD_FOLDER
- ps: Invoke-RestMethod https://raw.githubusercontent.com/DiscordHooks/appveyor-discord-webhook/master/send.ps1 -o send.ps1
- ps: ./send.ps1 success $env:WEBHOOK_URL
on_failure:
- ps: Set-Location -Path $env:APPVEYOR_BUILD_FOLDER
- ps: Push-AppveyorArtifact ${env:APPVEYOR_BUILD_FOLDER}\stdout.log
- ps: Push-AppveyorArtifact ${env:APPVEYOR_BUILD_FOLDER}\stderr.log
- ps: Invoke-RestMethod https://raw.githubusercontent.com/DiscordHooks/appveyor-discord-webhook/master/send.ps1 -o send.ps1
- ps: ./send.ps1 failure $env:WEBHOOK_URL
+1 -1
View File
@@ -5,7 +5,7 @@
namespace BsaPacker
{
bool ArchiveAutoService::CreateBSA(libbsarch::bs_archive_auto* archive, const QString& archiveName, const bsa_archive_type_e type) const
bool ArchiveAutoService::CreateBSA(libbsarch::bs_archive_auto* archive, const QString& archiveName, const bsa_archive_type_e) const
{
QProgressDialog savingDialog;
savingDialog.setWindowFlags(savingDialog.windowFlags() & ~Qt::WindowCloseButtonHint);
+8 -8
View File
@@ -1,7 +1,7 @@
#include <bsapacker/ArchiveBuilderHelper.h>
#include <algorithm>
#include <boost/algorithm/string.hpp>
#include <ranges>
#include "SettingsService.h"
@@ -61,13 +61,13 @@ namespace BsaPacker
bool ArchiveBuilderHelper::isExtensionBlacklisted(const path& filepath) const
{
const auto& setting = this->m_SettingsService->GetPluginSetting(SettingsService::SETTING_BLACKLISTED_FILES).toString().toStdString();
std::set<std::string> blacklist;
boost::split(blacklist, setting, [](char c){return c == ';';});
const auto& extension = filepath.extension().string();
const auto& count = blacklist.count(extension);
const auto& result = count > 0;
return result;
const auto &extension = filepath.extension().string();
const auto count = std::ranges::count(
setting | std::views::split(' '),
extension,
[](auto r)
{ return std::string_view(r.data(), r.size()); });
return count > 0;
}
bool ArchiveBuilderHelper::doesPathContainFiles(const path& filepath, const std::vector<path::string_type>& files) const
+1 -1
View File
@@ -72,4 +72,4 @@ namespace BsaPacker
}
return QString();
}
}
}
-1
View File
@@ -63,4 +63,3 @@ bsa_entry_list_t BSArchiveEntries::getEntries() const
{
return _entries;
}
+20 -6
View File
@@ -1,11 +1,25 @@
cmake_minimum_required(VERSION 3.16)
add_library(bsa_packer SHARED)
mo2_configure_plugin(bsa_packer WARNINGS OFF
PRIVATE_DEPENDS boost Qt::Concurrent libbsarch)
find_package(Qt6 COMPONENTS Concurrent)
find_path(BEXT_DI_INCLUDE_DIRS "boost/di.hpp")
find_package(mo2-cmake CONFIG REQUIRED)
find_package(mo2-uibase CONFIG REQUIRED)
find_package(mo2-libbsarch CONFIG REQUIRED)
find_package(mo2-dds-header CONFIG REQUIRED)
find_package(DirectXTex CONFIG REQUIRED)
target_include_directories(bsa_packer
PUBLIC ${CMAKE_CURRENT_SOURCE_DIR} PRIVATE ${BOOST_DI_ROOT}/include)
add_library(bsa_packer SHARED)
mo2_configure_plugin(bsa_packer WARNINGS OFF)
target_link_libraries(bsa_packer PUBLIC mo2::uibase Qt6::Concurrent mo2::libbsarch Microsoft::DirectXTex)
target_include_directories(bsa_packer PUBLIC ${BEXT_DI_INCLUDE_DIRS} ${CMAKE_CURRENT_SOURCE_DIR})
target_compile_definitions(bsa_packer PRIVATE BSAPACKER_LIBRARY)
mo2_install_target(bsa_packer)
# need to deploy this here as MO2 does not depends on Qt6::Concurrent
install(FILES $<TARGET_FILE:Qt6::Concurrent> DESTINATION bin/dlls)
# this is done by modorganizer itself now
#
# install(FILES $<TARGET_FILE:mo2::libbsarch> DESTINATION bin/dlls)
mo2_install_plugin(bsa_packer)
-1
View File
@@ -52,4 +52,3 @@ namespace BsaPacker
return std::make_unique<NullDummyPluginService>();
}
} // namespace BsaPacker
+1 -1
View File
@@ -37,7 +37,7 @@ namespace BsaPacker
if (primarySource == "FalloutNV") { // TTW
return NexusId::NewVegas;
}
}
}
return nexusId;
}
-1
View File
@@ -26,4 +26,3 @@ namespace BsaPacker
sizeof(NewVegasDummyPluginService::RAW_NEWVEGAS));
}
}
+1 -1
View File
@@ -2,7 +2,7 @@
namespace BsaPacker
{
bool NullDummyPluginService::CreatePlugin(const QString& modPath, const QString& archiveNameBase) const
bool NullDummyPluginService::CreatePlugin([[maybe_unused]] const QString& modPath, [[maybe_unused]] const QString& archiveNameBase) const
{
return false;
}
-1
View File
@@ -24,4 +24,3 @@ namespace BsaPacker
sizeof(OblivionDummyPluginService::RAW_OBLIVION));
}
}
+2 -2
View File
@@ -38,7 +38,7 @@ namespace BsaPacker {
res = false;
}
}
return res;
}
} // namespace BsaPacker
} // namespace BsaPacker
+1 -1
View File
@@ -18,4 +18,4 @@ namespace BsaPacker {
};
} // namespace BsaPacker
#endif // OVERRIDEFILESERVICE_H
#endif // OVERRIDEFILESERVICE_H
+1 -1
View File
@@ -97,7 +97,7 @@ namespace BsaPacker
this->m_Cancelled = true;
}
void TextureArchiveBuilder::DDSCallback(bsa_archive_t archive, const wchar_t* file_path, bsa_dds_info_t* dds_info, void* context)
void TextureArchiveBuilder::DDSCallback(bsa_archive_t, const wchar_t* file_path, bsa_dds_info_t* dds_info, void* context)
{
const auto& path = *static_cast<std::wstring*>(context) + L'/' + std::wstring(file_path);
+1 -1
View File
@@ -1 +1 @@
{}
{}

Some files were not shown because too many files have changed in this diff Show More