Skip to content

Instantly share code, notes, and snippets.

@njlr
Created October 18, 2017 15:00
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save njlr/ff584ea276fdf65d6a8b0e89000ade12 to your computer and use it in GitHub Desktop.
Save njlr/ff584ea276fdf65d6a8b0e89000ade12 to your computer and use it in GitHub Desktop.
def add_include_guard(x):
 name = hashlib.sha256(x).hexdigest()[0:16]
  genrule(
  name = name,
  out = os.path.basename(x),
  srcs = [
  'scripts/add-include-guard.py', 
  x,
  ],
  cmd = 'python $SRCS > $OUT',
  )
  return ':' + name
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment