Build the group and return objects. Args: env: SCons Environment Returns: List of build objects
(self, env)
| 47 | objects: List[Any] = field(default_factory=list) |
| 48 | |
| 49 | def build(self, env) -> List: |
| 50 | """ |
| 51 | Build the group and return objects. |
| 52 | |
| 53 | Args: |
| 54 | env: SCons Environment |
| 55 | |
| 56 | Returns: |
| 57 | List of build objects |
| 58 | """ |
| 59 | if not self.sources: |
| 60 | return [] |
| 61 | |
| 62 | # Clone environment if we have local options |
| 63 | build_env = env |
| 64 | if self._has_local_options(): |
| 65 | build_env = env.Clone() |
| 66 | self._apply_local_options(build_env) |
| 67 | |
| 68 | # Apply global options |
| 69 | self._apply_global_options(build_env) |
| 70 | |
| 71 | # Build objects |
| 72 | self.objects = [] |
| 73 | for src in self.sources: |
| 74 | if isinstance(src, str): |
| 75 | # Build single file |
| 76 | obj = build_env.Object(src) |
| 77 | self.objects.extend(obj if isinstance(obj, list) else [obj]) |
| 78 | else: |
| 79 | # Already a Node |
| 80 | self.objects.append(src) |
| 81 | |
| 82 | return self.objects |
| 83 | |
| 84 | def _has_local_options(self) -> bool: |
| 85 | """Check if group has local options.""" |
no test coverage detected