Skip to content

Commit b914469

Browse files
authored
fix: empty build arguments in multi-target build (#784)
This commit fixes an issue when building a package with multiple targets. **[Bug]** To give an example: ```toml cmake.targets = ["target_A", "target_B", "target_C"] ``` In this case, scikit-build-core generates a sequence of build commands: ```bash cmake --target target_A --config Release cmake --target target_B cmake --target target_C ``` Note that `--config Release` is lost since the second target. **[Cause]** This originates from the case where `local_args` in `CMaker.build` in `cmake.py` is a generator rather than a list/tuple, and it becomes empty after being passed to `self._build` in [line 247](https://github.com/scikit-build/scikit-build-core/blob/83afeb2cad1f9f0168d92df6b9b0f9d43abd53a4/src/scikit_build_core/cmake.py#L247). **[Fix]** This PR proactively converts `local_args` to a Python list before feeding it to `self._build`.
1 parent 83afeb2 commit b914469

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/scikit_build_core/cmake.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -238,7 +238,7 @@ def build(
238238
targets: Sequence[str] = (),
239239
verbose: bool = False,
240240
) -> None:
241-
local_args = self._compute_build_args(verbose=verbose)
241+
local_args = list(self._compute_build_args(verbose=verbose))
242242
if not targets:
243243
self._build(*local_args, *build_args)
244244
return

0 commit comments

Comments
 (0)