Skip to content

Commit

Permalink
Allow overriding VCPKG_ROOT with [paths] entry.
Browse files Browse the repository at this point in the history
  • Loading branch information
Holt59 committed Jul 8, 2024
1 parent 55f5941 commit 0246a44
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 1 deletion.
1 change: 1 addition & 0 deletions mob.ini
Original file line number Diff line number Diff line change
Expand Up @@ -155,6 +155,7 @@ install_licenses =
install_pythoncore =
install_translations =
vs =
vcpkg =
qt_install =
qt_bin =
qt_translations =
Expand Down
3 changes: 3 additions & 0 deletions src/core/conf.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -509,6 +509,9 @@ namespace mob {
set_path_if_empty("pf_x86", find_program_files_x86);
set_path_if_empty("pf_x64", find_program_files_x64);
set_path_if_empty("vs", find_vs);
set_path_if_empty("vcpkg", []() {
return this_env::get().get("VCPKG_ROOT");
});
set_path_if_empty("qt_install", find_qt);
set_path_if_empty("temp_dir", find_temp_dir);
set_path_if_empty("patches", find_in_root("patches"));
Expand Down
1 change: 1 addition & 0 deletions src/core/conf.h
Original file line number Diff line number Diff line change
Expand Up @@ -264,6 +264,7 @@ namespace mob {
VALUE(install_translations);

VALUE(vs);
VALUE(vcpkg);
VALUE(qt_install);
VALUE(qt_bin);
VALUE(qt_translations);
Expand Down
4 changes: 3 additions & 1 deletion src/tools/cmake.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -172,7 +172,9 @@ namespace mob {
p.arg(cmd_);
}

p.env(env::vs(arch_).set("CXXFLAGS", "/wd4566"))
p.env(env::vs(arch_)
.set("CXXFLAGS", "/wd4566")
.set("VCPKG_ROOT", absolute(conf().path().vcpkg()).string()))
.cwd(preset_.empty() ? build_path() : root_);

execute_and_join(p);
Expand Down

0 comments on commit 0246a44

Please sign in to comment.