| 637 | } |
| 638 | |
| 639 | cm::optional<std::pair<cmPkgConfigEnv, ImportEnv>> HandleCommon( |
| 640 | CommonArguments& args, cmExecutionStatus& status) |
| 641 | { |
| 642 | |
| 643 | auto& mf = status.GetMakefile(); |
| 644 | |
| 645 | if (!args.CheckArgs(status)) { |
| 646 | return {}; |
| 647 | } |
| 648 | |
| 649 | cmPkgConfigEnv pcEnv; |
| 650 | |
| 651 | if (args.PcLibdir) { |
| 652 | pcEnv.LibDirs = std::move(*args.PcLibdir); |
| 653 | } |
| 654 | |
| 655 | if (args.PcPath) { |
| 656 | pcEnv.Path = std::move(*args.PcPath); |
| 657 | } |
| 658 | |
| 659 | pcEnv.DisableUninstalled = args.DisableUninstalled; |
| 660 | |
| 661 | if (args.SysrootDir) { |
| 662 | pcEnv.SysrootDir = std::move(*args.SysrootDir); |
| 663 | } |
| 664 | |
| 665 | if (args.TopBuildDir) { |
| 666 | pcEnv.TopBuildDir = std::move(*args.TopBuildDir); |
| 667 | } |
| 668 | |
| 669 | CollectEnv(mf, pcEnv, args.EnvMode); |
| 670 | |
| 671 | if (pcEnv.Path) { |
| 672 | pcEnv.search = *pcEnv.Path; |
| 673 | if (pcEnv.LibDirs) { |
| 674 | pcEnv.search += *pcEnv.LibDirs; |
| 675 | } |
| 676 | } else if (pcEnv.LibDirs) { |
| 677 | pcEnv.search = *pcEnv.LibDirs; |
| 678 | } |
| 679 | |
| 680 | return std::pair<cmPkgConfigEnv, ImportEnv>{ |
| 681 | pcEnv, |
| 682 | { args.Required, args.Quiet, args.Exact, false, args.Strictness, status } |
| 683 | }; |
| 684 | } |
| 685 | |
| 686 | struct ExtractArguments : CommonArguments |
| 687 | { |
no test coverage detected
searching dependent graphs…