Googletest export

Remove the dependency on Objective C++ in iOS builds.

252ce9c52d introduced the use of
NSTemporaryDirectory() on iOS, which requires Core Foundation, and
Objective C++.

This CL replaces NSTemporaryDirectory() with an equivalent solution
(according to Apple's documentation at [1]) available to C/C++ code.
Avoiding Objective C++ and Core Foundation makes it easier to integrate
googletest in projects that can't use the supplied Bazel build files.

[1] https://developer.apple.com/library/archive/documentation/Security/Conceptual/SecureCodingGuide/Articles/RaceConditions.html#//apple_ref/doc/uid/TP40002585-SW10

PiperOrigin-RevId: 375474990
This commit is contained in:
Abseil Team
2021-05-24 10:53:07 -04:00
committed by Derek Mauro
parent 9741c42200
commit c0777e6565
2 changed files with 36 additions and 27 deletions

View File

@@ -56,12 +56,6 @@ config_setting(
values = {"define": "absl=1"},
)
config_setting(
name = "ios",
values = {"apple_platform_type": "ios"},
visibility = [":__subpackages__"],
)
# Library that defines the FRIEND_TEST macro.
cc_library(
name = "gtest_prod",
@@ -92,10 +86,6 @@ cc_library(
"googlemock/include/gmock/*.h",
]),
copts = select({
":ios": [
"-xobjective-c++",
"-pthread",
],
":windows": [],
"//conditions:default": ["-pthread"],
}),