mirror of
https://github.com/pytorch/pytorch.git
synced 2025-10-20 12:54:11 +08:00
^ Differential Revision: [D78361893](https://our.internmc.facebook.com/intern/diff/D78361893/) Pull Request resolved: https://github.com/pytorch/pytorch/pull/158365 Approved by: https://github.com/swolchok ghstack dependencies: #158358
30 lines
852 B
Python
30 lines
852 B
Python
def define_targets(rules):
|
|
rules.cc_library(
|
|
name = "macros",
|
|
srcs = [":cmake_macros_h"],
|
|
hdrs = [
|
|
# Following the example from c10
|
|
"Macros.h",
|
|
"Export.h",
|
|
],
|
|
linkstatic = True,
|
|
local_defines = ["C10_BUILD_MAIN_LIB"],
|
|
visibility = ["//visibility:public"],
|
|
)
|
|
|
|
rules.cmake_configure_file(
|
|
name = "cmake_macros_h",
|
|
src = "cmake_macros.h.in",
|
|
out = "cmake_macros.h",
|
|
definitions = [
|
|
"C10_BUILD_SHARED_LIBS",
|
|
"C10_USE_MSVC_STATIC_RUNTIME",
|
|
] + rules.select({
|
|
"//c10:using_gflags": ["C10_USE_GFLAGS"],
|
|
"//conditions:default": [],
|
|
}) + rules.select({
|
|
"//c10:using_glog": ["C10_USE_GLOG"],
|
|
"//conditions:default": [],
|
|
}),
|
|
)
|