Author SHA1 Message Date
Mikaël Capelle d9d7c8fc41 Fix format for clang-format 17. 2024-05-26 09:55:14 +02:00
Mikaël Capelle f28c98e274 Use MO2 formatting action. 2024-05-26 09:53:47 +02:00
4 changed files with 161 additions and 16 deletions
+2 -1
View File
@@ -89,6 +89,7 @@ lz4 = true
openssl = true
pyqt = true
python = true
usvfs = false
[versions]
vs = 17
@@ -116,7 +117,7 @@ qt = 6.7.0
qt_vs = 2019
zlib = v1.3.1
libbsarch = 0.0.9
usvfs = master
usvfs = qt6
explorerpp = 1.4.0
ss_paper_lad_6788 = 7.2
+2 -3
View File
@@ -52,11 +52,11 @@
#### Using aqt
- Open a terminal with administrative rights, and run
```powershell
aqt install-qt --outputdir "C:\Qt" windows desktop 6.7.0 win64_msvc2019_64 -m qtwebengine qtimageformats qtpositioning qtserialport qtwebchannel qtwebsockets
aqt install-qt --outputdir "C:\Qt" windows desktop 6.5.0 win64_msvc2019_64 -m qtwebengine qtimageformats qtpositioning qtserialport qtwebchannel qtwebsockets
```
### Qt - Manual installation
- Install Qt 6.7.0 ([Installer](https://download.qt.io/official_releases/online_installers/qt-unified-windows-x64-online.exe)) and select these components:
- Install Qt 6.5.0 ([Installer](https://download.qt.io/official_releases/online_installers/qt-unified-windows-x64-online.exe)) and select these components:
- MSVC 2019 64-bit
- Additional Libraries:
- Qt WebEngine (display nexus pages)
@@ -91,7 +91,6 @@ aqt install-qt --outputdir "C:\Qt" windows desktop 6.7.0 win64_msvc2019_64 -m qt
mkdir C:\dev
cd C:\dev
git clone https://github.com/ModOrganizer2/mob
./bootstrap.ps1
mob -d C:\dev\modorganizer build
```
- Once `mob` is finished, everything will be in `C:\dev\modorganizer`. Mod Organizer can be run from `install\bin\ModOrganizer.exe`. The Visual Studio solution for Mod Organizer itself is `build\modorganizer_super\modorganizer\vsbuild\organizer.sln`.
+11
View File
@@ -646,10 +646,21 @@ namespace mob::tasks {
void do_build_and_install() override;
private:
void fetch_prebuilt();
void fetch_from_source();
void build_and_install_prebuilt();
void build_and_install_from_source();
void download_from_appveyor(arch a);
void copy_prebuilt(arch a);
msbuild create_msbuild_tool(arch a, msbuild::ops o = msbuild::build) const;
std::vector<std::shared_ptr<downloader>>
create_appveyor_downloaders(arch a,
downloader::ops o = downloader::download) const;
std::string prebuilt_directory_name(arch a) const;
};
class zlib : public basic_task<zlib> {
+146 -12
View File
@@ -22,7 +22,7 @@ namespace mob::tasks {
bool usvfs::prebuilt()
{
return false;
return conf().prebuilt().get<bool>("usvfs");
}
fs::path usvfs::source_path()
@@ -32,29 +32,68 @@ namespace mob::tasks {
void usvfs::do_clean(clean c)
{
// delete the whole directory
if (is_set(c, clean::reclone)) {
git_wrap::delete_directory(cx(), source_path());
if (prebuilt()) {
if (is_set(c, clean::redownload)) {
// the `downloader` class knows how to delete its own files, so
// create the same downloaders and ask them to clean
// nothing more to do
return;
const auto x86_dls =
create_appveyor_downloaders(arch::x86, downloader::clean);
const auto x64_dls =
create_appveyor_downloaders(arch::x64, downloader::clean);
for (auto dl : x86_dls)
run_tool(*dl);
for (auto dl : x64_dls)
run_tool(*dl);
}
}
else {
// delete the whole directory
if (is_set(c, clean::reclone)) {
git_wrap::delete_directory(cx(), source_path());
if (is_set(c, clean::rebuild)) {
// msbuild clean
run_tool(create_msbuild_tool(arch::x86, msbuild::clean));
run_tool(create_msbuild_tool(arch::x64, msbuild::clean));
// nothing more to do
return;
}
if (is_set(c, clean::rebuild)) {
// msbuild clean
run_tool(create_msbuild_tool(arch::x86, msbuild::clean));
run_tool(create_msbuild_tool(arch::x64, msbuild::clean));
}
}
}
void usvfs::do_fetch()
{
fetch_from_source();
if (prebuilt())
fetch_prebuilt();
else
fetch_from_source();
}
void usvfs::do_build_and_install()
{
build_and_install_from_source();
if (prebuilt())
build_and_install_prebuilt();
else
build_and_install_from_source();
}
void usvfs::fetch_prebuilt()
{
fetch_from_source();
download_from_appveyor(arch::x64);
download_from_appveyor(arch::x86);
}
void usvfs::build_and_install_prebuilt()
{
copy_prebuilt(arch::x86);
copy_prebuilt(arch::x64);
}
void usvfs::fetch_from_source()
@@ -71,6 +110,41 @@ namespace mob::tasks {
run_tool(create_msbuild_tool(arch::x64));
}
void usvfs::download_from_appveyor(arch a)
{
// create all downloaders, run them in parallel
parallel_functions v;
for (auto dl : create_appveyor_downloaders(a))
v.emplace_back("usvfs", [this, dl] {
run_tool(*dl);
});
parallel(v);
}
void usvfs::copy_prebuilt(arch a)
{
const auto path = conf().path();
const auto src = path.build() / prebuilt_directory_name(a);
// dlls and exes to install/bin/
op::copy_glob_to_dir_if_better(cx(), src / "*.dll", path.install_bin(),
op::copy_files);
op::copy_glob_to_dir_if_better(cx(), src / "*.exe", path.install_bin(),
op::copy_files);
// pdbs
op::copy_glob_to_dir_if_better(cx(), src / "*.pdb", path.install_pdbs(),
op::copy_files);
// libs
op::copy_glob_to_dir_if_better(cx(), src / "*.lib", path.install_libs(),
op::copy_files);
}
msbuild usvfs::create_msbuild_tool(arch a, msbuild::ops o) const
{
// usvfs doesn't use "Win32" for 32-bit, it uses "x86"
@@ -97,4 +171,64 @@ namespace mob::tasks {
.set("BOOST_PATH", path_to_utf8(boost::source_path()))));
}
std::vector<std::shared_ptr<downloader>>
usvfs::create_appveyor_downloaders(arch a, downloader::ops o) const
{
std::string arch_s;
switch (a) {
case arch::x86:
arch_s = "x86";
break;
case arch::x64:
arch_s = "x64";
break;
case arch::dont_care:
default:
cx().bail_out(context::generic, "bad arch");
}
// returns an appveyor downloader for the given filename that outputs into
// build/usvfs_bin[_32]/
auto make_dl = [&](std::string filename) {
const auto u = make_appveyor_artifact_url(a, "usvfs", filename);
const std::string dir = prebuilt_directory_name(a);
auto dl = std::make_shared<downloader>(o);
dl->url(u);
dl->file(conf().path().build() / dir / u.filename());
return dl;
};
std::vector<std::shared_ptr<downloader>> v;
// five downloaders for the pdbs, dlls, libs and exes
v.push_back(make_dl("lib/usvfs_" + arch_s + ".pdb"));
v.push_back(make_dl("lib/usvfs_" + arch_s + ".dll"));
v.push_back(make_dl("lib/usvfs_" + arch_s + ".lib"));
v.push_back(make_dl("bin/usvfs_proxy_" + arch_s + ".exe"));
v.push_back(make_dl("bin/usvfs_proxy_" + arch_s + ".pdb"));
return v;
}
std::string usvfs::prebuilt_directory_name(arch a) const
{
switch (a) {
case arch::x86:
return "usvfs_bin_32";
case arch::x64:
return "usvfs_bin";
case arch::dont_care:
default:
cx().bail_out(context::generic, "bad arch");
}
}
} // namespace mob::tasks