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") { ...@@ -276,6 +276,7 @@ static_library("angle_gpu_info_util") {
libs += [ libs += [
"IOKit.framework", "IOKit.framework",
"CoreFoundation.framework", "CoreFoundation.framework",
"CoreGraphics.framework",
] ]
} }
} }
......
...@@ -384,6 +384,11 @@ if (build_angle_deqp_tests) { ...@@ -384,6 +384,11 @@ if (build_angle_deqp_tests) {
public_configs = [ ":angle_deqp_gtest_support_config" ] public_configs = [ ":angle_deqp_gtest_support_config" ]
sources = deqp_gypi.deqp_gpu_test_expectations_sources 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) { if (build_with_chromium) {
sources += [ "//gpu/angle_deqp_tests_main.cc" ] sources += [ "//gpu/angle_deqp_tests_main.cc" ]
} else { } else {
......
...@@ -1198,6 +1198,11 @@ ...@@ -1198,6 +1198,11 @@
'third_party/gpu_test_expectations/gpu_test_expectations_parser.cc', 'third_party/gpu_test_expectations/gpu_test_expectations_parser.cc',
'third_party/gpu_test_expectations/gpu_test_expectations_parser.h', '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': 'conditions':
[ [
['(OS=="win" or OS=="linux" or OS=="mac")', ['(OS=="win" or OS=="linux" or OS=="mac")',
...@@ -1857,8 +1862,7 @@ ...@@ -1857,8 +1862,7 @@
{ {
'sources': 'sources':
[ [
'third_party/gpu_test_expectations/gpu_test_config_mac.h', '<@(deqp_gpu_test_expectations_sources_mac)',
'third_party/gpu_test_expectations/gpu_test_config_mac.mm',
], ],
}], }],
], ],
......
...@@ -78,8 +78,7 @@ GPUTestConfig::OS GetCurrentOS() { ...@@ -78,8 +78,7 @@ GPUTestConfig::OS GetCurrentOS() {
int32_t major_version = 0; int32_t major_version = 0;
int32_t minor_version = 0; int32_t minor_version = 0;
int32_t bugfix_version = 0; int32_t bugfix_version = 0;
base::SysInfo::OperatingSystemVersionNumbers( angle::GetOperatingSystemVersionNumbers(&major_version, &minor_version, &bugfix_version);
&major_version, &minor_version, &bugfix_version);
if (major_version == 10) { if (major_version == 10) {
switch (minor_version) { switch (minor_version) {
case 5: case 5:
......
...@@ -12,16 +12,13 @@ ...@@ -12,16 +12,13 @@
#include "gpu_info.h" #include "gpu_info.h"
namespace base { namespace angle
class SysInfo
{ {
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_ #endif // ANGLE_GPU_TEST_EXPECTATIONS_GPU_TEST_CONFIG_MAC_H_
...@@ -9,8 +9,6 @@ ...@@ -9,8 +9,6 @@
#import <Cocoa/Cocoa.h> #import <Cocoa/Cocoa.h>
namespace base {
// OSX 10.8 deprecates Gestalt but doesn't make the operatingSystemVersion property part of the // 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. // 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 #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 { ...@@ -19,20 +17,33 @@ namespace base {
@end @end
#endif #endif
void SysInfo::OperatingSystemVersionNumbers(int32_t *major_version, namespace angle
int32_t *minor_version, {
int32_t *bugfix_version)
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 #if MAC_OS_X_VERSION_MIN_REQUIRED < MAC_OS_X_VERSION_10_8
Gestalt(gestaltSystemVersionMajor, reinterpret_cast<SInt32*>(major_version)); Gestalt(gestaltSystemVersionMajor, reinterpret_cast<SInt32 *>(major_version));
Gestalt(gestaltSystemVersionMinor, reinterpret_cast<SInt32*>(minor_version)); Gestalt(gestaltSystemVersionMinor, reinterpret_cast<SInt32 *>(minor_version));
Gestalt(gestaltSystemVersionBugFix, reinterpret_cast<SInt32*>(bugfix_version)); Gestalt(gestaltSystemVersionBugFix, reinterpret_cast<SInt32 *>(bugfix_version));
#else #else
NSOperatingSystemVersion version = [[NSProcessInfo processInfo] operatingSystemVersion]; if (@available(macOS 10.10, *))
*major_version = version.majorVersion; {
*minor_version = version.minorVersion; NSOperatingSystemVersion version = [[NSProcessInfo processInfo] operatingSystemVersion];
*bugfix_version = version.patchVersion; *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 #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