From e60353cd6868da3f51609c0c7981f98a9f863a3f Mon Sep 17 00:00:00 2001 From: Munyiri Kamau Date: Thu, 10 Nov 2016 14:29:47 -0800 Subject: [PATCH] Support building for Windows UWP/WINRT applications node_uwp_dll switch indicates that [Node.js UWP](https://github.com/ms-iot/ntvsiot) is the platform target. SQLite already has the [changes](https://msdn.microsoft.com/en-us/windows/uwp/data-access/sqlite-databases) to enable it to work in UWP apps. The only change required for node-sqlite is updating the SQLite gyp file. --- deps/sqlite3.gyp | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/deps/sqlite3.gyp b/deps/sqlite3.gyp index 80d0632b1..be5f4caa0 100755 --- a/deps/sqlite3.gyp +++ b/deps/sqlite3.gyp @@ -1,5 +1,8 @@ { 'includes': [ 'common-sqlite.gypi' ], + 'variables': { + 'node_uwp_dll%': 'false', + }, 'target_defaults': { 'default_configuration': 'Release', 'cflags':[ @@ -101,6 +104,25 @@ ], 'export_dependent_settings': [ 'action_before_build', + ], + 'conditions': [ + ['OS == "win"', { + 'conditions': [ + ['node_uwp_dll=="true"', + { + 'defines': [ + 'SQLITE_OS_WINRT', + 'SQLITE_API=__declspec(dllexport)' + ], + 'msvs_settings': { + 'VCCLCompilerTool': { + 'CompileAsWinRT': 'false' + }, + }, + } + ], + ] + }] ] } ]