node-gyp icon indicating copy to clipboard operation
node-gyp copied to clipboard

[Feature Request] Make it possible to explicitly specify the version of Windows SDK to be used for the build

Open seo-rii opened this issue 2 years ago • 0 comments

Verbose output (from npm or node-gyp):
gyp info it worked if it ends with ok
gyp info using [email protected]
gyp info using [email protected] | win32 | x64
gyp info find Python using Python version 3.8.10 found at "C:\Program Files\Python38\python.exe"
gyp info find VS using VS2019 (16.11.31605.320) found at:
gyp info find VS "C:\Program Files (x86)\Microsoft Visual Studio\2019\Community"
gyp info find VS run with --verbose for detailed information
gyp info spawn C:\Program Files\Python38\python.exe
gyp info spawn args [
gyp info spawn args   'C:\\Coding\\electron-acrylic-window\\node_modules\\node-gyp\\gyp\\gyp_main.py',
gyp info spawn args   'binding.gyp',
gyp info spawn args   '-f',
gyp info spawn args   'msvs',
gyp info spawn args   '-I',
gyp info spawn args   'C:\\Coding\\electron-acrylic-window\\build\\config.gypi',
gyp info spawn args   '-I',
gyp info spawn args   'C:\\Coding\\electron-acrylic-window\\node_modules\\node-gyp\\addon.gypi',
gyp info spawn args   '-I',
gyp info spawn args   'C:\\Users\\SeoHyun\\AppData\\Local\\node-gyp\\Cache\\14.17.3\\include\\node\\common.gypi',
gyp info spawn args   '-Dlibrary=shared_library',
gyp info spawn args   '-Dvisibility=default',
gyp info spawn args   '-Dnode_root_dir=C:\\Users\\SeoHyun\\AppData\\Local\\node-gyp\\Cache\\14.17.3',
gyp info spawn args   '-Dnode_gyp_dir=C:\\Coding\\electron-acrylic-window\\node_modules\\node-gyp',
gyp info spawn args   '-Dnode_lib_file=C:\\\\Users\\\\SeoHyun\\\\AppData\\\\Local\\\\node-gyp\\\\Cache\\\\14.17.3\\\\<(target_arch)\\\\node.lib',
gyp info spawn args   '-Dmodule_root_dir=C:\\Coding\\electron-acrylic-window',
gyp info spawn args   '-Dnode_engine=v8',
gyp info spawn args   '--depth=.',
gyp info spawn args   '--no-parallel',
gyp info spawn args   '--generator-output',
gyp info spawn args   'C:\\Coding\\electron-acrylic-window\\build',
gyp info spawn args   '-Goutput_dir=.'
gyp info spawn args ]
gyp info spawn C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\MSBuild\Current\Bin\MSBuild.exe
gyp info spawn args [
gyp info spawn args   'build/binding.sln',
gyp info spawn args   '/clp:Verbosity=minimal',
gyp info spawn args   '/nologo',
gyp info spawn args   '/p:Configuration=Release;Platform=x64'
gyp info spawn args ]
이 솔루션의 프로젝트를 한 번에 하나씩 빌드합니다. 병렬 빌드를 사용하려면 "-m" 스위치를 추가하세요.
  win10.cpp
C:\Coding\electron-acrylic-window\src\native\win10.cpp(38,9): warning C4530: C++ 예외 처리기가 사용되었지만 해제 의미 체계가 활성화되지 않았습니다. /EHsc를 지정하십시오. [C:\Coding\electron-acrylic-window\build\vibrancy-wrapper.vcxproj]
C:\Coding\electron-acrylic-window\src\native\win10.cpp(60,37): error C2065: 'DWMWA_USE_HOSTBACKDROPBRUSH': 선언되지 않은 식별자입니다. [C:\Coding\electron-acrylic-window\build\vibrancy-wrapper.vcxproj]
gyp ERR! build error 
gyp ERR! stack Error: `C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\MSBuild\Current\Bin\MSBuild.exe` failed with exit code: 1
gyp ERR! stack     at ChildProcess.onExit (C:\Coding\electron-acrylic-window\node_modules\node-gyp\lib\build.js:194:23)
gyp ERR! stack     at ChildProcess.emit (events.js:375:28)
gyp ERR! stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:277:12)
gyp ERR! System Windows_NT 10.0.22000
gyp ERR! command "C:\\Program Files\\nodejs\\node.exe" "C:\\Coding\\electron-acrylic-window\\node_modules\\node-gyp\\bin\\node-gyp.js" "rebuild"
gyp ERR! cwd C:\Coding\electron-acrylic-window
gyp ERR! node -v v14.17.3
gyp ERR! node-gyp -v v8.2.0
gyp ERR! not ok
error Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.

I recently developed and had to use the DWMWA_USE_HOSTBACKDROPBRUSH function. Related explanation However, this feature is currently supported only by Windows 11 Insider sdk and failed due to an error in the build. I tried to resolve the error and found out that simply changing the WindowsTargetPlatformVersion field of the vcxproj file created during the build to 10.0.220.0 which is the Insider SDK version. However, if you proceed with the construction in this way, there is a problem that other computers cannot build the same. Is it possible to forcefully specify the version of window sdk to be used for node-gyp's options?

seo-rii avatar Sep 18 '21 09:09 seo-rii