Skip to content
This repository has been archived by the owner on Jun 30, 2021. It is now read-only.

Commit

Permalink
Bazel Adjustments (Imports, 0.7.0) (#27)
Browse files Browse the repository at this point in the history
* fix boost skylark import when using external repos

* Update third_party for newer Bazel versions
  • Loading branch information
Lucas Kacher authored and Jeffail committed Nov 1, 2017
1 parent f6c958a commit 6288e52
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 13 deletions.
2 changes: 1 addition & 1 deletion third_party/boost/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ licenses(["notice"])

boost_path = "upstream"

load("/third_party/boost/tool", "boost_library")
load("//third_party/boost:tool.bzl", "boost_library")

boost_library(
name = "assert",
Expand Down
27 changes: 15 additions & 12 deletions third_party/boost/tool.bzl
Original file line number Diff line number Diff line change
@@ -1,20 +1,23 @@
is_library = False

if is_library:
include_path = "@boost/include"
library_path = "@boost/lib"
includes_pattern = include_path + "/%s/"
include_pattern1 = includes_pattern + "**/*.h"
include_pattern2 = includes_pattern + "**/*pp" # hpp and ipp
else:
includes_pattern = "upstream/%s/include"
include_pattern1 = includes_pattern + "/boost/**/*.h"
include_pattern2 = includes_pattern + "/boost/**/*pp"
def _is_library( is_library = False ):
if is_library:
include_path = "@boost/include"
library_path = "@boost/lib"
includes_pattern = include_path + "/%s/"
include_pattern1 = includes_pattern + "**/*.h"
include_pattern2 = includes_pattern + "**/*pp" # hpp and ipp
else:
includes_pattern = "upstream/%s/include"
include_pattern1 = includes_pattern + "/boost/**/*.h"
include_pattern2 = includes_pattern + "/boost/**/*pp"

return includes_pattern, include_pattern1, include_pattern2

def includes_list( library_name ):
includes_pattern, include_pattern1, include_pattern2 = _is_library()
return [ includes_pattern % library_name ]

def hdr_list( library_name ):
includes_pattern, include_pattern1, include_pattern2 = _is_library()
return native.glob([
include_pattern1 % library_name,
include_pattern2 % library_name,
Expand Down

0 comments on commit 6288e52

Please sign in to comment.