-
-
Notifications
You must be signed in to change notification settings - Fork 171
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
Update build docs for windows #528
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
left some comments, looks good otherwise.
- cmake doesn't need the configuration int the `-B` step since it creates | ||
all the `*.vcxproj` files at once. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What do you mean by that? The -B
flag specifies the output directory of the VC project, otherwise it would just clutter the working directory.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sorry, that was unclear. You don't need the -DCMAKE_BUILD_TYPE=RelWithDebInfo
setting there, although it is harmless. All the configurations are embedded in the resulting .vcxproj files.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You do not need it in case of MSVS generator or other multi-configuration projects, but you can use -G Ninja
for example. In case of Ninja or Make you should specify build type.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Right you are. So it may well be left in place though. It is harmless enough :)
- for `cmake --build`, **do no** specify `--parallel`, but **do** specify your | ||
`--config RelWithDebInfo` or whichever configuration is appropriate. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Its unfortunate that --parallel
is just ignored on Windows. I found that you actually need to set a cflag to have parallel compilation like so:
Lines 138 to 141 in 06d4360
if sys.platform == "win32": | |
# MP = object level parallelism, WX = warnings as errors | |
cpus = os.cpu_count() | |
cflags.append("/WX /MP{}".format(cpus)) |
Though I’m not really sure if there might be a better way here. Documentation is quite bad :-(
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Right but the point I was trying to make was that if you do add --parallel, then the build step will only create the Debug
configuration and ignores --config
. Took me half an hour of experimentation last night to figure out what was going on. If you leave out the --parallel
flag, then it will build whatever configuration you specify with --config
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ohhh, I think in that case it might be a different manifestation of #512, which means that cmakes option parsing is broken
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
could be. Don't know what the best solution is. Only that I am not an avid cmake user myself and always struggle a bit when using it. Wanted to help save people from the problems I had :)
``` | ||
|
||
In addition to the optional `winhttp.lib`, windows builds require linking | ||
with `version.lib` and `dbghelp.lib` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Right, but it probably ought to be pointed out to users of the sentry.lib
library, who otherwise need to hunt through their linker errors to figure out which windows libraries to include. It is already mentioned that winhttp.lib
is a dependency but the others aren't mentioned.
So, what do we do with this? Looking at Readme.md, it looks to me as it comes from some external editor. This PR was not really meant for direct pulling, rather as a suggestion for updates. |
Its just how my vscode (or actually prettier) autoformatted that, so no problem. I can also just copy-paste this in. |
Right, but you probably do want to edit it for style. So feel free to just
grab whatever from it and close the PR :)
þri., 27. apr. 2021 kl. 09:02 skrifaði Arpad Borsos <
***@***.***>:
… Its just how my vscode (or actually prettier) autoformatted that, so no
problem. I can also just copy-paste this in.
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
<#528 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/ABN3FRYHZYM7CXZT3SVF5QLTKZ4SVANCNFSM43OHVCAA>
.
|
The raised topics in this PR concerning the CMake config/build parameters when using the MSBuild generator are all valid points. But I think we covered them in the docs a while back by providing more contrasting build examples: https://docs.sentry.io/platforms/native/#install |
Some windows build tips gathered by trial and error.
Probably needs formatting and entering to whatever source editor was used to create the Readme :)