|
|
@ -368,18 +368,17 @@ class Resolver: |
|
|
|
self.dirname = self.wrap.filename |
|
|
|
self.dirname = self.wrap.filename |
|
|
|
rel_path = os.path.relpath(self.dirname, self.source_dir) |
|
|
|
rel_path = os.path.relpath(self.dirname, self.source_dir) |
|
|
|
|
|
|
|
|
|
|
|
meson_file = os.path.join(self.dirname, 'meson.build') |
|
|
|
if method == 'meson': |
|
|
|
cmake_file = os.path.join(self.dirname, 'CMakeLists.txt') |
|
|
|
buildfile = os.path.join(self.dirname, 'meson.build') |
|
|
|
|
|
|
|
elif method == 'cmake': |
|
|
|
if method not in ['meson', 'cmake']: |
|
|
|
buildfile = os.path.join(self.dirname, 'CMakeLists.txt') |
|
|
|
|
|
|
|
else: |
|
|
|
raise WrapException('Only the methods "meson" and "cmake" are supported') |
|
|
|
raise WrapException('Only the methods "meson" and "cmake" are supported') |
|
|
|
|
|
|
|
|
|
|
|
# The directory is there and has meson.build? Great, use it. |
|
|
|
# The directory is there and has meson.build? Great, use it. |
|
|
|
if method == 'meson' and os.path.exists(meson_file): |
|
|
|
if os.path.exists(buildfile): |
|
|
|
self.validate() |
|
|
|
self.validate() |
|
|
|
return rel_path |
|
|
|
return rel_path |
|
|
|
if method == 'cmake' and os.path.exists(cmake_file): |
|
|
|
|
|
|
|
return rel_path |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
# Check if the subproject is a git submodule |
|
|
|
# Check if the subproject is a git submodule |
|
|
|
self.resolve_git_submodule() |
|
|
|
self.resolve_git_submodule() |
|
|
@ -408,10 +407,8 @@ class Resolver: |
|
|
|
raise |
|
|
|
raise |
|
|
|
|
|
|
|
|
|
|
|
# A meson.build or CMakeLists.txt file is required in the directory |
|
|
|
# A meson.build or CMakeLists.txt file is required in the directory |
|
|
|
if method == 'meson' and not os.path.exists(meson_file): |
|
|
|
if not os.path.exists(buildfile): |
|
|
|
raise WrapException('Subproject exists but has no meson.build file') |
|
|
|
raise WrapException(f'Subproject exists but has no {os.path.basename(buildfile)} file') |
|
|
|
if method == 'cmake' and not os.path.exists(cmake_file): |
|
|
|
|
|
|
|
raise WrapException('Subproject exists but has no CMakeLists.txt file') |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
# At this point, the subproject has been successfully resolved for the |
|
|
|
# At this point, the subproject has been successfully resolved for the |
|
|
|
# first time so save off the hash of the entire wrap file for future |
|
|
|
# first time so save off the hash of the entire wrap file for future |
|
|
|