[CMAKE] Elimitate the use of GCC and CLANG variables
[reactos.git] / sdk / cmake / config.cmake
1
2 if(ARCH STREQUAL "i386")
3 set(SARCH "pc" CACHE STRING
4 "Sub-architecture to build for. Specify one of:
5 pc pc98 xbox")
6 elseif(ARCH STREQUAL "amd64")
7 set(SARCH "" CACHE STRING
8 "Sub-architecture to build for.")
9 elseif(ARCH STREQUAL "arm")
10 set(SARCH "omap3-zoom2" CACHE STRING
11 "Sub-architecture (board) to build for. Specify one of:
12 kurobox versatile omap3-zoom2 omap3-beagle")
13 elseif(ARCH STREQUAL "arm64")
14 # By design, arm64 kernels and OSes should be intercompatible, but
15 # due to SoC vendors seemingly not being able to follow ARM design guidelines
16 # properly, there might be a need for board-specific builds later on...
17 set(SARCH "" CACHE STRING
18 "Sub-architecture (board) to build for.")
19 endif()
20
21 if(ARCH STREQUAL "i386")
22 set(OARCH "pentium" CACHE STRING
23 "Generate instructions for this CPU type. Specify one of:
24 pentium, pentiumpro")
25 elseif(ARCH STREQUAL "amd64")
26 set(OARCH "athlon64" CACHE STRING
27 "Generate instructions for this CPU type. Specify one of:
28 k8 opteron athlon64 athlon-fx")
29 elseif(ARCH STREQUAL "arm")
30 set(OARCH "armv7-a" CACHE STRING
31 "Generate instructions for this CPU type. Specify one of:
32 armv5te armv7-a")
33 elseif(ARCH STREQUAL "arm64")
34 # This should not be bumped unless REALLY needed, because (as of 2021)
35 # there are still new designs using the original A53 cores w/ armv8.0.
36 set(OARCH "armv8-a" CACHE STRING
37 "Generate instructions for this CPU type. Specify one of:
38 armv8-a armv8.1-a armv8.2-a armv8.3-a armv8.4-a armv8.5-a armv8.6-a")
39 endif()
40
41 if(ARCH STREQUAL "i386" OR ARCH STREQUAL "amd64")
42 set(TUNE "generic" CACHE STRING
43 "Which CPU ReactOS should be optimized for.")
44 elseif(ARCH STREQUAL "arm")
45 set(TUNE "generic-armv7-a" CACHE STRING
46 "Which CPU ReactOS should be optimized for.")
47 elseif(ARCH STREQUAL "arm64")
48 set(TUNE "generic" CACHE STRING
49 "Which CPU ReactOS should be optimized for.")
50 endif()
51
52 set(OPTIMIZE "4" CACHE STRING
53 "What level of optimization to use.
54 0 = Off
55 1 = Optimize for size (-Os) with some additional options
56 2 = Optimize for size (-Os)
57 3 = Optimize debugging experience (-Og)
58 4 = Optimize (-O1)
59 5 = Optimize even more (-O2)
60 6 = Optimize yet more (-O3)
61 7 = Disregard strict standards compliance (-Ofast)")
62
63 set(LTCG FALSE CACHE BOOL
64 "Whether to build with link-time code generation")
65
66 set(GDB FALSE CACHE BOOL
67 "Whether to compile for debugging with GDB.
68 If you don't use GDB, don't enable this.")
69
70 if(CMAKE_BUILD_TYPE STREQUAL "Release")
71 set(DBG FALSE CACHE BOOL
72 "Whether to compile for debugging.")
73 else()
74 set(DBG TRUE CACHE BOOL
75 "Whether to compile for debugging.")
76 endif()
77
78 if(MSVC)
79 set(KDBG FALSE CACHE BOOL
80 "Whether to compile in the integrated kernel debugger.")
81 if(CMAKE_BUILD_TYPE STREQUAL "Release")
82 set(_WINKD_ FALSE CACHE BOOL "Whether to compile with the KD protocol.")
83 else()
84 set(_WINKD_ TRUE CACHE BOOL "Whether to compile with the KD protocol.")
85 endif()
86 else()
87 if(CMAKE_BUILD_TYPE STREQUAL "Release")
88 set(KDBG FALSE CACHE BOOL "Whether to compile in the integrated kernel debugger.")
89 else()
90 set(KDBG TRUE CACHE BOOL "Whether to compile in the integrated kernel debugger.")
91 endif()
92 set(_WINKD_ FALSE CACHE BOOL "Whether to compile with the KD protocol.")
93 endif()
94
95 option(BUILD_MP "Whether to build the multiprocessor versions of NTOSKRNL and HAL." ON)
96
97 cmake_dependent_option(ISAPNP_ENABLE "Whether to enable the ISA PnP support." ON
98 "ARCH STREQUAL i386 AND NOT SARCH STREQUAL xbox" OFF)
99
100 set(GENERATE_DEPENDENCY_GRAPH FALSE CACHE BOOL
101 "Whether to create a GraphML dependency graph of DLLs.")
102
103 if(CMAKE_C_COMPILER_ID STREQUAL "MSVC")
104 option(_PREFAST_ "Whether to enable PREFAST while compiling." OFF)
105 option(_VS_ANALYZE_ "Whether to enable static analysis while compiling." OFF)
106 # RTC are incompatible with compiler optimizations.
107 cmake_dependent_option(RUNTIME_CHECKS "Whether to enable runtime checks on MSVC" ON
108 "CMAKE_BUILD_TYPE STREQUAL Debug" OFF)
109 endif()
110
111 if(CMAKE_C_COMPILER_ID STREQUAL "GNU")
112 option(STACK_PROTECTOR "Whether to enable the GCC stack checker while compiling" OFF)
113 endif()
114
115 set(USE_DUMMY_PSEH FALSE CACHE BOOL
116 "Whether to disable PSEH support.")