Skip to content

Commit

Permalink
Merge pull request #2032 from Flamefire/clean_build_dir
Browse files Browse the repository at this point in the history
let CMakeMake remove 'easybuild_obj' build directory if it already exists
  • Loading branch information
boegel authored May 19, 2020
2 parents db913b4 + c5b6743 commit a9a04dd
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion easybuild/easyblocks/generic/cmakemake.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@
from easybuild.framework.easyconfig import CUSTOM
from easybuild.tools.build_log import print_warning
from easybuild.tools.config import build_option
from easybuild.tools.filetools import change_dir, mkdir, which
from easybuild.tools.filetools import change_dir, mkdir, which, remove_dir
from easybuild.tools.environment import setvar
from easybuild.tools.modules import get_software_root
from easybuild.tools.run import run_cmd
Expand Down Expand Up @@ -120,6 +120,12 @@ def configure_step(self, srcdir=None, builddir=None):

if builddir is None and self.cfg.get('separate_build_dir', True):
builddir = os.path.join(self.builddir, 'easybuild_obj')
# For separate_build_dir we want a clean folder. So remove if it exists
# This can happen when multiple iterations are done (e.g. shared, static, ...)
if os.path.exists(builddir):
self.log.warning('Build directory %s already exists (from previous iterations?). Removing...',
builddir)
remove_dir(builddir)

if builddir:
mkdir(builddir, parents=True)
Expand Down

0 comments on commit a9a04dd

Please sign in to comment.