mirror of
https://github.com/ModOrganizer2/mob.git
synced 2026-07-27 14:07:05 -07:00
Compare commits
6
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
1bb0c4ce3d | ||
|
|
f99e777433 | ||
|
|
ecd210d700 | ||
|
|
d1965acd1a | ||
|
|
27483d6ddc | ||
|
|
73d7d3dd2b |
@@ -10,9 +10,8 @@ jobs:
|
|||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v3
|
- uses: actions/checkout@v3
|
||||||
- name: Run clang-format
|
- name: Check format
|
||||||
uses: jidicula/clang-format-action@v4.11.0
|
uses: ModOrganizer2/check-formatting-action@master
|
||||||
with:
|
with:
|
||||||
clang-format-version: "16"
|
|
||||||
check-path: "."
|
check-path: "."
|
||||||
exclude-regex: "third-party"
|
exclude-regex: "third-party"
|
||||||
|
|||||||
@@ -29,6 +29,7 @@ mo_fallback =
|
|||||||
no_pull = false
|
no_pull = false
|
||||||
ignore_ts = false
|
ignore_ts = false
|
||||||
revert_ts = false
|
revert_ts = false
|
||||||
|
configuration = RelWithDebInfo
|
||||||
|
|
||||||
git_url_prefix = https://github.com/
|
git_url_prefix = https://github.com/
|
||||||
git_shallow = true
|
git_shallow = true
|
||||||
@@ -89,7 +90,6 @@ lz4 = true
|
|||||||
openssl = true
|
openssl = true
|
||||||
pyqt = true
|
pyqt = true
|
||||||
python = true
|
python = true
|
||||||
usvfs = false
|
|
||||||
|
|
||||||
[versions]
|
[versions]
|
||||||
vs = 17
|
vs = 17
|
||||||
@@ -117,9 +117,8 @@ qt = 6.7.0
|
|||||||
qt_vs = 2019
|
qt_vs = 2019
|
||||||
zlib = v1.3.1
|
zlib = v1.3.1
|
||||||
libbsarch = 0.0.9
|
libbsarch = 0.0.9
|
||||||
usvfs = qt6
|
usvfs = master
|
||||||
explorerpp = 1.4.0
|
explorerpp = 1.4.0
|
||||||
|
|
||||||
ss_paper_lad_6788 = 7.2
|
ss_paper_lad_6788 = 7.2
|
||||||
ss_paper_automata_6788 = 3.2
|
ss_paper_automata_6788 = 3.2
|
||||||
ss_paper_mono_6788 = 3.2
|
ss_paper_mono_6788 = 3.2
|
||||||
@@ -130,6 +129,11 @@ ss_starfield_trosski = V1.11
|
|||||||
ss_fallout3_trosski = v1.11
|
ss_fallout3_trosski = v1.11
|
||||||
ss_fallout4_trosski = v1.11
|
ss_fallout4_trosski = v1.11
|
||||||
|
|
||||||
|
[build-types]
|
||||||
|
libbsarch = release
|
||||||
|
pyqt = release
|
||||||
|
python = release
|
||||||
|
|
||||||
[paths]
|
[paths]
|
||||||
third_party =
|
third_party =
|
||||||
prefix =
|
prefix =
|
||||||
|
|||||||
@@ -52,11 +52,11 @@
|
|||||||
#### Using aqt
|
#### Using aqt
|
||||||
- Open a terminal with administrative rights, and run
|
- Open a terminal with administrative rights, and run
|
||||||
```powershell
|
```powershell
|
||||||
aqt install-qt --outputdir "C:\Qt" windows desktop 6.5.0 win64_msvc2019_64 -m qtwebengine qtimageformats qtpositioning qtserialport qtwebchannel qtwebsockets
|
aqt install-qt --outputdir "C:\Qt" windows desktop 6.7.0 win64_msvc2019_64 -m qtwebengine qtimageformats qtpositioning qtserialport qtwebchannel qtwebsockets
|
||||||
```
|
```
|
||||||
|
|
||||||
### Qt - Manual installation
|
### Qt - Manual installation
|
||||||
- Install Qt 6.5.0 ([Installer](https://download.qt.io/official_releases/online_installers/qt-unified-windows-x64-online.exe)) and select these components:
|
- Install Qt 6.7.0 ([Installer](https://download.qt.io/official_releases/online_installers/qt-unified-windows-x64-online.exe)) and select these components:
|
||||||
- MSVC 2019 64-bit
|
- MSVC 2019 64-bit
|
||||||
- Additional Libraries:
|
- Additional Libraries:
|
||||||
- Qt WebEngine (display nexus pages)
|
- Qt WebEngine (display nexus pages)
|
||||||
@@ -91,6 +91,7 @@ aqt install-qt --outputdir "C:\Qt" windows desktop 6.5.0 win64_msvc2019_64 -m qt
|
|||||||
mkdir C:\dev
|
mkdir C:\dev
|
||||||
cd C:\dev
|
cd C:\dev
|
||||||
git clone https://github.com/ModOrganizer2/mob
|
git clone https://github.com/ModOrganizer2/mob
|
||||||
|
./bootstrap.ps1
|
||||||
mob -d C:\dev\modorganizer build
|
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`.
|
- 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`.
|
||||||
@@ -143,6 +144,7 @@ Options for individual tasks. Can be `[task_name:task]`, where `task_name` is th
|
|||||||
| Option | Type | Description |
|
| Option | Type | Description |
|
||||||
| --- | --- | --- |
|
| --- | --- | --- |
|
||||||
| `enabled` | bool | Whether this task is enabled. Disabled tasks are never built. When specifying task names with `mob build task1 task2...`, all tasks except those given are turned off. |
|
| `enabled` | bool | Whether this task is enabled. Disabled tasks are never built. When specifying task names with `mob build task1 task2...`, all tasks except those given are turned off. |
|
||||||
|
| `configuration` | enum | Which configuration to build, should be one of Debug, Release or RelWithDebInfo with RelWithDebInfo being the default.|
|
||||||
|
|
||||||
#### Common git options
|
#### Common git options
|
||||||
Unless otherwise stated, applies to any task that is a git repo.
|
Unless otherwise stated, applies to any task that is a git repo.
|
||||||
|
|||||||
@@ -0,0 +1,9 @@
|
|||||||
|
param(
|
||||||
|
[Parameter(Mandatory = $true)][String]$Path,
|
||||||
|
[Parameter(Mandatory = $true)][String]$Output
|
||||||
|
)
|
||||||
|
|
||||||
|
7z a $Output (Join-Path -Path $Path -ChildPath "boost")
|
||||||
|
7z a $Output (Join-Path -Path $Path -ChildPath "lib32-msvc-14.3")
|
||||||
|
7z a $Output (Join-Path -Path $Path -ChildPath "lib64-msvc-14.3")
|
||||||
|
7z a $Output (Join-Path -Path $Path -ChildPath "LICENSE_1_0.txt")
|
||||||
@@ -0,0 +1,13 @@
|
|||||||
|
param(
|
||||||
|
[Parameter(Mandatory = $true)][String]$PyQtPath,
|
||||||
|
[Parameter(Mandatory = $true)][String]$PythonPath,
|
||||||
|
[Parameter(Mandatory = $true)][String]$Output
|
||||||
|
)
|
||||||
|
|
||||||
|
$Output = [IO.Path]::GetFullPath($Output)
|
||||||
|
|
||||||
|
7z a $Output (Join-Path -Path $PyQtPath -ChildPath "LICENSE")
|
||||||
|
|
||||||
|
Push-Location $PythonPath
|
||||||
|
7z a $Output "Lib/site-packages/PyQt6" "-xr!__pycache__"
|
||||||
|
Pop-Location
|
||||||
@@ -0,0 +1,10 @@
|
|||||||
|
param(
|
||||||
|
[Parameter(Mandatory = $true)][String]$Path,
|
||||||
|
[Parameter(Mandatory = $true)][String]$Output
|
||||||
|
)
|
||||||
|
|
||||||
|
7z a $Output (Join-Path -Path $Path -ChildPath "PCbuild/amd64") "-xr!pythoncore_temp"
|
||||||
|
7z rn $Output "amd64" "PCbuild/amd64"
|
||||||
|
7z a $Output (Join-Path -Path $Path -ChildPath "Include") "-xr!internal" "-xr!sip.h"
|
||||||
|
7z a $Output (Join-Path -Path $Path -ChildPath "Lib") "-xr!__pycache__" "-xr!site-packages"
|
||||||
|
7z a $Output (Join-Path -Path $Path -ChildPath "LICENSE")
|
||||||
+6
-1
@@ -33,12 +33,17 @@ namespace mob {
|
|||||||
(clipp::option("--install-prefix") & clipp::value("PATH") >> prefix_) %
|
(clipp::option("--install-prefix") & clipp::value("PATH") >> prefix_) %
|
||||||
"sets CMAKE_INSTALL_PREFIX [default: empty]",
|
"sets CMAKE_INSTALL_PREFIX [default: empty]",
|
||||||
|
|
||||||
|
(clipp::option("-d", "--debug").set(debug_, true)) %
|
||||||
|
"whether to configure for debug mode [default: false]",
|
||||||
|
|
||||||
(clipp::value("PATH") >> path_) % "path from which to run `cmake`");
|
(clipp::value("PATH") >> path_) % "path from which to run `cmake`");
|
||||||
}
|
}
|
||||||
|
|
||||||
int cmake_command::do_run()
|
int cmake_command::do_run()
|
||||||
{
|
{
|
||||||
auto t = tasks::modorganizer::create_cmake_tool(fs::path(utf8_to_utf16(path_)));
|
auto t = tasks::modorganizer::create_cmake_tool(
|
||||||
|
fs::path(utf8_to_utf16(path_)), mob::cmake::generate,
|
||||||
|
debug_ ? config::debug : config::relwithdebinfo);
|
||||||
|
|
||||||
t.generator(gen_);
|
t.generator(gen_);
|
||||||
t.cmd(cmd_);
|
t.cmd(cmd_);
|
||||||
|
|||||||
@@ -383,6 +383,7 @@ namespace mob {
|
|||||||
std::string gen_;
|
std::string gen_;
|
||||||
std::string cmd_;
|
std::string cmd_;
|
||||||
bool x64_ = true;
|
bool x64_ = true;
|
||||||
|
bool debug_ = false;
|
||||||
std::string prefix_;
|
std::string prefix_;
|
||||||
std::string path_;
|
std::string path_;
|
||||||
};
|
};
|
||||||
|
|||||||
+2
-2
@@ -116,8 +116,8 @@ namespace mob {
|
|||||||
if (!task)
|
if (!task)
|
||||||
return 1;
|
return 1;
|
||||||
|
|
||||||
u8cout << "checking out pr " << pr.number << " " << "in "
|
u8cout << "checking out pr " << pr.number << " "
|
||||||
<< task->name() << "\n";
|
<< "in " << task->name() << "\n";
|
||||||
|
|
||||||
git_wrap g(task->source_path());
|
git_wrap g(task->source_path());
|
||||||
|
|
||||||
|
|||||||
+90
-38
@@ -14,6 +14,11 @@ namespace mob::details {
|
|||||||
using key_value_map = std::map<std::string, std::string, std::less<>>;
|
using key_value_map = std::map<std::string, std::string, std::less<>>;
|
||||||
using section_map = std::map<std::string, key_value_map, std::less<>>;
|
using section_map = std::map<std::string, key_value_map, std::less<>>;
|
||||||
|
|
||||||
|
static std::unordered_map<mob::config, std::string_view> s_configuration_values{
|
||||||
|
{mob::config::release, "Release"},
|
||||||
|
{mob::config::debug, "Debug"},
|
||||||
|
{mob::config::relwithdebinfo, "RelWithDebInfo"}};
|
||||||
|
|
||||||
// holds all the options not related to tasks (global, tools, paths, etc.)
|
// holds all the options not related to tasks (global, tools, paths, etc.)
|
||||||
static section_map g_conf;
|
static section_map g_conf;
|
||||||
|
|
||||||
@@ -27,6 +32,18 @@ namespace mob::details {
|
|||||||
static int g_file_log_level = 5;
|
static int g_file_log_level = 5;
|
||||||
static bool g_dry = false;
|
static bool g_dry = false;
|
||||||
|
|
||||||
|
// check if the two given string are equals case-insensitive
|
||||||
|
//
|
||||||
|
bool case_insensitive_equals(std::string_view lhs, std::string_view rhs)
|
||||||
|
{
|
||||||
|
// _strcmpi does not have a n-overload, and since string_view is not
|
||||||
|
// necessarily null-terminated, _strmcpi cannot be safely used
|
||||||
|
return std::equal(std::begin(lhs), std::end(lhs), std::begin(rhs),
|
||||||
|
std::end(rhs), [](auto&& c1, auto&& c2) {
|
||||||
|
return ::tolower(c1) == ::tolower(c2);
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
bool bool_from_string(std::string_view s)
|
bool bool_from_string(std::string_view s)
|
||||||
{
|
{
|
||||||
return (s == "true" || s == "yes" || s == "1");
|
return (s == "true" || s == "yes" || s == "1");
|
||||||
@@ -85,6 +102,17 @@ namespace mob::details {
|
|||||||
kitor->second = value;
|
kitor->second = value;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
config string_to_config(std::string_view value)
|
||||||
|
{
|
||||||
|
for (const auto& [c, v] : s_configuration_values) {
|
||||||
|
if (case_insensitive_equals(value, v)) {
|
||||||
|
return c;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
gcx().bail_out(context::conf, "invalid configuration '{}'", value);
|
||||||
|
}
|
||||||
|
|
||||||
// sets the given option, adds it if it doesn't exist; used when setting options
|
// sets the given option, adds it if it doesn't exist; used when setting options
|
||||||
// from the master ini
|
// from the master ini
|
||||||
//
|
//
|
||||||
@@ -184,6 +212,28 @@ namespace mob::details {
|
|||||||
g_tasks[task_name][key] = std::move(value);
|
g_tasks[task_name][key] = std::move(value);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// read a CMake constant from the configuration
|
||||||
|
//
|
||||||
|
template <typename T>
|
||||||
|
T parse_cmake_value(std::string_view section, std::string_view key,
|
||||||
|
std::string_view value,
|
||||||
|
std::unordered_map<T, std::string_view> const& values)
|
||||||
|
{
|
||||||
|
for (const auto& [value_c, value_s] : values) {
|
||||||
|
if (case_insensitive_equals(value_s, value)) {
|
||||||
|
return value_c;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// build a string containing allowed value for logging
|
||||||
|
std::vector<std::string_view> values_s;
|
||||||
|
for (const auto& [value_c, value_s] : values) {
|
||||||
|
values_s.push_back(value_s);
|
||||||
|
}
|
||||||
|
gcx().bail_out(context::conf, "bad value '{}' for {}/{} (expected one of {})",
|
||||||
|
value, section, key, join(values_s, ", ", std::string{}));
|
||||||
|
}
|
||||||
|
|
||||||
} // namespace mob::details
|
} // namespace mob::details
|
||||||
|
|
||||||
namespace mob {
|
namespace mob {
|
||||||
@@ -644,6 +694,11 @@ namespace mob {
|
|||||||
return {};
|
return {};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
conf_build_types conf::build_types()
|
||||||
|
{
|
||||||
|
return {};
|
||||||
|
}
|
||||||
|
|
||||||
conf_paths conf::path()
|
conf_paths conf::path()
|
||||||
{
|
{
|
||||||
return {};
|
return {};
|
||||||
@@ -666,6 +721,34 @@ namespace mob {
|
|||||||
return details::g_dry;
|
return details::g_dry;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// use appropriate case for the below constants since we will be using them in
|
||||||
|
// to_string, although most of cmake and msbuild is case-insensitive so it will
|
||||||
|
// not matter much in the end
|
||||||
|
|
||||||
|
static std::unordered_map<conf_cmake::constant, std::string_view> constant_values{
|
||||||
|
{conf_cmake::always, "ALWAYS"},
|
||||||
|
{conf_cmake::lazy, "LAZY"},
|
||||||
|
{conf_cmake::never, "NEVER"}};
|
||||||
|
|
||||||
|
std::string conf_cmake::to_string(constant c)
|
||||||
|
{
|
||||||
|
return std::string{constant_values.at(c)};
|
||||||
|
}
|
||||||
|
|
||||||
|
conf_cmake::conf_cmake() : conf_section("cmake") {}
|
||||||
|
|
||||||
|
conf_cmake::constant conf_cmake::install_message() const
|
||||||
|
{
|
||||||
|
return details::parse_cmake_value(
|
||||||
|
name(), "install_message", details::get_string(name(), "install_message"),
|
||||||
|
constant_values);
|
||||||
|
}
|
||||||
|
|
||||||
|
std::string conf_cmake::host() const
|
||||||
|
{
|
||||||
|
return details::get_string(name(), "host");
|
||||||
|
}
|
||||||
|
|
||||||
conf_task::conf_task(std::vector<std::string> names) : names_(std::move(names)) {}
|
conf_task::conf_task(std::vector<std::string> names) : names_(std::move(names)) {}
|
||||||
|
|
||||||
std::string conf_task::get(std::string_view key) const
|
std::string conf_task::get(std::string_view key) const
|
||||||
@@ -678,45 +761,12 @@ namespace mob {
|
|||||||
return details::get_bool_for_task(names_, key);
|
return details::get_bool_for_task(names_, key);
|
||||||
}
|
}
|
||||||
|
|
||||||
bool conf_cmake::cmake_constant::is_equivalent(std::string_view other) const
|
mob::config conf_task::configuration() const
|
||||||
{
|
{
|
||||||
// _strcmpi does not have a n-overload, and since string_view is not
|
return details::parse_cmake_value(
|
||||||
// necessarily null-terminated, _strmcpi cannot be safely used
|
names_[0], "configuration",
|
||||||
return std::equal(std::begin(value_), std::end(value_), std::begin(other),
|
details::get_string_for_task(names_, "configuration"),
|
||||||
std::end(other), [](auto&& c1, auto&& c2) {
|
details::s_configuration_values);
|
||||||
return ::tolower(c1) == ::tolower(c2);
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
conf_cmake::conf_cmake() : conf_section("cmake") {}
|
|
||||||
|
|
||||||
const conf_cmake::cmake_constant conf_cmake::ALWAYS{"always"};
|
|
||||||
const conf_cmake::cmake_constant conf_cmake::LAZY{"lazy"};
|
|
||||||
const conf_cmake::cmake_constant conf_cmake::NEVER{"never"};
|
|
||||||
|
|
||||||
conf_cmake::cmake_constant conf_cmake::install_message() const
|
|
||||||
{
|
|
||||||
return read_cmake_constant("install_message", {ALWAYS, LAZY, NEVER});
|
|
||||||
}
|
|
||||||
|
|
||||||
std::string conf_cmake::host() const
|
|
||||||
{
|
|
||||||
return details::get_string(name(), "host");
|
|
||||||
}
|
|
||||||
|
|
||||||
conf_cmake::cmake_constant
|
|
||||||
conf_cmake::read_cmake_constant(std::string_view key,
|
|
||||||
std::vector<cmake_constant> const& allowed) const
|
|
||||||
{
|
|
||||||
const auto value = details::get_string(name(), key);
|
|
||||||
for (const auto& constant : allowed) {
|
|
||||||
if (constant.is_equivalent(value)) {
|
|
||||||
return constant;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
gcx().bail_out(context::conf, "bad value '{}' for {}/{} (expected one of {})",
|
|
||||||
value, name(), key, join(allowed, ", ", std::string{}));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
conf_tools::conf_tools() : conf_section("tools") {}
|
conf_tools::conf_tools() : conf_section("tools") {}
|
||||||
@@ -725,6 +775,8 @@ namespace mob {
|
|||||||
|
|
||||||
conf_versions::conf_versions() : conf_section("versions") {}
|
conf_versions::conf_versions() : conf_section("versions") {}
|
||||||
|
|
||||||
|
conf_build_types::conf_build_types() : conf_section("build-types") {}
|
||||||
|
|
||||||
conf_prebuilt::conf_prebuilt() : conf_section("prebuilt") {}
|
conf_prebuilt::conf_prebuilt() : conf_section("prebuilt") {}
|
||||||
|
|
||||||
conf_paths::conf_paths() : conf_section("paths") {}
|
conf_paths::conf_paths() : conf_section("paths") {}
|
||||||
|
|||||||
+57
-53
@@ -1,5 +1,7 @@
|
|||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
|
#include "../utility.h"
|
||||||
|
|
||||||
// these shouldn't be called directly, they're used by some of the template
|
// these shouldn't be called directly, they're used by some of the template
|
||||||
// below
|
// below
|
||||||
//
|
//
|
||||||
@@ -9,6 +11,18 @@ namespace mob::details {
|
|||||||
//
|
//
|
||||||
std::string get_string(std::string_view section, std::string_view key);
|
std::string get_string(std::string_view section, std::string_view key);
|
||||||
|
|
||||||
|
// convert a string to the given type
|
||||||
|
template <class T>
|
||||||
|
T string_to(std::string_view value);
|
||||||
|
|
||||||
|
config string_to_config(std::string_view value);
|
||||||
|
|
||||||
|
template <>
|
||||||
|
inline config string_to<config>(std::string_view value)
|
||||||
|
{
|
||||||
|
return string_to_config(value);
|
||||||
|
}
|
||||||
|
|
||||||
// calls get_string(), converts to bool
|
// calls get_string(), converts to bool
|
||||||
//
|
//
|
||||||
bool get_bool(std::string_view section, std::string_view key);
|
bool get_bool(std::string_view section, std::string_view key);
|
||||||
@@ -48,7 +62,14 @@ namespace mob {
|
|||||||
public:
|
public:
|
||||||
DefaultType get(std::string_view key) const
|
DefaultType get(std::string_view key) const
|
||||||
{
|
{
|
||||||
return details::get_string(name_, key);
|
const auto value = details::get_string(name_, key);
|
||||||
|
|
||||||
|
if constexpr (std::is_convertible_v<std::string, DefaultType>) {
|
||||||
|
return value;
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
return details::string_to<DefaultType>(value);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// undefined
|
// undefined
|
||||||
@@ -102,6 +123,29 @@ namespace mob {
|
|||||||
bool build() const { return get<bool>("build_task"); }
|
bool build() const { return get<bool>("build_task"); }
|
||||||
};
|
};
|
||||||
|
|
||||||
|
// options in [cmake]
|
||||||
|
//
|
||||||
|
class conf_cmake : conf_section<std::string> {
|
||||||
|
public:
|
||||||
|
enum class constant { always, lazy, never };
|
||||||
|
using enum constant;
|
||||||
|
|
||||||
|
static std::string to_string(constant m);
|
||||||
|
|
||||||
|
conf_cmake();
|
||||||
|
|
||||||
|
// specify the value for CMAKE_INSTALL_MESSAGE
|
||||||
|
//
|
||||||
|
constant install_message() const;
|
||||||
|
|
||||||
|
// specify the toolset host configuration, if any, this is equivalent
|
||||||
|
// to -T host=XXX on the command line
|
||||||
|
//
|
||||||
|
// an empty string means no host configured
|
||||||
|
//
|
||||||
|
std::string host() const;
|
||||||
|
};
|
||||||
|
|
||||||
// options in [task] or [task_name:task]
|
// options in [task] or [task_name:task]
|
||||||
//
|
//
|
||||||
class conf_task {
|
class conf_task {
|
||||||
@@ -141,64 +185,16 @@ namespace mob {
|
|||||||
return get<bool>("remote_push_default_origin");
|
return get<bool>("remote_push_default_origin");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// specify the configuration to build
|
||||||
|
//
|
||||||
|
mob::config configuration() const;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
std::vector<std::string> names_;
|
std::vector<std::string> names_;
|
||||||
|
|
||||||
bool get_bool(std::string_view name) const;
|
bool get_bool(std::string_view name) const;
|
||||||
};
|
};
|
||||||
|
|
||||||
// options in [task] or [task_name:task]
|
|
||||||
//
|
|
||||||
class conf_cmake : conf_section<std::string> {
|
|
||||||
public:
|
|
||||||
class cmake_constant {
|
|
||||||
std::string value_;
|
|
||||||
|
|
||||||
// check if the given string is equivalent to this constant
|
|
||||||
//
|
|
||||||
bool is_equivalent(std::string_view other) const;
|
|
||||||
|
|
||||||
friend class conf_cmake;
|
|
||||||
|
|
||||||
public:
|
|
||||||
constexpr cmake_constant(std::string_view value) : value_{value} {}
|
|
||||||
constexpr const auto& value() const { return value_; }
|
|
||||||
constexpr operator const std::string&() const { return value(); }
|
|
||||||
|
|
||||||
friend bool operator==(cmake_constant const& lhs, cmake_constant const& rhs)
|
|
||||||
{
|
|
||||||
return lhs.is_equivalent(rhs.value());
|
|
||||||
}
|
|
||||||
friend bool operator!=(cmake_constant const& lhs, cmake_constant const& rhs)
|
|
||||||
{
|
|
||||||
return !(lhs == rhs);
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
static const cmake_constant ALWAYS;
|
|
||||||
static const cmake_constant LAZY;
|
|
||||||
static const cmake_constant NEVER;
|
|
||||||
|
|
||||||
public:
|
|
||||||
conf_cmake();
|
|
||||||
|
|
||||||
// specify the value for CMAKE_INSTALL_MESSAGE
|
|
||||||
//
|
|
||||||
cmake_constant install_message() const;
|
|
||||||
|
|
||||||
// specify the toolset host configuration, if any, this is equivalent
|
|
||||||
// to -T host=XXX on the command line
|
|
||||||
//
|
|
||||||
// an empty string means no host configured
|
|
||||||
//
|
|
||||||
std::string host() const;
|
|
||||||
|
|
||||||
private:
|
|
||||||
cmake_constant
|
|
||||||
read_cmake_constant(std::string_view key,
|
|
||||||
std::vector<cmake_constant> const& allowed) const;
|
|
||||||
};
|
|
||||||
|
|
||||||
// options in [tools]
|
// options in [tools]
|
||||||
//
|
//
|
||||||
class conf_tools : public conf_section<fs::path> {
|
class conf_tools : public conf_section<fs::path> {
|
||||||
@@ -220,6 +216,13 @@ namespace mob {
|
|||||||
conf_versions();
|
conf_versions();
|
||||||
};
|
};
|
||||||
|
|
||||||
|
// options in [build-types]
|
||||||
|
//
|
||||||
|
class conf_build_types : public conf_section<config> {
|
||||||
|
public:
|
||||||
|
conf_build_types();
|
||||||
|
};
|
||||||
|
|
||||||
// options in [prebuilt]
|
// options in [prebuilt]
|
||||||
//
|
//
|
||||||
class conf_prebuilt : public conf_section<std::string> {
|
class conf_prebuilt : public conf_section<std::string> {
|
||||||
@@ -284,6 +287,7 @@ namespace mob {
|
|||||||
conf_transifex transifex();
|
conf_transifex transifex();
|
||||||
conf_prebuilt prebuilt();
|
conf_prebuilt prebuilt();
|
||||||
conf_versions version();
|
conf_versions version();
|
||||||
|
conf_build_types build_types();
|
||||||
conf_paths path();
|
conf_paths path();
|
||||||
|
|
||||||
// opens the log file, creates the directory if needed
|
// opens the log file, creates the directory if needed
|
||||||
|
|||||||
+15
-10
@@ -218,23 +218,28 @@ namespace mob::tasks {
|
|||||||
bootstrap();
|
bootstrap();
|
||||||
}
|
}
|
||||||
|
|
||||||
// some libraries only need some variants, avoid building the unnecessary
|
// we do not need all variants of all components but since people should
|
||||||
// ones
|
// usually be using the pre-built, we can build everything without losing too
|
||||||
|
// much time and it is much easier to deal when mixing
|
||||||
|
//
|
||||||
|
// note: filesystem is only required by USVFS I think, so maybe think about
|
||||||
|
// removing it if we switch to std::filesystem in USVFS
|
||||||
|
//
|
||||||
|
clipp::arg_list components{"thread", "date_time", "filesystem", "locale",
|
||||||
|
"program_options"};
|
||||||
|
|
||||||
// static link, static runtime, x64
|
// static link, static runtime, x64
|
||||||
do_b2({"thread", "date_time", "filesystem", "locale", "program_options"},
|
do_b2(components, "static", "static", arch::x64);
|
||||||
"static", "static", arch::x64);
|
|
||||||
|
|
||||||
// static link, static runtime, x86, required by usvfs 32-bit
|
// static link, static/shared runtime, x86, required by usvfs 32-bit
|
||||||
do_b2({"thread", "date_time", "filesystem", "locale"}, "static", "static",
|
do_b2(components, "static", "static", arch::x86);
|
||||||
arch::x86);
|
do_b2(components, "static", "shared", arch::x86);
|
||||||
|
|
||||||
// static link, shared runtime, x64
|
// static link, shared runtime, x64
|
||||||
do_b2({"thread", "date_time", "locale", "program_options"}, "static", "shared",
|
do_b2(components, "static", "shared", arch::x64);
|
||||||
arch::x64);
|
|
||||||
|
|
||||||
// shared link, shared runtime, x64
|
// shared link, shared runtime, x64
|
||||||
do_b2({"thread", "date_time", "atomic"}, "shared", "shared", arch::x64);
|
do_b2(components, "shared", "shared", arch::x64);
|
||||||
}
|
}
|
||||||
|
|
||||||
void boost::do_b2(const std::vector<std::string>& components,
|
void boost::do_b2(const std::vector<std::string>& components,
|
||||||
|
|||||||
+32
-16
@@ -5,25 +5,24 @@ namespace mob::tasks {
|
|||||||
|
|
||||||
namespace {
|
namespace {
|
||||||
|
|
||||||
cmake create_cmake_tool(arch a, cmake::ops o = cmake::generate)
|
cmake create_cmake_tool(arch a, config config, cmake::ops o = cmake::generate)
|
||||||
{
|
{
|
||||||
const std::string build_dir = (a == arch::x64 ? "build" : "build_32");
|
|
||||||
|
|
||||||
return std::move(cmake(o)
|
return std::move(cmake(o)
|
||||||
.generator(cmake::vs)
|
.generator(cmake::vs)
|
||||||
.architecture(a)
|
.architecture(a)
|
||||||
.arg("-Wno-deprecated")
|
.arg("-Wno-deprecated")
|
||||||
.arg("-Dgtest_force_shared_crt=ON")
|
.arg("-Dgtest_force_shared_crt=ON")
|
||||||
.prefix(gtest::source_path() / build_dir)
|
.prefix(gtest::build_path(a, config))
|
||||||
.root(gtest::source_path()));
|
.root(gtest::source_path()));
|
||||||
}
|
}
|
||||||
|
|
||||||
msbuild create_msbuild_tool(arch a, msbuild::ops o = msbuild::build)
|
msbuild create_msbuild_tool(arch a, config config,
|
||||||
|
msbuild::ops o = msbuild::build)
|
||||||
{
|
{
|
||||||
const fs::path build_path = create_cmake_tool(a).build_path();
|
const fs::path build_path = create_cmake_tool(a, config).build_path();
|
||||||
|
|
||||||
return std::move(
|
return std::move(msbuild(o).architecture(a).configuration(config).solution(
|
||||||
msbuild(o).architecture(a).solution(build_path / "INSTALL.vcxproj"));
|
build_path / "INSTALL.vcxproj"));
|
||||||
}
|
}
|
||||||
|
|
||||||
} // namespace
|
} // namespace
|
||||||
@@ -45,6 +44,12 @@ namespace mob::tasks {
|
|||||||
return conf().path().build() / "googletest";
|
return conf().path().build() / "googletest";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
fs::path gtest::build_path(arch a, config c)
|
||||||
|
{
|
||||||
|
return source_path() / "build" / (a == arch::x64 ? "x64" : "Win32") /
|
||||||
|
msbuild::configuration_name(c);
|
||||||
|
}
|
||||||
|
|
||||||
void gtest::do_clean(clean c)
|
void gtest::do_clean(clean c)
|
||||||
{
|
{
|
||||||
if (is_set(c, clean::reclone)) {
|
if (is_set(c, clean::reclone)) {
|
||||||
@@ -53,13 +58,15 @@ namespace mob::tasks {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (is_set(c, clean::reconfigure)) {
|
if (is_set(c, clean::reconfigure)) {
|
||||||
run_tool(create_cmake_tool(arch::x86, cmake::clean));
|
run_tool(create_cmake_tool(arch::x86, config::release, cmake::clean));
|
||||||
run_tool(create_cmake_tool(arch::x64, cmake::clean));
|
run_tool(create_cmake_tool(arch::x64, config::release, cmake::clean));
|
||||||
}
|
}
|
||||||
|
|
||||||
if (is_set(c, clean::rebuild)) {
|
if (is_set(c, clean::rebuild)) {
|
||||||
run_tool(create_msbuild_tool(arch::x86, msbuild::clean));
|
run_tool(create_msbuild_tool(arch::x86, config::release, msbuild::clean));
|
||||||
run_tool(create_msbuild_tool(arch::x64, msbuild::clean));
|
run_tool(create_msbuild_tool(arch::x86, config::debug, msbuild::clean));
|
||||||
|
run_tool(create_msbuild_tool(arch::x64, config::release, msbuild::clean));
|
||||||
|
run_tool(create_msbuild_tool(arch::x64, config::debug, msbuild::clean));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -73,15 +80,24 @@ namespace mob::tasks {
|
|||||||
|
|
||||||
void gtest::do_build_and_install()
|
void gtest::do_build_and_install()
|
||||||
{
|
{
|
||||||
|
op::create_directories(cx(), gtest::build_path(arch::x64).parent_path());
|
||||||
|
op::create_directories(cx(), gtest::build_path(arch::x86).parent_path());
|
||||||
|
|
||||||
parallel({{"gtest64",
|
parallel({{"gtest64",
|
||||||
[&] {
|
[&] {
|
||||||
run_tool(create_cmake_tool(arch::x64));
|
run_tool(create_cmake_tool(arch::x64, config::release));
|
||||||
run_tool(create_msbuild_tool(arch::x64));
|
run_tool(create_msbuild_tool(arch::x64, config::release));
|
||||||
|
|
||||||
|
run_tool(create_cmake_tool(arch::x64, config::debug));
|
||||||
|
run_tool(create_msbuild_tool(arch::x64, config::debug));
|
||||||
}},
|
}},
|
||||||
|
|
||||||
{"gtest32", [&] {
|
{"gtest32", [&] {
|
||||||
run_tool(create_cmake_tool(arch::x86));
|
run_tool(create_cmake_tool(arch::x86, config::release));
|
||||||
run_tool(create_msbuild_tool(arch::x86));
|
run_tool(create_msbuild_tool(arch::x86, config::release));
|
||||||
|
|
||||||
|
run_tool(create_cmake_tool(arch::x86, config::debug));
|
||||||
|
run_tool(create_msbuild_tool(arch::x86, config::debug));
|
||||||
}}});
|
}}});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -7,7 +7,9 @@ namespace mob::tasks {
|
|||||||
|
|
||||||
std::string dir_name()
|
std::string dir_name()
|
||||||
{
|
{
|
||||||
return "libbsarch-" + libbsarch::version() + "-release-x64";
|
return "libbsarch-" + libbsarch::version() + "-" +
|
||||||
|
(libbsarch::build_type() == config::debug ? "debug" : "release") +
|
||||||
|
"-x64";
|
||||||
}
|
}
|
||||||
|
|
||||||
url source_url()
|
url source_url()
|
||||||
@@ -25,6 +27,11 @@ namespace mob::tasks {
|
|||||||
return conf().version().get("libbsarch");
|
return conf().version().get("libbsarch");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
config libbsarch::build_type()
|
||||||
|
{
|
||||||
|
return conf().build_types().get("libbsarch");
|
||||||
|
}
|
||||||
|
|
||||||
bool libbsarch::prebuilt()
|
bool libbsarch::prebuilt()
|
||||||
{
|
{
|
||||||
return false;
|
return false;
|
||||||
|
|||||||
@@ -200,12 +200,13 @@ namespace mob::tasks {
|
|||||||
|
|
||||||
cmake modorganizer::create_cmake_tool(cmake::ops o)
|
cmake modorganizer::create_cmake_tool(cmake::ops o)
|
||||||
{
|
{
|
||||||
return create_cmake_tool(source_path(), o);
|
return create_cmake_tool(source_path(), o, task_conf().configuration());
|
||||||
}
|
}
|
||||||
|
|
||||||
cmake modorganizer::create_cmake_tool(const fs::path& root, cmake::ops o)
|
cmake modorganizer::create_cmake_tool(const fs::path& root, cmake::ops o, config c)
|
||||||
{
|
{
|
||||||
return std::move(cmake(o)
|
return std::move(
|
||||||
|
cmake(o)
|
||||||
.generator(cmake::vs)
|
.generator(cmake::vs)
|
||||||
.def("CMAKE_INSTALL_PREFIX:PATH", conf().path().install())
|
.def("CMAKE_INSTALL_PREFIX:PATH", conf().path().install())
|
||||||
.def("DEPENDENCIES_DIR", conf().path().build())
|
.def("DEPENDENCIES_DIR", conf().path().build())
|
||||||
@@ -220,7 +221,10 @@ namespace mob::tasks {
|
|||||||
.def("SEVENZ_ROOT", sevenz::source_path())
|
.def("SEVENZ_ROOT", sevenz::source_path())
|
||||||
.def("LIBBSARCH_ROOT", libbsarch::source_path())
|
.def("LIBBSARCH_ROOT", libbsarch::source_path())
|
||||||
.def("BOOST_DI_ROOT", boost_di::source_path())
|
.def("BOOST_DI_ROOT", boost_di::source_path())
|
||||||
.def("GTEST_ROOT", gtest::source_path())
|
// gtest has no RelWithDebInfo, so simply use Debug/Release
|
||||||
|
.def("GTEST_ROOT",
|
||||||
|
gtest::build_path(arch::x64, c == config::debug ? config::debug
|
||||||
|
: config::release))
|
||||||
.def("OPENSSL_ROOT_DIR", openssl::source_path())
|
.def("OPENSSL_ROOT_DIR", openssl::source_path())
|
||||||
.root(root));
|
.root(root));
|
||||||
}
|
}
|
||||||
@@ -229,7 +233,7 @@ namespace mob::tasks {
|
|||||||
{
|
{
|
||||||
return std::move(msbuild(o)
|
return std::move(msbuild(o)
|
||||||
.solution(project_file_path())
|
.solution(project_file_path())
|
||||||
.config("RelWithDebInfo")
|
.configuration(task_conf().configuration())
|
||||||
.architecture(arch::x64));
|
.architecture(arch::x64));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
+56
-7
@@ -47,7 +47,9 @@ namespace mob::tasks {
|
|||||||
|
|
||||||
url prebuilt_url()
|
url prebuilt_url()
|
||||||
{
|
{
|
||||||
return make_prebuilt_url("PyQt6_gpl-prebuilt-" + pyqt::version() + ".7z");
|
return make_prebuilt_url(
|
||||||
|
"PyQt6_gpl-prebuilt-" + pyqt::version() +
|
||||||
|
(pyqt::build_type() == config::debug ? "-debug" : "") + ".7z");
|
||||||
}
|
}
|
||||||
|
|
||||||
// file created by sip-module.exe
|
// file created by sip-module.exe
|
||||||
@@ -86,6 +88,11 @@ namespace mob::tasks {
|
|||||||
return source_path() / "build";
|
return source_path() / "build";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
config pyqt::build_type()
|
||||||
|
{
|
||||||
|
return conf().build_types().get("pyqt");
|
||||||
|
}
|
||||||
|
|
||||||
std::string pyqt::pyqt_sip_module_name()
|
std::string pyqt::pyqt_sip_module_name()
|
||||||
{
|
{
|
||||||
return "PyQt6.sip";
|
return "PyQt6.sip";
|
||||||
@@ -166,7 +173,24 @@ namespace mob::tasks {
|
|||||||
void pyqt::build_and_install_from_source()
|
void pyqt::build_and_install_from_source()
|
||||||
{
|
{
|
||||||
// use pip to install the pyqt builder
|
// use pip to install the pyqt builder
|
||||||
run_tool(pip(pip::install).package("PyQt-builder").version(builder_version()));
|
if (python::build_type() == config::debug) {
|
||||||
|
// PyQt-builder has sip as a dependency, so installing it directly will
|
||||||
|
// replace the sip we have installed manually, but the installed sip will
|
||||||
|
// not work (see comment in sip::build() for details)
|
||||||
|
//
|
||||||
|
// the workaround is to install the dependencies manually (only packaging),
|
||||||
|
// and then use a --no-dependencies install with pip
|
||||||
|
//
|
||||||
|
run_tool(pip(pip::install).package("packaging"));
|
||||||
|
run_tool(pip(pip::install)
|
||||||
|
.package("PyQt-builder")
|
||||||
|
.no_dependencies()
|
||||||
|
.version(builder_version()));
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
run_tool(
|
||||||
|
pip(pip::install).package("PyQt-builder").version(builder_version()));
|
||||||
|
}
|
||||||
|
|
||||||
// patch for builder.py
|
// patch for builder.py
|
||||||
run_tool(patcher()
|
run_tool(patcher()
|
||||||
@@ -248,10 +272,31 @@ namespace mob::tasks {
|
|||||||
if (installed_bypass.exists()) {
|
if (installed_bypass.exists()) {
|
||||||
cx().trace(context::bypass, "pyqt already installed");
|
cx().trace(context::bypass, "pyqt already installed");
|
||||||
}
|
}
|
||||||
|
else {
|
||||||
|
if (python::build_type() == config::debug) {
|
||||||
|
|
||||||
|
const auto pyqt_sip_folder = source_path() / "PyQt6_sip" /
|
||||||
|
("pyqt6_sip-" + sip::version_for_pyqt());
|
||||||
|
|
||||||
|
// in debug, we need to do stuff manually because pip does not work
|
||||||
|
// as expected
|
||||||
|
run_tool(extractor()
|
||||||
|
.file(conf().path().cache() / sip_install_file())
|
||||||
|
.output(pyqt_sip_folder.parent_path()));
|
||||||
|
|
||||||
|
run_tool(mob::python()
|
||||||
|
.root(pyqt_sip_folder)
|
||||||
|
.arg("setup.py")
|
||||||
|
.arg("build")
|
||||||
|
.arg("--debug"));
|
||||||
|
|
||||||
|
run_tool(pip(pip::install).file(pyqt_sip_folder));
|
||||||
|
}
|
||||||
else {
|
else {
|
||||||
// run `pip install` on the generated PyQt6_sip-XX.tar.gz file
|
// run `pip install` on the generated PyQt6_sip-XX.tar.gz file
|
||||||
run_tool(
|
run_tool(
|
||||||
pip(pip::install).file(conf().path().cache() / sip_install_file()));
|
pip(pip::install).file(conf().path().cache() / sip_install_file()));
|
||||||
|
}
|
||||||
|
|
||||||
// done, create the bypass file
|
// done, create the bypass file
|
||||||
installed_bypass.create();
|
installed_bypass.create();
|
||||||
@@ -267,13 +312,17 @@ namespace mob::tasks {
|
|||||||
// python-XX/PCBuild/amd64, those are needed by PyQt6 when building several
|
// python-XX/PCBuild/amd64, those are needed by PyQt6 when building several
|
||||||
// projects
|
// projects
|
||||||
|
|
||||||
op::copy_file_to_dir_if_better(cx(), qt::bin_path() / "Qt6Core.dll",
|
const std::vector<std::string> dlls{"Qt6Core", "Qt6Xml"};
|
||||||
python::build_path(),
|
|
||||||
op::unsafe); // source file is outside prefix
|
|
||||||
|
|
||||||
op::copy_file_to_dir_if_better(cx(), qt::bin_path() / "Qt6Xml.dll",
|
for (auto dll : dlls) {
|
||||||
python::build_path(),
|
if (build_type() == config::debug) {
|
||||||
|
dll += "d";
|
||||||
|
}
|
||||||
|
dll += ".dll";
|
||||||
|
op::copy_file_to_dir_if_better(
|
||||||
|
cx(), qt::bin_path() / dll, python::build_path(),
|
||||||
op::unsafe); // source file is outside prefix
|
op::unsafe); // source file is outside prefix
|
||||||
|
}
|
||||||
|
|
||||||
// installation of PyQt6 python files (.pyd, etc.) is done
|
// installation of PyQt6 python files (.pyd, etc.) is done
|
||||||
// by the python plugin directly
|
// by the python plugin directly
|
||||||
|
|||||||
+23
-6
@@ -30,7 +30,9 @@ namespace mob::tasks {
|
|||||||
|
|
||||||
url prebuilt_url()
|
url prebuilt_url()
|
||||||
{
|
{
|
||||||
return make_prebuilt_url("python-prebuilt-" + version_without_v() + ".7z");
|
return make_prebuilt_url(
|
||||||
|
"python-prebuilt-" + version_without_v() +
|
||||||
|
(python::build_type() == config::debug ? "-debug" : "") + ".7z");
|
||||||
}
|
}
|
||||||
|
|
||||||
fs::path solution_file()
|
fs::path solution_file()
|
||||||
@@ -89,6 +91,11 @@ namespace mob::tasks {
|
|||||||
return source_path() / "PCBuild" / "amd64";
|
return source_path() / "PCBuild" / "amd64";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
config python::build_type()
|
||||||
|
{
|
||||||
|
return conf().build_types().get("python");
|
||||||
|
}
|
||||||
|
|
||||||
void python::do_clean(clean c)
|
void python::do_clean(clean c)
|
||||||
{
|
{
|
||||||
if (prebuilt()) {
|
if (prebuilt()) {
|
||||||
@@ -190,8 +197,7 @@ namespace mob::tasks {
|
|||||||
|
|
||||||
const auto bat = source_path() / "python.bat";
|
const auto bat = source_path() / "python.bat";
|
||||||
|
|
||||||
// package libs into pythonXX.zip
|
auto p = process()
|
||||||
run_tool(process_runner(process()
|
|
||||||
.binary(bat)
|
.binary(bat)
|
||||||
.arg(fs::path("PC/layout"))
|
.arg(fs::path("PC/layout"))
|
||||||
.arg("--source", source_path())
|
.arg("--source", source_path())
|
||||||
@@ -199,7 +205,14 @@ namespace mob::tasks {
|
|||||||
.arg("--temp", (build_path() / "pythoncore_temp"))
|
.arg("--temp", (build_path() / "pythoncore_temp"))
|
||||||
.arg("--copy", (build_path() / "pythoncore"))
|
.arg("--copy", (build_path() / "pythoncore"))
|
||||||
.arg("--preset-embed")
|
.arg("--preset-embed")
|
||||||
.cwd(source_path())));
|
.cwd(source_path());
|
||||||
|
|
||||||
|
if (build_type() == config::debug) {
|
||||||
|
p = p.arg("--debug");
|
||||||
|
}
|
||||||
|
|
||||||
|
// package libs into pythonXX.zip
|
||||||
|
run_tool(process_runner(p));
|
||||||
}
|
}
|
||||||
|
|
||||||
void python::copy_files()
|
void python::copy_files()
|
||||||
@@ -210,7 +223,9 @@ namespace mob::tasks {
|
|||||||
|
|
||||||
// pdbs
|
// pdbs
|
||||||
op::copy_file_to_dir_if_better(
|
op::copy_file_to_dir_if_better(
|
||||||
cx(), build_path() / ("python" + version_for_dll() + ".pdb"),
|
cx(),
|
||||||
|
build_path() / ("python" + version_for_dll() +
|
||||||
|
(build_type() == config::debug ? "_d" : "") + ".pdb"),
|
||||||
conf().path().install_pdbs());
|
conf().path().install_pdbs());
|
||||||
|
|
||||||
// dlls and python libraries are installed by the python plugin
|
// dlls and python libraries are installed by the python plugin
|
||||||
@@ -229,6 +244,7 @@ namespace mob::tasks {
|
|||||||
.solution(solution_file())
|
.solution(solution_file())
|
||||||
.targets({"python", "pythonw", "python3dll", "select", "pyexpat",
|
.targets({"python", "pythonw", "python3dll", "select", "pyexpat",
|
||||||
"unicodedata", "_queue", "_bz2", "_ssl", "_overlapped"})
|
"unicodedata", "_queue", "_bz2", "_ssl", "_overlapped"})
|
||||||
|
.configuration(build_type())
|
||||||
.properties(
|
.properties(
|
||||||
{"bz2Dir=" + path_to_utf8(bzip2::source_path()),
|
{"bz2Dir=" + path_to_utf8(bzip2::source_path()),
|
||||||
"zlibDir=" + path_to_utf8(zlib::source_path()),
|
"zlibDir=" + path_to_utf8(zlib::source_path()),
|
||||||
@@ -238,7 +254,8 @@ namespace mob::tasks {
|
|||||||
|
|
||||||
fs::path python::python_exe()
|
fs::path python::python_exe()
|
||||||
{
|
{
|
||||||
return build_path() / "python.exe";
|
return build_path() /
|
||||||
|
(build_type() == config::debug ? "python_d.exe" : "python.exe");
|
||||||
}
|
}
|
||||||
|
|
||||||
fs::path python::include_path()
|
fs::path python::include_path()
|
||||||
|
|||||||
@@ -140,8 +140,17 @@ namespace mob::tasks {
|
|||||||
|
|
||||||
void sip::build()
|
void sip::build()
|
||||||
{
|
{
|
||||||
|
if (python::build_type() == config::debug) {
|
||||||
|
// if Python is build in debug mode, fall back to old setup.py because pip
|
||||||
|
// install seems to generated broken script wrapper that point to a
|
||||||
|
// non-existing python.exe instead of python_d.exe
|
||||||
|
run_tool(pip(pip::install).package("setuptools"));
|
||||||
|
run_tool(mob::python().root(source_path()).arg("setup.py").arg("install"));
|
||||||
|
}
|
||||||
|
else {
|
||||||
run_tool(pip(pip::install).file(source_path()));
|
run_tool(pip(pip::install).file(source_path()));
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
void sip::convert_script_file_to_acp(const std::string& filename)
|
void sip::convert_script_file_to_acp(const std::string& filename)
|
||||||
{
|
{
|
||||||
|
|||||||
+11
-13
@@ -97,6 +97,7 @@ namespace mob::tasks {
|
|||||||
static std::string version();
|
static std::string version();
|
||||||
static bool prebuilt();
|
static bool prebuilt();
|
||||||
static fs::path source_path();
|
static fs::path source_path();
|
||||||
|
static fs::path build_path(arch = arch::x64, config = config::release);
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
void do_clean(clean c) override;
|
void do_clean(clean c) override;
|
||||||
@@ -123,6 +124,7 @@ namespace mob::tasks {
|
|||||||
libbsarch();
|
libbsarch();
|
||||||
|
|
||||||
static std::string version();
|
static std::string version();
|
||||||
|
static config build_type();
|
||||||
static bool prebuilt();
|
static bool prebuilt();
|
||||||
static fs::path source_path();
|
static fs::path source_path();
|
||||||
|
|
||||||
@@ -197,7 +199,8 @@ namespace mob::tasks {
|
|||||||
// projects, used internally, but also by the cmake command
|
// projects, used internally, but also by the cmake command
|
||||||
//
|
//
|
||||||
static cmake create_cmake_tool(const fs::path& root,
|
static cmake create_cmake_tool(const fs::path& root,
|
||||||
cmake::ops o = cmake::generate);
|
cmake::ops o = cmake::generate,
|
||||||
|
config config = config::relwithdebinfo);
|
||||||
|
|
||||||
// flags for some MO projects
|
// flags for some MO projects
|
||||||
enum flags {
|
enum flags {
|
||||||
@@ -360,6 +363,7 @@ namespace mob::tasks {
|
|||||||
|
|
||||||
static fs::path source_path();
|
static fs::path source_path();
|
||||||
static fs::path build_path();
|
static fs::path build_path();
|
||||||
|
static config build_type();
|
||||||
|
|
||||||
// "PyQt5.sip", used both in pyqt and sip
|
// "PyQt5.sip", used both in pyqt and sip
|
||||||
//
|
//
|
||||||
@@ -419,6 +423,10 @@ namespace mob::tasks {
|
|||||||
//
|
//
|
||||||
static fs::path site_packages_path();
|
static fs::path site_packages_path();
|
||||||
|
|
||||||
|
// configuration to build
|
||||||
|
//
|
||||||
|
static config build_type();
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
void do_clean(clean c) override;
|
void do_clean(clean c) override;
|
||||||
void do_fetch() override;
|
void do_fetch() override;
|
||||||
@@ -646,21 +654,11 @@ namespace mob::tasks {
|
|||||||
void do_build_and_install() override;
|
void do_build_and_install() override;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
void fetch_prebuilt();
|
|
||||||
void fetch_from_source();
|
void fetch_from_source();
|
||||||
void build_and_install_prebuilt();
|
|
||||||
void build_and_install_from_source();
|
void build_and_install_from_source();
|
||||||
|
|
||||||
void download_from_appveyor(arch a);
|
msbuild create_msbuild_tool(arch, msbuild::ops = msbuild::build,
|
||||||
void copy_prebuilt(arch a);
|
config = config::release) const;
|
||||||
|
|
||||||
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> {
|
class zlib : public basic_task<zlib> {
|
||||||
|
|||||||
+7
-138
@@ -22,7 +22,7 @@ namespace mob::tasks {
|
|||||||
|
|
||||||
bool usvfs::prebuilt()
|
bool usvfs::prebuilt()
|
||||||
{
|
{
|
||||||
return conf().prebuilt().get<bool>("usvfs");
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
fs::path usvfs::source_path()
|
fs::path usvfs::source_path()
|
||||||
@@ -32,25 +32,6 @@ namespace mob::tasks {
|
|||||||
|
|
||||||
void usvfs::do_clean(clean c)
|
void usvfs::do_clean(clean c)
|
||||||
{
|
{
|
||||||
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
|
|
||||||
|
|
||||||
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
|
// delete the whole directory
|
||||||
if (is_set(c, clean::reclone)) {
|
if (is_set(c, clean::reclone)) {
|
||||||
git_wrap::delete_directory(cx(), source_path());
|
git_wrap::delete_directory(cx(), source_path());
|
||||||
@@ -61,41 +42,23 @@ namespace mob::tasks {
|
|||||||
|
|
||||||
if (is_set(c, clean::rebuild)) {
|
if (is_set(c, clean::rebuild)) {
|
||||||
// msbuild clean
|
// msbuild clean
|
||||||
run_tool(create_msbuild_tool(arch::x86, msbuild::clean));
|
run_tool(create_msbuild_tool(arch::x86, msbuild::clean,
|
||||||
run_tool(create_msbuild_tool(arch::x64, msbuild::clean));
|
task_conf().configuration()));
|
||||||
}
|
run_tool(create_msbuild_tool(arch::x64, msbuild::clean,
|
||||||
|
task_conf().configuration()));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void usvfs::do_fetch()
|
void usvfs::do_fetch()
|
||||||
{
|
{
|
||||||
if (prebuilt())
|
|
||||||
fetch_prebuilt();
|
|
||||||
else
|
|
||||||
fetch_from_source();
|
fetch_from_source();
|
||||||
}
|
}
|
||||||
|
|
||||||
void usvfs::do_build_and_install()
|
void usvfs::do_build_and_install()
|
||||||
{
|
{
|
||||||
if (prebuilt())
|
|
||||||
build_and_install_prebuilt();
|
|
||||||
else
|
|
||||||
build_and_install_from_source();
|
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()
|
void usvfs::fetch_from_source()
|
||||||
{
|
{
|
||||||
run_tool(make_git()
|
run_tool(make_git()
|
||||||
@@ -110,42 +73,7 @@ namespace mob::tasks {
|
|||||||
run_tool(create_msbuild_tool(arch::x64));
|
run_tool(create_msbuild_tool(arch::x64));
|
||||||
}
|
}
|
||||||
|
|
||||||
void usvfs::download_from_appveyor(arch a)
|
msbuild usvfs::create_msbuild_tool(arch a, msbuild::ops o, config c) const
|
||||||
{
|
|
||||||
// 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"
|
// usvfs doesn't use "Win32" for 32-bit, it uses "x86"
|
||||||
//
|
//
|
||||||
@@ -164,6 +92,7 @@ namespace mob::tasks {
|
|||||||
return std::move(
|
return std::move(
|
||||||
msbuild(o)
|
msbuild(o)
|
||||||
.platform(plat)
|
.platform(plat)
|
||||||
|
.configuration(c)
|
||||||
.targets({"usvfs_proxy"})
|
.targets({"usvfs_proxy"})
|
||||||
.solution(source_path() / "vsbuild" / "usvfs.sln")
|
.solution(source_path() / "vsbuild" / "usvfs.sln")
|
||||||
.env(env::vs(a)
|
.env(env::vs(a)
|
||||||
@@ -171,64 +100,4 @@ namespace mob::tasks {
|
|||||||
.set("BOOST_PATH", path_to_utf8(boost::source_path()))));
|
.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
|
} // namespace mob::tasks
|
||||||
|
|||||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user