@@ -18,6 +18,7 @@ public function configure(): void
1818 {
1919 $ this ->addArgument ('extensions ' , InputArgument::OPTIONAL , 'The extensions will be compiled, comma separated ' );
2020 $ this ->addOption ('with-libs ' , null , InputOption::VALUE_REQUIRED , 'add additional libraries, comma separated ' , '' );
21+ $ this ->addOption ('with-packages ' , null , InputOption::VALUE_REQUIRED , 'add additional libraries, comma separated ' , '' );
2122 $ this ->addOption ('with-suggested-libs ' , 'L ' , null , 'Build with suggested libs for selected exts and libs ' );
2223 $ this ->addOption ('with-suggests ' , null , null , 'Build with suggested packages for selected exts and libs ' );
2324 $ this ->addOption ('with-suggested-exts ' , 'E ' , null , 'Build with suggested extensions for selected exts ' );
@@ -31,15 +32,16 @@ public function configure(): void
3132 public function handle (): int
3233 {
3334 // transform string to array
34- $ libraries = array_map ('trim ' , array_filter (explode (', ' , $ this ->getOption ('with-libs ' ))));
35+ $ libraries = parse_comma_list ($ this ->getOption ('with-libs ' ));
36+ $ libraries = array_merge ($ libraries , $ this ->getOption ('with-packages ' ));
3537 // transform string to array
3638 $ extensions = $ this ->getArgument ('extensions ' ) ? parse_extension_list ($ this ->getArgument ('extensions ' )) : [];
3739 $ include_suggests = $ this ->getOption ('with-suggests ' ) ?: $ this ->getOption ('with-suggested-libs ' ) || $ this ->getOption ('with-suggested-exts ' );
3840
3941 $ util = new SPCConfigUtil (options: [
40- 'no_php ' => $ this ->getOption ('no-php ' ),
41- 'libs_only_deps ' => $ this ->getOption ('libs-only-deps ' ),
42- 'absolute_libs ' => $ this ->getOption ('absolute-libs ' ),
42+ 'no_php ' => ( bool ) $ this ->getOption ('no-php ' ),
43+ 'libs_only_deps ' => ( bool ) $ this ->getOption ('libs-only-deps ' ),
44+ 'absolute_libs ' => ( bool ) $ this ->getOption ('absolute-libs ' ),
4345 ]);
4446 $ packages = array_merge (array_map (fn ($ x ) => "ext- {$ x }" , $ extensions ), $ libraries );
4547 $ config = $ util ->config ($ packages , $ include_suggests );
0 commit comments