summaryrefslogtreecommitdiff
path: root/deps/gyp/test/win/enable-winrt
diff options
context:
space:
mode:
authorMike Morris <michael.patrick.morris@gmail.com>2015-12-04 13:29:51 -0500
committerMike Morris <michael.patrick.morris@gmail.com>2015-12-07 15:48:34 -0800
commitd467ae6e7867044b8d7b466776fb37089292c52b (patch)
tree730ee0656e6bf9f0dff33346f07acd800e83ab25 /deps/gyp/test/win/enable-winrt
parent59ef8da69549cf6308078c6f656affba96e9439e (diff)
downloadqtlocation-mapboxgl-d467ae6e7867044b8d7b466776fb37089292c52b.tar.gz
[core] upgrade gyp to git commit 6fb8bd8
https://chromium.googlesource.com/external/gyp/+/6fb8bd829f0ca8fd432fd85ede788b6881c4f09f
Diffstat (limited to 'deps/gyp/test/win/enable-winrt')
-rw-r--r--deps/gyp/test/win/enable-winrt/dllmain.cc30
-rw-r--r--deps/gyp/test/win/enable-winrt/enable-winrt.gyp39
2 files changed, 69 insertions, 0 deletions
diff --git a/deps/gyp/test/win/enable-winrt/dllmain.cc b/deps/gyp/test/win/enable-winrt/dllmain.cc
new file mode 100644
index 0000000000..dedd83c3f6
--- /dev/null
+++ b/deps/gyp/test/win/enable-winrt/dllmain.cc
@@ -0,0 +1,30 @@
+// Copyright (c) 2013 Google Inc. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#include <windows.h>
+#include <wrl.h>
+#include <wrl/wrappers/corewrappers.h>
+#include <windows.graphics.display.h>
+
+using namespace Microsoft::WRL;
+using namespace Microsoft::WRL::Wrappers;
+using namespace ABI::Windows::Foundation;
+using namespace ABI::Windows::Graphics::Display;
+
+bool TryToUseSomeWinRT() {
+ ComPtr<IDisplayPropertiesStatics> dp;
+ HStringReference s(RuntimeClass_Windows_Graphics_Display_DisplayProperties);
+ HRESULT hr = GetActivationFactory(s.Get(), dp.GetAddressOf());
+ if (SUCCEEDED(hr)) {
+ float dpi = 96.0f;
+ if (SUCCEEDED(dp->get_LogicalDpi(&dpi))) {
+ return true;
+ }
+ }
+ return false;
+}
+
+BOOL WINAPI DllMain(HINSTANCE hinstance, DWORD reason, LPVOID reserved) {
+ return TRUE;
+}
diff --git a/deps/gyp/test/win/enable-winrt/enable-winrt.gyp b/deps/gyp/test/win/enable-winrt/enable-winrt.gyp
new file mode 100644
index 0000000000..69f70189db
--- /dev/null
+++ b/deps/gyp/test/win/enable-winrt/enable-winrt.gyp
@@ -0,0 +1,39 @@
+# Copyright (c) 2013 Google Inc. All rights reserved.
+# Use of this source code is governed by a BSD-style license that can be
+# found in the LICENSE file.
+
+{
+ 'targets': [
+ {
+ 'target_name': 'enable_winrt_dll',
+ 'type': 'shared_library',
+ 'msvs_enable_winrt': 1,
+ 'sources': [
+ 'dllmain.cc',
+ ],
+ },
+ {
+ 'target_name': 'enable_winrt_missing_dll',
+ 'type': 'shared_library',
+ 'sources': [
+ 'dllmain.cc',
+ ],
+ },
+ {
+ 'target_name': 'enable_winrt_winphone_dll',
+ 'type': 'shared_library',
+ 'msvs_enable_winrt': 1,
+ 'msvs_enable_winphone': 1,
+ 'sources': [
+ 'dllmain.cc',
+ ],
+ 'msvs_settings': {
+ 'VCLinkerTool': {
+ 'AdditionalDependencies': [
+ '%(AdditionalDependencies)',
+ ],
+ },
+ },
+ },
+ ]
+}