Cuberite Forum
Transition to cmake on Windows - Printable Version

+- Cuberite Forum (https://forum.cuberite.org)
+-- Forum: Cuberite (https://forum.cuberite.org/forum-4.html)
+--- Forum: Development (https://forum.cuberite.org/forum-13.html)
+--- Thread: Transition to cmake on Windows (/thread-1312.html)

Pages: 1 2 3 4 5


RE: Transition to cmake on Windows - tigerw - 01-16-2014

What about the optimisation and executable locations in my post above?


RE: Transition to cmake on Windows - xoft - 01-16-2014

The optimization settings are somewhat misleading in the UI - they are present on the commandline, but the UI doesn't show them. I was confused by this, too, when I set up the LTCG and it didn't show in the UI.

The executable is output to the correct folder for me in VC2008, can you re-check with the latest version?
Note that the actual executable output path is $/MCServer/Debug/../MCServer_debug.exe, due to some limitations, but that does put the executable in the $/MCServer folder.


RE: Transition to cmake on Windows - tigerw - 01-16-2014

Code:
/Yu"Globals.h" /MP /GS /TP /GL /analyze- /W3 /Zc:wchar_t /I"C:/Users/Tiger/Documents/GitHub/MCServer/src/../lib" /I"C:/Users/Tiger/Documents/GitHub/MCServer/src/../lib/jsoncpp/include" /I"C:/Users/Tiger/Documents/GitHub/MCServer/src" /Gm- /*!!!!!*//O2 /Ob2 /Fd"MCServer.dir\Release\vc120.pdb" /fp:precise /D "WIN32" /D "_WINDOWS" /D "NDEBUG" /D "LUA_BUILD_AS_DLL" /D "XML_STATIC" /D "CMAKE_INTDIR=\"Release\"" /D "_MBCS" /errorReport:prompt /WX- /Zc:forScope /GR /Gd /Oy- /MT /Fa"Release/" /EHsc /nologo /Fo"MCServer.dir\Release\" /Fp"MCServer.dir\Release\MCServer.pch"

It says /o2 in the commandline as well, and MCServer still is built in MCServer/Debug. This is a new clone.


RE: Transition to cmake on Windows - xoft - 01-16-2014

What's wrong with /O2? Even MS says to use it instead of /Ox:
http://msdn.microsoft.com/en-us/library/59a3b321%28v=vs.120%29.aspx

I'll have a look at the output, must be something wrong in the CMake generator for VS2013.


RE: Transition to cmake on Windows - xoft - 01-16-2014

Seems like a bug in CMake, I have filed a bug report: http://public.kitware.com/Bug/view.php?id=14702

So I guess we're stuck with the VC2013 folder for a while longer, and VC2008 can go.


RE: Transition to cmake on Windows - tigerw - 01-17-2014

The bug report was responded to.

But without /ox, MCS will be marginally slower and larger on Windows! http://stackoverflow.com/questions/5063334/what-is-the-difference-between-the-ox-and-o2-compiler-options


RE: Transition to cmake on Windows - xoft - 01-17-2014

I've fixed the cmake file according to the solution they provided, now it generates correctly in my VS2010, so it should work for VS2013, too.

But even your link says /O2 is better than /Ox...


RE: Transition to cmake on Windows - tigerw - 01-17-2014

Quote:Ox and O2 are almost identical. They differ only in the fact that O2 also throws GF and Gy. There is almost no reason to avoid throwing these two switches.

/GF is great - it pools all identical string literals in a read-only memory region. So if you have some literal in multiple areas of code you'll only have it once in the executable which reduces the image size. And if your code attempts to modify it you'll get Access Violation which protects you against dumb errors.



RE: Transition to cmake on Windows - bearbin - 01-17-2014

It says that o2 is better?


RE: Transition to cmake on Windows - xoft - 01-17-2014

My English skills are a bit rusty, I don't know if "throwing" a switch means turning it on or offTongue I expect it to mean turning on, which means that /O2 is actually better than /Ox, according to that text.