Added comments, tested on MSVC and MINGW, should not cause troubles on Clang and Linux.

This commit is contained in:
FernandoS27 2016-12-11 16:09:52 -05:00
parent 958818d438
commit d5dbfeca99

View File

@ -47,10 +47,11 @@ set(CPU_TARGET "base" CACHE STRING "CPU minimum for this build, use base as defa
if (MSVC) if (MSVC)
set(CPU_TYPES "base;modern intel;modern amd;modern") set(CPU_TYPES "base;modern intel;modern amd;modern")
else() else()
set(CPU_TYPES "base;pentium4;haswell;skylake;modern") set(CPU_TYPES "base;pentium4;duo;sandybridge;haswell;skylake;modern")
endif() endif()
set_property(CACHE CPU_TARGET PROPERTY STRINGS ${CPU_TYPES}) set_property(CACHE CPU_TARGET PROPERTY STRINGS ${CPU_TYPES})
#CPU Tuning and Optimization Flags, Off by default, should only be used by particulars
set(CC_OP_LEVEL "") set(CC_OP_LEVEL "")
set(CC_EXTRA "") set(CC_EXTRA "")
set(CC_CPU_FLAGS "") set(CC_CPU_FLAGS "")
@ -69,6 +70,7 @@ elseif (MINGW)
set(CC_EXTRA "${CC_EXTRA} -pthread") set(CC_EXTRA "${CC_EXTRA} -pthread")
set(CC_OP_LEVEL "-O2") set(CC_OP_LEVEL "-O2")
if (ENABLE_HIGH_OP) if (ENABLE_HIGH_OP)
#Citra benefits a lot from this option as my testing have conducted
set(CC_OP_LEVEL "-O3") set(CC_OP_LEVEL "-O3")
endif() endif()
if (CPU_TARGET MATCHES "skylake") if (CPU_TARGET MATCHES "skylake")
@ -79,6 +81,10 @@ elseif (MINGW)
set(CC_CPU_FLAGS "-march=pentium4") set(CC_CPU_FLAGS "-march=pentium4")
elseif (CPU_TARGET MATCHES "haswell") elseif (CPU_TARGET MATCHES "haswell")
set(CC_CPU_FLAGS "-march=haswell -maccumulate-outgoing-args") set(CC_CPU_FLAGS "-march=haswell -maccumulate-outgoing-args")
elseif (CPU_TARGET MATCHES "duo")
set(CC_CPU_FLAGS "-march=core2")
elseif (CPU_TARGET MATCHES "sandybridge")
set(CC_CPU_FLAGS "-march=sandybridge -maccumulate-outgoing-args")
else () else ()
set(CC_CPU_FLAGS "-mmmx -msse -msse2") set(CC_CPU_FLAGS "-mmmx -msse -msse2")
endif() endif()
@ -109,6 +115,7 @@ message(STATUS "Target architecture: ${ARCHITECTURE}")
set(CMAKE_CXX_STANDARD 14) set(CMAKE_CXX_STANDARD 14)
set(CMAKE_CXX_STANDARD_REQUIRED ON) set(CMAKE_CXX_STANDARD_REQUIRED ON)
#Tuning Flags
set(COMP_FLAGS "${CC_OP_LEVEL} ${CC_CPU_FLAGS} ${CC_EXTRA}") set(COMP_FLAGS "${CC_OP_LEVEL} ${CC_CPU_FLAGS} ${CC_EXTRA}")
if (NOT MSVC) if (NOT MSVC)