Closed ayberkozgur closed 9 years ago
Not that I know of. Doesn't it happen in the release build ? I remember having to actually disable it for emscripten to be happy.
Does it improve anything ?
Is it standard, or will it happen within some kind of if (gcc || clang)
?
Speciall offer today: ask one question, get 3 back ;)
Oh, cmake actually puts -O3
by itself in Release
, I didn't know that :)
But, there is this issue: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=640214
So in the future, this might be subject to change. Disregard that, completely unrelated.
What is your opinion, should we force -O3
in the Release build ourselves?
No... in my opinion, we should start with existing problems before addressing the possible ones ;) In this spirit, I'd rather set the warning level to the maximum (e.g. -Wall, -Wpedantic, -Weffective etc), but I don't think CMakes knows how to do that indepedently from the compiler...
It's not up to us to decide which flags to use, but to the package maintainer or the user.
CMake provides reasonable default with Release
, Debug
, RelWithDebInfo
.
Closing this issue.
The opposite makes more sense to me if you have good reasons. An example is OpenCV that has a long list of compile and link flags for Android (some even independent of the architecture) that are there by default. Admittedly, -O3
is not one of them and is left to the build type.
Is there a reason why we are not compiling with
-O3
right now?