mirror of
https://github.com/reactos/reactos.git
synced 2025-08-02 05:35:40 +00:00
[CMAKE]
- Improve help strings for GCC optimization levels. - Add new -Ofast and -Og levels. - Simplify gcc.cmake a bit. - Use MINGW_TOOLCHAIN_SUFFIX. svn path=/trunk/; revision=58201
This commit is contained in:
parent
7bc3ce6d8e
commit
e368e3af90
4 changed files with 42 additions and 49 deletions
|
@ -7,13 +7,15 @@ set(OARCH "athlon64" CACHE STRING
|
|||
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")
|
||||
|
|
|
@ -8,13 +8,15 @@ set(OARCH "armv7-a" CACHE STRING
|
|||
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")
|
||||
|
|
|
@ -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")
|
||||
|
|
|
@ -10,7 +10,7 @@ if(NOT DEFINED SEPARATE_DBG)
|
|||
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 @@ else()
|
|||
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 @@ else()
|
|||
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 @@ endif()
|
|||
|
||||
# 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")
|
||||
add_compile_flags("-O1 -fno-inline-functions-called-once -fno-tree-sra")
|
||||
elseif(OPTIMIZE STREQUAL "4")
|
||||
add_compile_flags("-O2")
|
||||
add_compile_flags("-O1")
|
||||
elseif(OPTIMIZE STREQUAL "5")
|
||||
add_compile_flags("-O2")
|
||||
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 @@ if(LTCG)
|
|||
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_CXX_COMPILE_OBJECT "${CCACHE} <CMAKE_CXX_COMPILER> <DEFINES> <FLAGS>
|
|||
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)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue