Commit 163965d5 by Corentin Wallez Committed by Commit Bot

BUILD.gn: prepare dEQP test support on Mac

BUG=angleproject:1569 Change-Id: I703f4739726c849950ba103049fa39498a4ff1df Reviewed-on: https://chromium-review.googlesource.com/744361Reviewed-by: 's avatarFrank Henigman <fjhenigman@chromium.org> Reviewed-by: 's avatarJamie Madill <jmadill@chromium.org> Commit-Queue: Corentin Wallez <cwallez@chromium.org>
parent e7c5f4f0
......@@ -276,6 +276,7 @@ static_library("angle_gpu_info_util") {
libs += [
"IOKit.framework",
"CoreFoundation.framework",
"CoreGraphics.framework",
]
}
}
......
......@@ -384,6 +384,11 @@ if (build_angle_deqp_tests) {
public_configs = [ ":angle_deqp_gtest_support_config" ]
sources = deqp_gypi.deqp_gpu_test_expectations_sources
if (is_mac) {
sources += deqp_gypi.deqp_gpu_test_expectations_sources_mac
libs = [ "Cocoa.framework" ]
}
if (build_with_chromium) {
sources += [ "//gpu/angle_deqp_tests_main.cc" ]
} else {
......
......@@ -1198,6 +1198,11 @@
'third_party/gpu_test_expectations/gpu_test_expectations_parser.cc',
'third_party/gpu_test_expectations/gpu_test_expectations_parser.h',
],
'deqp_gpu_test_expectations_sources_mac':
[
'third_party/gpu_test_expectations/gpu_test_config_mac.mm',
'third_party/gpu_test_expectations/gpu_test_config_mac.h',
],
'conditions':
[
['(OS=="win" or OS=="linux" or OS=="mac")',
......@@ -1857,8 +1862,7 @@
{
'sources':
[
'third_party/gpu_test_expectations/gpu_test_config_mac.h',
'third_party/gpu_test_expectations/gpu_test_config_mac.mm',
'<@(deqp_gpu_test_expectations_sources_mac)',
],
}],
],
......
......@@ -78,8 +78,7 @@ GPUTestConfig::OS GetCurrentOS() {
int32_t major_version = 0;
int32_t minor_version = 0;
int32_t bugfix_version = 0;
base::SysInfo::OperatingSystemVersionNumbers(
&major_version, &minor_version, &bugfix_version);
angle::GetOperatingSystemVersionNumbers(&major_version, &minor_version, &bugfix_version);
if (major_version == 10) {
switch (minor_version) {
case 5:
......
......@@ -12,16 +12,13 @@
#include "gpu_info.h"
namespace base {
class SysInfo
namespace angle
{
public:
static void OperatingSystemVersionNumbers(int32_t *major_version,
int32_t *minor_version,
int32_t *bugfix_version);
};
} // namespace base
void GetOperatingSystemVersionNumbers(int32_t *major_version,
int32_t *minor_version,
int32_t *bugfix_version);
} // namespace angle
#endif // ANGLE_GPU_TEST_EXPECTATIONS_GPU_TEST_CONFIG_MAC_H_
......@@ -9,8 +9,6 @@
#import <Cocoa/Cocoa.h>
namespace base {
// OSX 10.8 deprecates Gestalt but doesn't make the operatingSystemVersion property part of the
// public interface of NSProcessInfo until 10.10. Add a forward declaration.
#if !defined(MAC_OS_X_VERSION_10_10) || MAC_OS_X_VERSION_MIN_REQUIRED < MAC_OS_X_VERSION_10_10
......@@ -19,20 +17,33 @@ namespace base {
@end
#endif
void SysInfo::OperatingSystemVersionNumbers(int32_t *major_version,
int32_t *minor_version,
int32_t *bugfix_version)
namespace angle
{
void GetOperatingSystemVersionNumbers(int32_t *major_version,
int32_t *minor_version,
int32_t *bugfix_version)
{
#if MAC_OS_X_VERSION_MIN_REQUIRED < MAC_OS_X_VERSION_10_8
Gestalt(gestaltSystemVersionMajor, reinterpret_cast<SInt32*>(major_version));
Gestalt(gestaltSystemVersionMinor, reinterpret_cast<SInt32*>(minor_version));
Gestalt(gestaltSystemVersionBugFix, reinterpret_cast<SInt32*>(bugfix_version));
Gestalt(gestaltSystemVersionMajor, reinterpret_cast<SInt32 *>(major_version));
Gestalt(gestaltSystemVersionMinor, reinterpret_cast<SInt32 *>(minor_version));
Gestalt(gestaltSystemVersionBugFix, reinterpret_cast<SInt32 *>(bugfix_version));
#else
NSOperatingSystemVersion version = [[NSProcessInfo processInfo] operatingSystemVersion];
*major_version = version.majorVersion;
*minor_version = version.minorVersion;
*bugfix_version = version.patchVersion;
if (@available(macOS 10.10, *))
{
NSOperatingSystemVersion version = [[NSProcessInfo processInfo] operatingSystemVersion];
*major_version = version.majorVersion;
*minor_version = version.minorVersion;
*bugfix_version = version.patchVersion;
}
else
{
// This can only happen on 10.9
*major_version = 10;
*minor_version = 9;
*bugfix_version = 0;
}
#endif
}
} // namespace base
} // namespace angle
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment