-
-
Notifications
You must be signed in to change notification settings - Fork 1.7k
Fixed CmdLine Windows Build with command-line (not in VisualStudio but in VSCode) #12761
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: develop
Are you sure you want to change the base?
Conversation
…de) to be able to compile and run tests
|
You shouldn't need to do all this, that is built in CMake capability. I believe you have an error in that you should not be setting CMAKE_SYSTEM_VERSION to the WinSDK version, instead directly set Also, usually using the Ninja generator |
|
Thanks for the prompt reaction. Indeed, this is not needed:
It is done by a CI robot ... so it is added each time ... that is why I included it because it is more precise for steps to reproduce and what has happened in case it cannot be reproduced. I am almost sure (and expected) that it is irrelevant for the case. Indeed, I just tried and removed the above The root-cause is that the standard build in Visual Studio (Community/?Pro?/Enterprise) uses hidden dependencies (ENV variables and setup) which is not there when using a bare command-line - not a Visual Studio Community commanded-line. Hidden dependencies are not good - right? ... So, the commit/PR that I suggest, makes the dependency explicit (instead of hidden) that is all. |
|
Ahhh so you aren't running this in a vs devcmd environment? You need to do that instead of hacking in cmake. See our release tool for example: Line 295 in 967dc59
|
:-) Besides, having hidden dependencies is really not good ... Only an opinion: |
|
You can build in MinGW as well. Unfortunately, to gain advantage of the windows SDK you basically need to incorporate visual studio somewhere. I think your PR is fine. I will do some testing to make sure it doesn't regress anything. |
==> sounds like the right way. In case it helpsIn case it helps, here are the unit-tests results runs (on 1.Windows, 2.Linux "latest" and 3.Linux 24.04 (I believe both Linux builds are currently on Ubuntu 24.04), 4.MacOS "latest" and 5.MacOS-13 (old intel x86 silicon)):
The detailed run can be seen in the build log as well as in downloads. the unit-test runs are always in
|


Autotype-tests (not the keepassxc.exe application itself) could not link any more for Windows after a recent update.
Steps to reproduce (On Windows > 10):
See command here
Expected result is: that the build, which includes build of tests succeeds.
Actual result is: several error messages that the linker cannot find
WindowsHelloneeded forkeepassxc-autotype-windows. See detailed build herean excerpt from the error messages is included:
This should not happen if one is using Visual Studio (including Visual Studio in a commandline).
It happens, though, if one uses pure CMake/MSBuild.
This very PR resolves this issue. Proof: a build with this PR Commit is here.
Note:
When I write "resolves the issue" I mean that now it can be built and run on Windowa. That is build and run the "
testautotype" test on Windows. Unfortunately, the test itself does not pass on Windows (passes on Linux and on MacOS), but it has been failing in Windows since long time, afaik (will see it in the PR-auto-ci-build). So, this is a separate problem (if at all) for solving.