forked from pytorch/pytorch
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
extract out //c10/util:base library (pytorch#70854)
Summary: Pull Request resolved: pytorch#70854 We can't do the entire package since parts of it depend on //c10/core. ghstack-source-id: 147170901 Test Plan: Rely on CI. Reviewed By: malfet Differential Revision: D33321821 fbshipit-source-id: 6d634da872a382a60548e2eea37a0f9f93c6f080 (cherry picked from commit 0afa808)
- Loading branch information
1 parent
108b37d
commit 40e88b7
Showing
5 changed files
with
73 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
load("//:tools/bazel.bzl", "rules") | ||
load(":build.bzl", "define_targets") | ||
|
||
define_targets(rules = rules) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,53 @@ | ||
def define_targets(rules): | ||
rules.cc_library( | ||
name = "base", | ||
srcs = rules.glob( | ||
["*.cpp"], | ||
exclude = [ | ||
"TypeCast.cpp", | ||
"typeid.cpp", | ||
], | ||
), | ||
hdrs = rules.glob( | ||
["*.h"], | ||
exclude = [ | ||
"TypeCast.h", | ||
"typeid.h", | ||
], | ||
), | ||
# This library uses flags and registration. Do not let the | ||
# linker remove them. | ||
alwayslink = True, | ||
linkstatic = True, | ||
local_defines = ["C10_BUILD_MAIN_LIB"], | ||
visibility = ["//visibility:public"], | ||
deps = [ | ||
"@fmt", | ||
"//c10/macros", | ||
] + rules.select({ | ||
"//c10:using_gflags": ["@com_github_gflags_gflags//:gflags"], | ||
"//conditions:default": [], | ||
}) + rules.select({ | ||
"//c10:using_glog": ["@com_github_glog//:glog"], | ||
"//conditions:default": [], | ||
}), | ||
) | ||
|
||
rules.filegroup( | ||
name = "headers", | ||
srcs = rules.glob( | ||
["*.h"], | ||
exclude = [ | ||
], | ||
), | ||
visibility = ["//c10:__pkg__"], | ||
) | ||
|
||
rules.filegroup( | ||
name = "sources", | ||
srcs = [ | ||
"TypeCast.cpp", | ||
"typeid.cpp", | ||
], | ||
visibility = ["//c10:__pkg__"], | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters