Skip to content
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

CMake: minor Windows fixes #9668

Merged
merged 8 commits into from May 14, 2021
Merged

Conversation

leoetlino
Copy link
Member

@leoetlino leoetlino commented Apr 24, 2021

Two five Several small commits to fix CMake on Windows builds.

@leoetlino leoetlino marked this pull request as draft April 24, 2021 22:01
@leoetlino leoetlino marked this pull request as ready for review April 24, 2021 22:10
@leoetlino leoetlino marked this pull request as draft April 25, 2021 17:45
@leoetlino leoetlino force-pushed the windows-cmake-fixes branch 3 times, most recently from 3b7773a to caa3170 Compare April 25, 2021 23:35
@leoetlino leoetlino marked this pull request as ready for review April 25, 2021 23:41
@shuffle2
Copy link
Contributor

shuffle2 commented Apr 27, 2021

LTO is supposed to be enabled by default for VS Release builds
according to the VS prop files but a build log from JMC reveals
that /GL and /LTCG are not actually passed to cl.exe/link.exe
for some reason...

It should be enabled by default (the codegen really is quite better). But it's disabled (hidden behind DolphinRelease flag) because...:

LTO also leads to extremely and unacceptably slow build times
when using link.exe, so let's disable it by default to actually
match the project files.

(this is why). If the buildbot had more resources it may be a different story. The current buildbot setup is really sadly inefficient.

The idea was that we would compile with ltcg (and maybe do PGO, but that is more effort than just passing a flag) for "actual releases". But dolphin doesn't really release much, so...

@shuffle2
Copy link
Contributor

btw, if you want to compare args being passed to msvc tools, the easiest way is probably just something like msbuild -v:n (msbuild -v:n -m -p:Platform=<ARM64|x64>,Configuration=<Release|Debug> <the vxcproj or sln>). You can also specify -t:Rebuild

CMakeLists.txt Outdated Show resolved Hide resolved
CMAKE_RUNTIME_OUTPUT_DIRECTORY_<mode> overrode CMAKE_RUNTIME_OUTPUT_DIRECTORY.

It's just unnecessary and it broke UnitTests's custom output directory
* no-system-d3d-compiler: d3dcompiler_47.dll
* no-angle, no-opengl-sw: libEGL.dll, libGLESv2.dll
Avoids the need to copy the *.mo files manually *and* more importantly
this ensures that the mo files are always recreated if the build
output directory is cleared.
See https://gitlab.kitware.com/cmake/cmake/-/issues/20812

Manually redefine MSVC flags to match Visual Studio defaults
and ensure that Release builds generate debug info.
LTO is supposed to be enabled by default for VS Release builds
according to the VS prop files but a build log from JMC reveals
that /GL and /LTCG are not actually passed to cl.exe/link.exe
for some reason...

LTO also leads to *extremely* and unacceptably slow build times
when using link.exe, so let's disable it by default to actually
match the project files.
@JMC47 JMC47 merged commit 16e9117 into dolphin-emu:master May 14, 2021
10 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
3 participants