blob: a0c1ea6caa07d6ba06a98a2ee98d762501c3fc46 [file] [log] [blame]
licenses(["notice"])
package(default_visibility = ["//visibility:public"])
package_name = "gmock"
package_version = "1.7.0"
package_file = package_name + "-" + package_version + ".zip"
package_dir = package_name + "-" + package_version
genrule(
name = "gmock-srcs",
srcs = [
package_file,
],
outs = [
"include/gmock/gmock-actions.h",
"include/gmock/gmock-generated-function-mockers.h.pump",
"include/gmock/gmock-matchers.h",
"include/gmock/gmock-cardinalities.h",
"include/gmock/gmock-generated-matchers.h",
"include/gmock/gmock-more-actions.h",
"include/gmock/gmock-generated-actions.h",
"include/gmock/gmock-generated-matchers.h.pump",
"include/gmock/gmock-more-matchers.h",
"include/gmock/gmock-generated-actions.h.pump",
"include/gmock/gmock-generated-nice-strict.h",
"include/gmock/gmock-spec-builders.h",
"include/gmock/gmock-generated-function-mockers.h",
"include/gmock/gmock-generated-nice-strict.h.pump",
"include/gmock/gmock.h",
"include/gmock/internal/gmock-generated-internal-utils.h",
"include/gmock/internal/gmock-internal-utils.h",
"include/gmock/internal/gmock-generated-internal-utils.h.pump",
"include/gmock/internal/gmock-port.h",
"lib/libgmock.a",
"lib/libgmock_main.a",
],
cmd = "\n".join([
"export TMP_DIR=$$(mktemp -d -t gmock.XXXXX)",
"export INSTALL_DIR=$$(pwd)/$(@D)",
"mkdir -p $$TMP_DIR",
"cp -R $(SRCS) $$TMP_DIR",
"cd $$TMP_DIR",
"unzip -o " + package_file,
"cd " + package_dir,
"./configure --prefix=$$INSTALL_DIR --enable-shared=no",
"make",
"cp lib/.libs/*.a lib/",
"cd $$TMP_DIR",
"rm -rf $$INSTALL_DIR/*",
"cp -r " + package_dir + "/*" + " " + "$$INSTALL_DIR",
"rm -rf $$TMP_DIR",
]),
)
cc_library(
name = "gmock-cxx",
srcs = [
"include/gmock/gmock-actions.h",
"include/gmock/gmock-matchers.h",
"include/gmock/gmock-cardinalities.h",
"include/gmock/gmock-generated-matchers.h",
"include/gmock/gmock-more-actions.h",
"include/gmock/gmock-generated-actions.h",
"include/gmock/gmock-more-matchers.h",
"include/gmock/gmock-generated-nice-strict.h",
"include/gmock/gmock-spec-builders.h",
"include/gmock/gmock-generated-function-mockers.h",
"include/gmock/internal/gmock-generated-internal-utils.h",
"include/gmock/internal/gmock-internal-utils.h",
"include/gmock/internal/gmock-port.h",
"empty.cc",
"lib/libgmock.a",
],
hdrs = [
"include/gmock/gmock.h",
],
includes = [
"include",
],
linkstatic = 1,
)
cc_library(
name = "gmock_main-cxx",
srcs = [
"empty.cc",
"lib/libgmock_main.a",
],
linkstatic = 1,
)
filegroup(
name = "gmock",
srcs = [
":gmock-cxx",
":gmock_main-cxx",
]
)