Skip to content

Commit 1c9cd8e

Browse files
committed
[cmake_frontend.py] change parameter optionality; ret type of functions
- makes easier for the user, doesn't have to access dict values in the case of single use.
1 parent 20e0862 commit 1c9cd8e

File tree

1 file changed

+15
-20
lines changed

1 file changed

+15
-20
lines changed

clang_bind/cmake_frontend.py

Lines changed: 15 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -243,29 +243,24 @@ def get_library_targets(self):
243243
)
244244
return list(map(lambda target: target.get_name(), library_targets_objs))
245245

246-
def get_dependencies(self, target=None):
247-
"""Get dependencies of the target(s).
246+
def get_dependencies(self, target):
247+
"""Get dependencies of the target.
248248
249-
:param target: Target to get the dependencies, defaults to None
250-
:type target: str, optional
251-
:return: Dependencies of the target(s).
252-
:rtype: dict
249+
:param target: Target to get the dependencies of.
250+
:type target: str
251+
:return: Dependencies of the target.
252+
:rtype: list
253253
"""
254-
targets = [self.targets.get(target)] if target else self.targets.values()
255-
return {
256-
target.get_name(): list(
257-
map(lambda x: x.split("::")[0], target.get_dependencies())
258-
)
259-
for target in targets
260-
}
254+
return list(
255+
map(lambda x: x.split("::")[0], self.targets.get(target).get_dependencies())
256+
)
261257

262-
def get_sources(self, target=None):
258+
def get_sources(self, target):
263259
"""Get sources of the target(s).
264260
265-
:param target: Target to get the dependencies, defaults to None
266-
:type target: str, optional
267-
:return: Sources of the target(s).
268-
:rtype: dict
261+
:param target: Target to get the sources of.
262+
:type target: str
263+
:return: Sources of the target.
264+
:rtype: list
269265
"""
270-
targets = [self.targets.get(target)] if target else self.targets.values()
271-
return {target.get_name(): target.get_sources() for target in targets}
266+
return self.targets.get(target).get_sources()

0 commit comments

Comments
 (0)