Repository navigation
[cmake] always target Windows SDK v10.x when using Visual Studio generators (fixes #6448) - #6451
Conversation
|
@jameslamb Thanks for looking into this. Some questions:
|
Good question! My understanding is that v10 of the SDK supports Windows 11 and most versions of Windows Server. See "Supported Operating Systems" here: https://developer.microsoft.com/en-us/windows/downloads/windows-sdk/. For example, the R-package MSVC tests here are targeting Windows Server 2019 and Windows 2022. https://github.com/actions/runner-images?tab=readme-ov-file#available-images
Not 100% sure (Windows-specific development is not something I have a lot of experience in), but I think that winsock2, for example, comes through the Windows SDK. https://learn.microsoft.com/en-us/windows/win32/winsock/creating-a-basic-winsock-application If you see some other alternative to simplify LightGBM's Windows builds here I'd welcome it. |
|
It compiles correctly with msvc after this PR, but with some caveats: if compiling for a second time, it hangs indefinitely without issuing any message (just stuck in |
Oh interesting, I haven't seen that before. I'm not sure what the cause of that might be. You can skip building the vignettes (and therefore compiling the library twice) by passing Rscript build_r.R --no-build-vignettesWe have vignette-building on by default so that the package tarball that's produced is suitable to pass to |
|
@guolinke or @shiyu1994 could you help with a review of this? |
|
This pull request has been automatically locked since there has not been any recent activity since it was closed. |
Fixes #6448
Related to #5884.
Helps with #6213.
Proposes always targeting v10.x of the Windows SDK in CMake builds using the Visual Studio generators.
Notes for Reviewers
How I tested this
Building the R package, using Visual Studio 17 2022, on my Windows laptop running Windows 10 Home Edition.
With rtools44 (https://cran.r-project.org/bin/windows/Rtools/rtools44/rtools.html) on PATH.
Without this change,
CMaketargets via 8.1 of the Windows SDK and detects the wrong Windows version.That causes all of the Visual Studio and then the MSBuild solutions to fail, and therefore installation of the R package to fail.
With this change, it correctly targets v10 of the Windows SDK.
References