Generate a compile error if release is built without compiler optimizations
authorclopez@igalia.com <clopez@igalia.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 4 Oct 2017 12:08:55 +0000 (12:08 +0000)
committerclopez@igalia.com <clopez@igalia.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 4 Oct 2017 12:08:55 +0000 (12:08 +0000)
commit8a0c3efdfd17eb074fc7d223d8e3a4edfa14198a
tree705adacfb95e7afb6c3f750fb02989a003b6d6d7
parentb46727b4d34fb77be2ac0652b0697ab4160949de
Generate a compile error if release is built without compiler optimizations
https://bugs.webkit.org/show_bug.cgi?id=177665

Reviewed by Michael Catanzaro.

.:

Default to RelWithDebInfo if CMAKE_BUILD_TYPE is unset.

* CMakeLists.txt:

Source/JavaScriptCore:

Pass -DRELEASE_WITHOUT_OPTIMIZATIONS to testair.cpp and testb3.cpp because
this files are compiled with -O0 for build speed reasons after r195639.

* JavaScriptCore.xcodeproj/project.pbxproj:

Source/WTF:

For GCC and Clang, generate an error at build time that will alert
the developer that she is trying to build Release without any compiler
optimization. A build time error is much better than an unexpected
"oh, WebKit is really slow ..."  situation later.

If this was intended, then we tell the developer that she can continue
by just setting -DRELEASE_WITHOUT_OPTIMIZATIONS in the list of build
flags.

The intention of this patch is to ensure that nobody builds Release
without enabling compiler optimization by mistake.

* wtf/Compiler.h:

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@222840 268f45cc-cd09-0410-ab3c-d52691b4dbfc
CMakeLists.txt
ChangeLog
Source/JavaScriptCore/ChangeLog
Source/JavaScriptCore/JavaScriptCore.xcodeproj/project.pbxproj
Source/WTF/ChangeLog
Source/WTF/wtf/Compiler.h