Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in / Register
Toggle navigation
G
gflags
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Packages
Packages
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
submodule
gflags
Commits
40b85b18
Commit
40b85b18
authored
Feb 19, 2016
by
Rob Earhart
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add bazel support
parent
f9fa3050
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
124 additions
and
2 deletions
+124
-2
BUILD
BUILD
+102
-0
INSTALL.md
INSTALL.md
+22
-1
util.h
src/util.h
+0
-1
No files found.
BUILD
0 → 100644
View file @
40b85b18
# Bazel build file for gflags
#
# See INSTALL.md for instructions for adding gflags to a Bazel workspace.
licenses(["notice"])
cc_library(
name = "gflags",
srcs = [
"src/gflags.cc",
"src/gflags_completions.cc",
"src/gflags_reporting.cc",
"src/mutex.h",
"src/util.h",
":config_h",
":gflags_completions_h",
":gflags_declare_h",
":gflags_h",
":includes",
],
hdrs = ["gflags.h"],
copts = [
"-Wno-sign-compare",
"-DHAVE_STDINT_H",
"-DHAVE_SYS_TYPES_H",
"-DHAVE_INTTYPES_H",
"-DHAVE_SYS_STAT_H",
"-DHAVE_UNISTD_H",
"-DHAVE_FNMATCH_H",
"-DHAVE_STRTOLL",
"-DHAVE_STRTOQ",
"-DHAVE_PTHREAD",
"-DHAVE_RWLOCK",
"-DGFLAGS_INTTYPES_FORMAT_C99",
],
includes = [
"include",
],
visibility = ["//visibility:public"],
)
genrule(
name = "config_h",
srcs = [
"src/config.h.in",
],
outs = [
"config.h",
],
cmd = "sed -r -e 's,^#cmakedefine,// cmakedefine,' $(<) > $(@)",
)
genrule(
name = "gflags_h",
srcs = [
"src/gflags.h.in",
],
outs = [
"gflags.h",
],
cmd = "sed -r -e 's/@[A-Z_]+@//' $(<) > $(@)",
)
genrule(
name = "gflags_completions_h",
srcs = [
"src/gflags_completions.h.in",
],
outs = [
"gflags_completions.h",
],
cmd = "sed -r -e 's/@GFLAGS_NAMESPACE@/gflags/' $(<) > $(@)",
)
genrule(
name = "gflags_declare_h",
srcs = [
"src/gflags_declare.h.in",
],
outs = [
"gflags_declare.h",
],
cmd = ("sed -r -e '" +
"s/@GFLAGS_NAMESPACE@/gflags/;" +
"s/@(HAVE_STDINT_H|HAVE_SYS_TYPES_H|HAVE_INTTYPES_H" +
"|GFLAGS_INTTYPES_FORMAT_C99)@/1/;" +
"s/@([A-Z0-9_]+)@/0/" +
"' $(<) > $(@)"),
)
genrule(
name = "includes",
srcs = [
":gflags_h",
":gflags_declare_h",
],
outs = [
"include/gflags/gflags.h",
"include/gflags/gflags_declare.h",
],
cmd = "mkdir -p $(@D)/include/gflags && cp $(SRCS) $(@D)/include/gflags",
)
INSTALL.md
View file @
40b85b18
...
...
@@ -11,7 +11,7 @@ following command:
sudo apt-get install gflags
Compiling the source code
Compiling the source code
with CMake
=========================
The build system of gflags is since version 2.1 based on
[
CMake
](
http://cmake.org
)
.
...
...
@@ -65,3 +65,24 @@ GFLAGS_INTTYPES_FORMAT | String identifying format of built-in integer type
GFLAGS_INCLUDE_DIR | Name of headers installation directory relative to CMAKE_INSTALL_PREFIX.
LIBRARY_INSTALL_DIR | Name of library installation directory relative to CMAKE_INSTALL_PREFIX.
INSTALL_HEADERS | Request installation of public header files.
Using gflags with [Bazel](http://bazel.io)
=========================
To use gflags in a Bazel project, map it in as an external dependency by editing
your WORKSPACE file:
git_repository(
name = "gflags_git",
commit = "", # Use the current HEAD commit
remote = "https://github.com/gflags/gflags.git",
)
bind(
name = "gflags",
actual = "@gflags_git//:gflags",
)
You can then add
`//external:gflags`
to the
`deps`
section of a
`cc_binary`
or
`cc_library`
rule, and
`#include <gflags/gflags.h>`
to include it in your source
code.
src/util.h
View file @
40b85b18
...
...
@@ -37,7 +37,6 @@
#include "config.h"
#include <assert.h>
#include <config.h>
#ifdef HAVE_INTTYPES_H
# include <inttypes.h>
#endif
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment