Skip to content

Commit

Permalink
Fix false negative missing of ROOT.
Browse files Browse the repository at this point in the history
  • Loading branch information
brettviren committed Aug 23, 2019
1 parent b477f15 commit 2d0c6dc
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 7 deletions.
6 changes: 4 additions & 2 deletions waftools/rootsys.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,9 @@ def check_root(cfg, mandatory=False):
instdir = cfg.options.with_root

if instdir and instdir.lower() in ['no','off','false']:
if mandatory:
raise RuntimeError("ROOT is mandatory but disabled via command line")
print ("optional ROOT dependency disabled by command line")
return

cfg.env.CXXFLAGS += ['-fPIC']
Expand All @@ -29,11 +32,10 @@ def check_root(cfg, mandatory=False):

kwargs = dict(path_list=path_list)


cfg.find_program('root-config', var='ROOT-CONFIG', mandatory=mandatory, **kwargs)
if not 'ROOT-CONFIG' in cfg.env:
if mandatory:
raise RuntimeError("root-config not found but required")
raise RuntimeError("root-config not found but ROOT required")
print ("skipping non mandatory ROOT, use --with-root to force")
return

Expand Down
12 changes: 7 additions & 5 deletions wscript
Original file line number Diff line number Diff line change
Expand Up @@ -58,11 +58,13 @@ def configure(cfg):
submodules.remove('dfp')

# Remove WCT packages that happen to have same name as external name
for maybe in "root tbb cuda".split():
have='have_%s'%maybe
if have.upper() not in cfg.env and maybe in submodules:
print ('Removing submodule "%s" due to lack of external dependency'%maybe)
submodules.remove(maybe)
for pkg,ext in dict(root="ROOTSYS", tbb="TBB", cuda="CUDA").items():
have='HAVE_'+ext
if have in cfg.env:
continue
if pkg in submodules:
print ('Removing package "%s" due to lack of external dependency'%pkg)
submodules.remove(pkg)

cfg.env.SUBDIRS = submodules
print ('Configured for submodules: %s' % (', '.join(submodules), ))
Expand Down

0 comments on commit 2d0c6dc

Please sign in to comment.