Import("env_base", "env_etc")
env = env_base.Clone(
  SHLINKFLAGS=env_etc.shlinkflags,
  LIBS=["cctbx", "omptbx", "cctbx_sgtbx_asu"]+env_etc.libm)
env_etc.include_registry.append(
  env=env,
  paths=env_etc.mmtbx_common_includes)

lib_sources = [
  "atom_mask.cpp"
]

if (env_etc.static_libraries): builder = env.StaticLibrary
else:                          builder = env.SharedLibrary

builder(
  target="#lib/mmtbx_masks",
  source=lib_sources)

env = env.Clone()
env.Prepend(LIBS=["mmtbx_masks", "iotbx_pdb"])
env.Program( target = "tst_mask",  source="tst_mask.cpp")

if (not env_etc.no_boost_python):
  Import("env_cctbx_boost_python_ext")
  env_bpl = env_cctbx_boost_python_ext.Clone()
  env_etc.include_registry.append(
    env=env_bpl,
    paths=env_etc.mmtbx_common_includes)
  env_bpl.Prepend(LIBS=["mmtbx_masks", "cctbx_sgtbx_asu", "cctbx", "omptbx"])
  env_bpl.SharedLibrary(
    target="#lib/mmtbx_masks_ext",
    source=["masks_ext.cpp"])
