switch every optimization from Os to O2
Also move 'disable optimizations' in the internal pascal file for debug mode.
--- a/CMakeLists.txt Mon Dec 30 18:29:23 2013 -0500
+++ b/CMakeLists.txt Tue Dec 31 00:32:55 2013 +0100
@@ -74,10 +74,10 @@
#set default compiler flags
add_flag_append(CMAKE_C_FLAGS "-Wall -pipe")
-add_flag_append(CMAKE_C_FLAGS_RELEASE "-Os")
+add_flag_append(CMAKE_C_FLAGS_RELEASE "-O2")
add_flag_append(CMAKE_C_FLAGS_DEBUG "-Wextra -O0")
add_flag_append(CMAKE_CXX_FLAGS "-Wall -pipe")
-add_flag_append(CMAKE_CXX_FLAGS_RELEASE "-Os")
+add_flag_append(CMAKE_CXX_FLAGS_RELEASE "-O2")
add_flag_append(CMAKE_CXX_FLAGS_DEBUG "-Wextra -O0")
#CMake adds a lot of additional configuration flags, so let's clear them up
--- a/cmake_modules/CMakePascalInformation.cmake Mon Dec 30 18:29:23 2013 -0500
+++ b/cmake_modules/CMakePascalInformation.cmake Tue Dec 31 00:32:55 2013 +0100
@@ -9,7 +9,7 @@
include(Platform/${CMAKE_SYSTEM_NAME}-${CMAKE_BASE_NAME} OPTIONAL)
# This section should actually be in Platform/${CMAKE_SYSTME_NAME}-fpc.cmake
-set(CMAKE_Pascal_FLAGS_DEBUG_INIT "-g -gl -gp -gh")
+set(CMAKE_Pascal_FLAGS_DEBUG_INIT "-O- -g -gl -gp -gh")
set(CMAKE_Pascal_FLAGS_MINSIZEREL_INIT "-Os -dNDEBUG")
set(CMAKE_Pascal_FLAGS_RELEASE_INIT "-O2 -dNDEBUG")
set(CMAKE_Pascal_FLAGS_RELWITHDEBINFO_INIT "-O2 -g -gl -gp")
--- a/hedgewars/CMakeLists.txt Mon Dec 30 18:29:23 2013 -0500
+++ b/hedgewars/CMakeLists.txt Tue Dec 31 00:32:55 2013 +0100
@@ -9,8 +9,8 @@
enable_language(Pascal)
add_flag_append(CMAKE_Pascal_FLAGS "-Cs2000000")
-add_flag_append(CMAKE_Pascal_FLAGS_DEBUG "-O- -gv")
-add_flag_append(CMAKE_Pascal_FLAGS_RELEASE "-Os -Xs")
+add_flag_append(CMAKE_Pascal_FLAGS_DEBUG "-gv")
+add_flag_append(CMAKE_Pascal_FLAGS_RELEASE "-Xs")
configure_file(${CMAKE_CURRENT_SOURCE_DIR}/config.inc.in ${CMAKE_CURRENT_BINARY_DIR}/config.inc)
include_directories(${CMAKE_CURRENT_BINARY_DIR})