aboutsummaryrefslogtreecommitdiff
path: root/toolsrc/src/commands_build.cpp
diff options
context:
space:
mode:
authorRobert Schumacher <roschuma@microsoft.com>2017-06-17 02:39:14 -0700
committerRobert Schumacher <roschuma@microsoft.com>2017-06-20 09:36:21 -0700
commit8741214bf69d1209a1e6d405ed8561d27f04436a (patch)
tree85325eb4b2d2c1c15eb8bd58426dac5462242d4e /toolsrc/src/commands_build.cpp
parent8c4d55b8f304c74aeb95878cfe354830ff4abc88 (diff)
downloadvcpkg-8741214bf69d1209a1e6d405ed8561d27f04436a.tar.gz
vcpkg-8741214bf69d1209a1e6d405ed8561d27f04436a.zip
[vcpkg] Use unique_ptr<> for paragraphs. Post-parser phase rework.
Diffstat (limited to 'toolsrc/src/commands_build.cpp')
-rw-r--r--toolsrc/src/commands_build.cpp12
1 files changed, 7 insertions, 5 deletions
diff --git a/toolsrc/src/commands_build.cpp b/toolsrc/src/commands_build.cpp
index a9e4f574e..4da9cede2 100644
--- a/toolsrc/src/commands_build.cpp
+++ b/toolsrc/src/commands_build.cpp
@@ -11,6 +11,8 @@
#include "vcpkglib.h"
using vcpkg::Build::BuildResult;
+using vcpkg::Parse::ParseControlErrorInfo;
+using vcpkg::Parse::ParseExpected;
namespace vcpkg::Commands::BuildCommand
{
@@ -34,7 +36,7 @@ namespace vcpkg::Commands::BuildCommand
Checks::exit_success(VCPKG_LINE_INFO);
}
- const ExpectedT<SourceControlFile, ParseControlErrorInfo> source_control_file =
+ const ParseExpected<SourceControlFile> source_control_file =
Paragraphs::try_load_port(paths.get_filesystem(), port_dir);
if (!source_control_file.has_value())
@@ -47,18 +49,18 @@ namespace vcpkg::Commands::BuildCommand
{
System::println("%s \n", str);
}
- const SourceControlFile& scf = source_control_file.value_or_exit(VCPKG_LINE_INFO);
+ const auto& scf = source_control_file.value_or_exit(VCPKG_LINE_INFO);
Checks::check_exit(VCPKG_LINE_INFO,
- spec.name() == scf.core_paragraph.name,
+ spec.name() == scf->core_paragraph->name,
"The Name: field inside the CONTROL does not match the port directory: '%s' != '%s'",
- scf.core_paragraph.name,
+ scf->core_paragraph->name,
spec.name());
StatusParagraphs status_db = database_load_check(paths);
Build::BuildPackageOptions build_package_options{Build::UseHeadVersion::NO, Build::AllowDownloads::YES};
const Build::BuildPackageConfig build_config{
- scf.core_paragraph, spec.triplet(), paths.port_dir(spec), build_package_options};
+ *scf->core_paragraph, spec.triplet(), paths.port_dir(spec), build_package_options};
const auto result = Build::build_package(paths, build_config, status_db);
if (result.code == BuildResult::CASCADED_DUE_TO_MISSING_DEPENDENCIES)