-
Notifications
You must be signed in to change notification settings - Fork 328
/
ProcessorTargets.cmake
47 lines (34 loc) · 2.91 KB
/
ProcessorTargets.cmake
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
# We have to create a label variable if we want to display it in AboutThisBuild.txt...
# This first choice should be used for official releases
set(PROC_TARGET_1_LABEL generic x86 CACHE STRING "Processor-1 label - should be used for official Windows release")
set(PROC_TARGET_1_FLAGS "-mtune=generic" CACHE STRING "Processor-1 flags")
# This second choice should be used for your own build only
set(PROC_TARGET_2_LABEL native CACHE STRING "Processor-2 label - use it for your own build")
# The flag is different on x86 and Arm based processors
if(CMAKE_HOST_SYSTEM_PROCESSOR STREQUAL arm64)
set(PROC_TARGET_2_FLAGS "-mcpu=native" CACHE STRING "Processor-2 flags")
elseif(CMAKE_HOST_SYSTEM_PROCESSOR MATCHES "ppc|powerpc")
set(PROC_TARGET_2_FLAGS "-mtune=native" CACHE STRING "Processor-2 flags")
else()
set(PROC_TARGET_2_FLAGS "-march=native" CACHE STRING "Processor-2 flags")
endif()
# The later choices is intended to be used if you want to provide specific builds, but it should match your own processor
# You can cross compile but you have to know what you're doing, this mechanism has not been designed for that
set(PROC_TARGET_3_LABEL pentium CACHE STRING "Processor-3 label - use it to provide a pentium optimized build, if you have this processor")
set(PROC_TARGET_3_FLAGS "-march=pentium" CACHE STRING "Processor-3 flags")
set(PROC_TARGET_4_LABEL pentium4 CACHE STRING "Processor-4 label - use it to provide a pentium4 optimized build, if you have this processor")
set(PROC_TARGET_4_FLAGS "-march=pentium4" CACHE STRING "Processor-4 flags")
set(PROC_TARGET_5_LABEL core2 CACHE STRING "Processor-5 label - use it to provide a core2 optimized build, if you have this processor")
set(PROC_TARGET_5_FLAGS "-march=core2" CACHE STRING "Processor-5 flags")
set(PROC_TARGET_6_LABEL corei7 CACHE STRING "Processor-6 label - use it to provide a corei7 optimized build, if you have this processor")
set(PROC_TARGET_6_FLAGS "-march=corei7" CACHE STRING "Processor-6 flags")
set(PROC_TARGET_7_LABEL athlon-4 CACHE STRING "Processor-7 label - use it to provide a athlon-4 optimized build, if you have this processor")
set(PROC_TARGET_7_FLAGS "-march=athlon-4" CACHE STRING "Processor-7 flags")
set(PROC_TARGET_8_LABEL athlon64 CACHE STRING "Processor-8 label - use it to provide a athlon64 optimized build, if you have this processor")
set(PROC_TARGET_8_FLAGS "-march=athlon64" CACHE STRING "Processor-8 flags")
set(PROC_TARGET_9_LABEL phenomX4 CACHE STRING "Processor-9 label - use it to provide a phenomX4 optimized build, if you have this processor")
set(PROC_TARGET_9_FLAGS "-march=amdfam10" CACHE STRING "Processor-9 flags")
set(PROC_TARGET_10_LABEL sandybridge-ivybridge CACHE STRING "Processor set-10 label")
set(PROC_TARGET_10_FLAGS "-march=sandybridge -mtune=ivybridge" CACHE STRING "Processors set-10 flags")
#set(PROC_TARGET__LABEL procLabel CACHE STRING "Processor- label")
#set(PROC_TARGET__FLAGS "procFlags" CACHE STRING "Processor- flags")