Author: dgorbachev
Date: Tue Jan 22 22:38:40 2013
New Revision: 58201
URL:
http://svn.reactos.org/svn/reactos?rev=58201&view=rev
Log:
[CMAKE]
- Improve help strings for GCC optimization levels.
- Add new -Ofast and -Og levels.
- Simplify gcc.cmake a bit.
- Use MINGW_TOOLCHAIN_SUFFIX.
Modified:
trunk/reactos/cmake/config-amd64.cmake
trunk/reactos/cmake/config-arm.cmake
trunk/reactos/cmake/config.cmake
trunk/reactos/cmake/gcc.cmake
Modified: trunk/reactos/cmake/config-amd64.cmake
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/cmake/config-amd64.cmake?r…
==============================================================================
--- trunk/reactos/cmake/config-amd64.cmake [iso-8859-1] (original)
+++ trunk/reactos/cmake/config-amd64.cmake [iso-8859-1] Tue Jan 22 22:38:40 2013
@@ -7,13 +7,15 @@
k8 opteron athlon64 athlon-fx")
set (OPTIMIZE "1" CACHE STRING
-"What level of optimisation to use.
- 0 = off
- 1 = Default option, optimize for size (-Os) with some additional options
- 2 = -Os
- 3 = -O1
- 4 = -O2
- 5 = -O3")
+"What level of optimization to use.
+ 0 = off
+ 1 = Default option, optimize for size (-Os) with some additional options
+ 2 = Optimize for size (-Os)
+ 3 = Optimize debugging experience (-Og)
+ 4 = Optimize (-O1)
+ 5 = Optimize even more (-O2)
+ 6 = Optimize yet more (-O3)
+ 7 = Disregard strict standards compliance (-Ofast)")
set(LTCG FALSE CACHE BOOL
"Whether to build with link-time code generation")
Modified: trunk/reactos/cmake/config-arm.cmake
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/cmake/config-arm.cmake?rev…
==============================================================================
--- trunk/reactos/cmake/config-arm.cmake [iso-8859-1] (original)
+++ trunk/reactos/cmake/config-arm.cmake [iso-8859-1] Tue Jan 22 22:38:40 2013
@@ -8,13 +8,15 @@
armv5te armv7-a")
set (OPTIMIZE "1" CACHE STRING
-"What level of optimisation to use.
- 0 = off
- 1 = Default option, optimize for size (-Os) with some additional options
- 2 = -Os
- 3 = -O1
- 4 = -O2
- 5 = -O3")
+"What level of optimization to use.
+ 0 = off
+ 1 = Default option, optimize for size (-Os) with some additional options
+ 2 = Optimize for size (-Os)
+ 3 = Optimize debugging experience (-Og)
+ 4 = Optimize (-O1)
+ 5 = Optimize even more (-O2)
+ 6 = Optimize yet more (-O3)
+ 7 = Disregard strict standards compliance (-Ofast)")
set(LTCG FALSE CACHE BOOL
"Whether to build with link-time code generation")
Modified: trunk/reactos/cmake/config.cmake
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/cmake/config.cmake?rev=582…
==============================================================================
--- trunk/reactos/cmake/config.cmake [iso-8859-1] (original)
+++ trunk/reactos/cmake/config.cmake [iso-8859-1] Tue Jan 22 22:38:40 2013
@@ -1,25 +1,25 @@
set(SARCH "pc" CACHE STRING
-"Sub-architecture to build for. Specify one of: xbox")
+"Sub-architecture to build for. Specify one of:
+ pc xbox")
set(OARCH "pentium" CACHE STRING
"Generate instructions for this CPU type. Specify one of:
- native, i386, i486, pentium, pentium-mmx, pentiumpro, i686,
- pentium2, pentium3, pentium-m, pentium4, prescott, nocona,
- core2, k6, k6-2, athlon, athlon-xp, opteron, opteron-sse3,
- barcelona, winchip-c6, winchip2, c3, c3-2, geode")
+ pentium, pentiumpro")
set(TUNE "i686" CACHE STRING
"Which CPU ReactOS should be optimized for.")
set(OPTIMIZE "1" CACHE STRING
-"What level of optimisation to use.
- 0 = off
- 1 = Default option, optimize for size (-Os) with some additional options
- 2 = -Os
- 3 = -O1
- 4 = -O2
- 5 = -O3")
+"What level of optimization to use.
+ 0 = off
+ 1 = Default option, optimize for size (-Os) with some additional options
+ 2 = Optimize for size (-Os)
+ 3 = Optimize debugging experience (-Og)
+ 4 = Optimize (-O1)
+ 5 = Optimize even more (-O2)
+ 6 = Optimize yet more (-O3)
+ 7 = Disregard strict standards compliance (-Ofast)")
set(LTCG FALSE CACHE BOOL
"Whether to build with link-time code generation")
Modified: trunk/reactos/cmake/gcc.cmake
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/cmake/gcc.cmake?rev=58201&…
==============================================================================
--- trunk/reactos/cmake/gcc.cmake [iso-8859-1] (original)
+++ trunk/reactos/cmake/gcc.cmake [iso-8859-1] Tue Jan 22 22:38:40 2013
@@ -10,7 +10,7 @@
endif()
# Compiler Core
-add_compile_flags("-pipe -fms-extensions")
+add_compile_flags("-pipe -fms-extensions -fno-strict-aliasing")
#bug
#file(TO_NATIVE_PATH ${REACTOS_SOURCE_DIR} REACTOS_SOURCE_DIR_NATIVE)
@@ -28,9 +28,6 @@
add_compile_flags("-gstabs+")
endif()
-# Do not allow warnings
-add_compile_flags("-Werror")
-
# For some reason, cmake sets -fPIC, and we don't want it
if(DEFINED CMAKE_SHARED_LIBRARY_ASM_FLAGS)
string(REPLACE "-fPIC" "" CMAKE_SHARED_LIBRARY_ASM_FLAGS
${CMAKE_SHARED_LIBRARY_ASM_FLAGS})
@@ -44,7 +41,7 @@
endif()
# Warnings
-add_compile_flags("-Wall -Wno-char-subscripts -Wpointer-arith -Wno-multichar
-Wno-unused-value")
+add_compile_flags("-Werror -Wall -Wno-char-subscripts -Wpointer-arith -Wno-multichar
-Wno-unused-value")
if(GCC_VERSION VERSION_LESS 4.6)
add_compile_flags("-Wno-error=uninitialized")
@@ -62,15 +59,19 @@
# Optimizations
if(OPTIMIZE STREQUAL "1")
- add_compile_flags("-Os")
+ add_compile_flags("-Os -ftracer")
elseif(OPTIMIZE STREQUAL "2")
add_compile_flags("-Os")
elseif(OPTIMIZE STREQUAL "3")
+ add_compile_flags("-O1 -fno-inline-functions-called-once -fno-tree-sra")
+elseif(OPTIMIZE STREQUAL "4")
add_compile_flags("-O1")
-elseif(OPTIMIZE STREQUAL "4")
+elseif(OPTIMIZE STREQUAL "5")
add_compile_flags("-O2")
-elseif(OPTIMIZE STREQUAL "5")
+elseif(OPTIMIZE STREQUAL "6")
add_compile_flags("-O3")
+elseif(OPTIMIZE STREQUAL "7")
+ add_compile_flags("-Ofast")
endif()
# Link-time code generation
@@ -78,25 +79,13 @@
add_compile_flags("-flto -Wno-error=clobbered")
endif()
-add_compile_flags("-fno-strict-aliasing")
-
if(ARCH STREQUAL "i386")
add_compile_flags("-mpreferred-stack-boundary=3 -fno-set-stack-executable
-fno-optimize-sibling-calls -fno-omit-frame-pointer")
- if(OPTIMIZE STREQUAL "1")
- add_compile_flags("-ftracer")
- if(NOT CMAKE_BUILD_TYPE STREQUAL "Debug")
- add_compile_flags("-momit-leaf-frame-pointer")
- endif()
+ if(NOT CMAKE_BUILD_TYPE STREQUAL "Debug")
+ add_compile_flags("-momit-leaf-frame-pointer")
endif()
elseif(ARCH STREQUAL "amd64")
add_compile_flags("-mpreferred-stack-boundary=4")
- if(OPTIMIZE STREQUAL "1")
- add_compile_flags("-ftracer")
- endif()
-elseif(ARCH STREQUAL "arm")
- if(OPTIMIZE STREQUAL "1")
- add_compile_flags("-ftracer")
- endif()
endif()
# Other
@@ -174,7 +163,7 @@
set(CMAKE_ASM_COMPILE_OBJECT "<CMAKE_ASM_COMPILER> -x assembler-with-cpp -o
<OBJECT> -I${REACTOS_SOURCE_DIR}/include/asm -I${REACTOS_BINARY_DIR}/include/asm
<FLAGS> <DEFINES> -D__ASM__ -c <SOURCE>")
set(CMAKE_RC_COMPILE_OBJECT "<CMAKE_RC_COMPILER> -O coff <FLAGS>
-DRC_INVOKED -D__WIN32__=1 -D__FLAT__=1 ${I18N_DEFS} <DEFINES> <SOURCE>
<OBJECT>")
-set(CMAKE_DEPFILE_FLAGS_RC "--preprocessor \"${MINGW_TOOLCHAIN_PREFIX}gcc -E
-xc-header -MMD -MF <DEPFILE> -MT <OBJECT>\" ")
+set(CMAKE_DEPFILE_FLAGS_RC "--preprocessor
\"${MINGW_TOOLCHAIN_PREFIX}gcc${MINGW_TOOLCHAIN_SUFFIX} -E -xc-header -MMD -MF
<DEPFILE> -MT <OBJECT>\" ")
# Optional 3rd parameter: stdcall stack bytes
function(set_entrypoint MODULE ENTRYPOINT)