diff options
-rw-r--r-- | assemble_vintf.cpp | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/assemble_vintf.cpp b/assemble_vintf.cpp index 3218d1d..974c7fc 100644 --- a/assemble_vintf.cpp +++ b/assemble_vintf.cpp | |||
@@ -238,7 +238,8 @@ class AssembleVintf { | |||
238 | return false; | 238 | return false; |
239 | } | 239 | } |
240 | for (ConditionedConfig& conditionedConfig : conditionedConfigs) { | 240 | for (ConditionedConfig& conditionedConfig : conditionedConfigs) { |
241 | MatrixKernel kernel(KernelVersion{pair.first}, std::move(conditionedConfig.second)); | 241 | MatrixKernel kernel(KernelVersion{pair.first.majorVer, pair.first.minorVer, 0u}, |
242 | std::move(conditionedConfig.second)); | ||
242 | if (conditionedConfig.first != nullptr) | 243 | if (conditionedConfig.first != nullptr) |
243 | kernel.mConditions.push_back(std::move(*conditionedConfig.first)); | 244 | kernel.mConditions.push_back(std::move(*conditionedConfig.first)); |
244 | matrix->framework.mKernels.push_back(std::move(kernel)); | 245 | matrix->framework.mKernels.push_back(std::move(kernel)); |
@@ -389,7 +390,11 @@ class AssembleVintf { | |||
389 | std::cerr << "Unrecognized kernel version '" << kernelVerStr << "'" << std::endl; | 390 | std::cerr << "Unrecognized kernel version '" << kernelVerStr << "'" << std::endl; |
390 | return false; | 391 | return false; |
391 | } | 392 | } |
392 | mKernels.push_back({{kernelVer.majorVer, kernelVer.minorVer, 0u}, kernelConfigPath}); | 393 | if (mKernels.find(kernelVer) != mKernels.end()) { |
394 | std::cerr << "Multiple --kernel for " << kernelVer << " is specified." << std::endl; | ||
395 | return false; | ||
396 | } | ||
397 | mKernels[kernelVer] = kernelConfigPath; | ||
393 | return true; | 398 | return true; |
394 | } | 399 | } |
395 | 400 | ||
@@ -399,7 +404,7 @@ class AssembleVintf { | |||
399 | std::unique_ptr<std::ofstream> mOutFileRef; | 404 | std::unique_ptr<std::ofstream> mOutFileRef; |
400 | std::ifstream mCheckFile; | 405 | std::ifstream mCheckFile; |
401 | bool mOutputMatrix = false; | 406 | bool mOutputMatrix = false; |
402 | std::vector<std::pair<KernelVersion, std::string>> mKernels; | 407 | std::map<Version, std::string> mKernels; |
403 | }; | 408 | }; |
404 | 409 | ||
405 | } // namespace vintf | 410 | } // namespace vintf |