cmake: Handle disabling subprojects
This commit is contained in:
parent
185238fdb4
commit
6813ef1e24
|
@ -274,7 +274,10 @@ class CmakeModule(ExtensionModule):
|
|||
if len(args) != 1:
|
||||
raise InterpreterException('Subproject takes exactly one argument')
|
||||
dirname = args[0]
|
||||
return CMakeSubprojectHolder(interpreter.do_subproject(dirname, 'cmake', kwargs), dirname)
|
||||
subp = interpreter.do_subproject(dirname, 'cmake', kwargs)
|
||||
if not subp.held_object:
|
||||
return subp
|
||||
return CMakeSubprojectHolder(subp, dirname)
|
||||
|
||||
def initialize(*args, **kwargs):
|
||||
return CmakeModule(*args, **kwargs)
|
||||
|
|
|
@ -0,0 +1,5 @@
|
|||
project('cmakeSubTest', ['c', 'cpp'])
|
||||
|
||||
cm = import('cmake')
|
||||
|
||||
sub_pro = cm.subproject('nothinig', required: false)
|
Loading…
Reference in New Issue