make emconfigure and emcmake work, kinda

This commit is contained in:
Danny McClanahan
2022-04-20 15:47:51 +00:00
parent 187c0f1d04
commit cc87de83cd
3 changed files with 15 additions and 2 deletions

View File

@@ -512,6 +512,7 @@ def _set_variables_for_single_module(pkg, module):
m.make_jobs = jobs m.make_jobs = jobs
# TODO: make these build deps that can be installed if not found. # TODO: make these build deps that can be installed if not found.
# FIXME: !!!!!
m.make = MakeExecutable('make', jobs) m.make = MakeExecutable('make', jobs)
m.gmake = MakeExecutable('gmake', jobs) m.gmake = MakeExecutable('gmake', jobs)
m.scons = MakeExecutable('scons', jobs) m.scons = MakeExecutable('scons', jobs)
@@ -523,9 +524,15 @@ def _set_variables_for_single_module(pkg, module):
# Find the configure script in the archive path # Find the configure script in the archive path
# Don't use which for this; we want to find it in the current dir. # Don't use which for this; we want to find it in the current dir.
m.configure = Executable('./configure') m.configure = Executable('./configure')
m.emconfigure = Executable('emconfigure')
m.emconfigure.add_default_arg('./configure')
m.meson = Executable('meson') m.meson = Executable('meson')
m.cmake = Executable('cmake') m.cmake = Executable('cmake')
m.emcmake = Executable('emcmake')
m.emcmake.add_default_arg('cmake')
m.ctest = MakeExecutable('ctest', jobs) m.ctest = MakeExecutable('ctest', jobs)
if sys.platform == 'win32': if sys.platform == 'win32':

View File

@@ -419,6 +419,9 @@ def configure(self, spec, prefix):
options += self.configure_args() options += self.configure_args()
with working_dir(self.build_directory, create=True): with working_dir(self.build_directory, create=True):
if self.spec.satisfies('%emscripten'):
inspect.getmodule(self).emconfigure(*options)
else:
inspect.getmodule(self).configure(*options) inspect.getmodule(self).configure(*options)
def setup_build_environment(self, env): def setup_build_environment(self, env):

View File

@@ -374,6 +374,9 @@ def cmake(self, spec, prefix):
options += self.cmake_args() options += self.cmake_args()
options.append(os.path.abspath(self.root_cmakelists_dir)) options.append(os.path.abspath(self.root_cmakelists_dir))
with working_dir(self.build_directory, create=True): with working_dir(self.build_directory, create=True):
if self.spec.satisfies('%emscripten'):
inspect.getmodule(self).emcmake(*options)
else:
inspect.getmodule(self).cmake(*options) inspect.getmodule(self).cmake(*options)
def build(self, spec, prefix): def build(self, spec, prefix):