From: Mikko Rasa Date: Mon, 19 Dec 2022 14:19:21 +0000 (+0200) Subject: Use bound loader function arguments for binary component types X-Git-Url: http://git.tdb.fi/?a=commitdiff_plain;h=3043044d8ef02ef77def454fdede87927f5aa1f8;p=builder.git Use bound loader function arguments for binary component types --- diff --git a/source/sourcepackage.cpp b/source/sourcepackage.cpp index 74c3886..6016271 100644 --- a/source/sourcepackage.cpp +++ b/source/sourcepackage.cpp @@ -180,9 +180,9 @@ SourcePackage::Loader::Loader(SourcePackage &p, const Config::InputOptions *o): add("generate", &Loader::generate); add("install", &Loader::component); add("interface_version", &Loader::interface_version); - add("library", &Loader::component_arg); - add("module", &Loader::component_arg); - add("program", &Loader::component_arg); + add("library", &Loader::component_arg, BinaryComponent::LIBRARY); + add("module", &Loader::component_arg, BinaryComponent::MODULE); + add("program", &Loader::component_arg, BinaryComponent::PROGRAM); add("source_archive", &Loader::source_archive); add("source_tarball", &Loader::source_archive); add("tarball", &Loader::tarball); @@ -222,8 +222,8 @@ void SourcePackage::Loader::component(const string &n) obj.components.push_back(comp); } -template -void SourcePackage::Loader::component_arg(const string &n) +template +void SourcePackage::Loader::component_arg(A a, const string &n) { C *comp = new C(obj, n, a); load_sub(*comp); diff --git a/source/sourcepackage.h b/source/sourcepackage.h index 68b89c8..fce58a6 100644 --- a/source/sourcepackage.h +++ b/source/sourcepackage.h @@ -36,8 +36,8 @@ public: void feature(const std::string &, const std::string &); template void component(const std::string &); - template - void component_arg(const std::string &); + template + void component_arg(A, const std::string &); void build_info(); void generate(const std::string &); void interface_version(const std::string &);