Documentation: COMPILING.md does not describe how to make a non-debug build on non-Windows #8465
Version of OpenTTD
COMPILING.md should describe how to use CMake to produce a build which is suitable for normal users (i.e. not a slow debug build), on non-Windows platforms.
The suggested set of commands is:
mkdir build cd build cmake .. make
which produces an unplayably slow binary.
There is no mention of CMAKE_BUILD_TYPE or equivalent mechanisms anywhere in the file (or on the wiki).
Steps to reproduce
The text was updated successfully, but these errors were encountered:
What is always a bit difficult for me with tickets like this: this describes a solution, but it gives me very little information about the problem itself.
The audience for
I can think of various of reasons, but you made this ticket not without reason; so before I fill in all kinds of blanks, it might be better to just ask you: what triggered you to make this ticket? What is this group of normal users that compile and expect a non-debug build? (I have some ideas of my own, but I rather have you tell me your side first :) ).
If I understand a bit more what problem we are trying to solve here, there might be better solutions then to just extend
Having reference material on how to compile a project that makes no mention of how to make a normal build seems to me like a significant omission. I primarily created this issue because I read through the documentation and was surprised that I could not find this mentioned anywhere.
Personally, I find the idea of producing unoptimised debug builds by default to be very strange, but I am aware that that is how it is usually done in the CMake ecosystem.
For what its worth I all do all of my testing and debugging on builds with optimisations enabled and in my branch the default configuration enabled optimisations, so this does not affect me personally in that sense.
If the omission is intentional I've got no objection to the issue being closed.
Ah :) Tnx for the clarification :D
I looked around how other CMake projects do it, and exactly what you say: this is the default for CMake projects, and our default has always been to produce debug builds. Release builds have their own problem .. for my Ubuntu version for example it takes ~60 seconds to link the final binaries, which is not really useful when developing ;) I guess this is a matter of taste, more than anything else :)
I will ask what other devs think about this; personally I am fine by following what CMake defined; going against the stream also has its problems.
Tnx again for the clarification, much appreciated!
I went for the middle-ground here: we now link to the CMake usage tutorial, which (if you CTRL+F) mentions how to make a Release. This is a bit the balance between being verbose about it and still showing how it should be done. Hopefully you agree that it is a nice in-between solution :)