Add examples to the Bazel build

Also moves the gflags namespace define
into the ceres_library() target.

Change-Id: Ibb8f3fdd9a8c371fe96b475f752f8320ffe63cdc
This commit is contained in:
Keir Mierle
2018-02-21 11:13:57 -08:00
parent d634d6168e
commit a3b1e19c2c
3 changed files with 131 additions and 4 deletions
+4 -1
View File
@@ -130,7 +130,9 @@ CERES_SRCS = ["internal/ceres/" + filename for filename in [
# TODO(rodrigoq): add support to configure Ceres into various permutations,
# like SuiteSparse or not, threading or not, glog or not, and so on.
# See https://github.com/ceres-solver/ceres-solver/issues/335.
def ceres_library(name, restrict_schur_specializations=False):
def ceres_library(name,
restrict_schur_specializations=False,
gflags_namespace="gflags"):
# The path to internal/ depends on whether Ceres is the main workspace or
# an external repository.
if native.repository_name() != '@':
@@ -188,6 +190,7 @@ def ceres_library(name, restrict_schur_specializations=False):
"CERES_NO_THREADS",
"CERES_NO_LAPACK",
"CERES_STD_UNORDERED_MAP",
"CERES_GFLAGS_NAMESPACE=" + gflags_namespace,
],
includes = [
"config",