11# ------------------------------------------------------------------------------
2-
3- # gflags is materialized during build time by cmake. See third-party/CMakeLists.txt.
4- def _path (relative_path ):
5- return "gflags/gflags-src/{}" .format (relative_path )
6-
72# Add native rules to configure source files
83# Not tested for building on windows platforms
94def gflags_sources (namespace = ["google" , "gflags" ]):
@@ -12,7 +7,7 @@ def gflags_sources(namespace = ["google", "gflags"]):
127 # @lint-ignore BUCKLINT: native and fb_native are explicitly forbidden in fbcode.
138 native .genrule (
149 name = "gflags_declare_h" ,
15- srcs = [_path ( " src/gflags_declare.h.in") ],
10+ srcs = ["gflags/ src/gflags_declare.h.in" ],
1611 out = "gflags/gflags_declare.h" ,
1712 cmd = (common_preamble + "awk '{ " +
1813 "gsub(/@GFLAGS_NAMESPACE@/, \" " + namespace [0 ] + "\" ); " +
@@ -27,7 +22,7 @@ def gflags_sources(namespace = ["google", "gflags"]):
2722 # @lint-ignore BUCKLINT: native and fb_native are explicitly forbidden in fbcode.
2823 native .genrule (
2924 name = gflags_ns_h_file .replace ("." , "_" ),
30- srcs = [_path ( " src/gflags_ns.h.in") ],
25+ srcs = ["gflags/ src/gflags_ns.h.in" ],
3126 out = "gflags/" + gflags_ns_h_file ,
3227 cmd = (common_preamble + "awk '{ " +
3328 "gsub(/@ns@/, \" " + ns + "\" ); " +
@@ -39,7 +34,7 @@ def gflags_sources(namespace = ["google", "gflags"]):
3934 # @lint-ignore BUCKLINT: native and fb_native are explicitly forbidden in fbcode.
4035 native .genrule (
4136 name = "gflags_h" ,
42- srcs = [_path ( " src/gflags.h.in") ],
37+ srcs = ["gflags/ src/gflags.h.in" ],
4338 out = "gflags/gflags.h" ,
4439 cmd = (common_preamble + "awk '{ " +
4540 "gsub(/@GFLAGS_ATTRIBUTE_UNUSED@/, \" \" ); " +
@@ -50,15 +45,15 @@ def gflags_sources(namespace = ["google", "gflags"]):
5045 # @lint-ignore BUCKLINT: native and fb_native are explicitly forbidden in fbcode.
5146 native .genrule (
5247 name = "gflags_completions_h" ,
53- srcs = [_path ( " src/gflags_completions.h.in") ],
48+ srcs = ["gflags/ src/gflags_completions.h.in" ],
5449 out = "gflags/gflags_completions.h" ,
5550 cmd = common_preamble + "awk '{ gsub(/@GFLAGS_NAMESPACE@/, \" " + namespace [0 ] + "\" ); print; }' $SRCS > $OUT" ,
5651 )
5752 headers = {
58- "config.h" : _path ( " src/config.h") ,
59- "mutex.h" : _path ( " src/mutex.h") ,
60- "util.h" : _path ( " src/util.h") ,
61- "windows_port.h" : _path ( " src/windows_port.h") ,
53+ "config.h" : "gflags/ src/config.h" ,
54+ "mutex.h" : "gflags/ src/mutex.h" ,
55+ "util.h" : "gflags/ src/util.h" ,
56+ "windows_port.h" : "gflags/ src/windows_port.h" ,
6257 }
6358 exported_headers = {
6459 "gflags/gflags.h" : ":gflags_h" ,
@@ -67,9 +62,9 @@ def gflags_sources(namespace = ["google", "gflags"]):
6762 }
6863 exported_headers .update ({"gflags/" + hdr : ":" + hdr .replace ("." , "_" ) for hdr in gflags_ns_h_files })
6964 srcs = [
70- _path ( " src/gflags.cc") ,
71- _path ( " src/gflags_completions.cc") ,
72- _path ( " src/gflags_reporting.cc") ,
65+ "gflags/ src/gflags.cc" ,
66+ "gflags/ src/gflags_completions.cc" ,
67+ "gflags/ src/gflags_reporting.cc" ,
7368 ]
7469 return [exported_headers , headers , srcs ]
7570
0 commit comments