2011-05-16 13:12:07 +00:00
|
|
|
|
2021-04-13 18:08:04 +00:00
|
|
|
if(ARCH STREQUAL "i386")
|
|
|
|
set(SARCH "pc" CACHE STRING
|
|
|
|
"Sub-architecture to build for. Specify one of:
|
|
|
|
pc pc98 xbox")
|
|
|
|
elseif(ARCH STREQUAL "amd64")
|
|
|
|
set(SARCH "" CACHE STRING
|
|
|
|
"Sub-architecture to build for.")
|
|
|
|
elseif(ARCH STREQUAL "arm")
|
|
|
|
set(SARCH "omap3-zoom2" CACHE STRING
|
|
|
|
"Sub-architecture (board) to build for. Specify one of:
|
|
|
|
kurobox versatile omap3-zoom2 omap3-beagle")
|
|
|
|
endif()
|
2011-05-16 13:12:07 +00:00
|
|
|
|
2021-04-13 18:08:04 +00:00
|
|
|
if(ARCH STREQUAL "i386")
|
|
|
|
set(OARCH "pentium" CACHE STRING
|
|
|
|
"Generate instructions for this CPU type. Specify one of:
|
|
|
|
pentium, pentiumpro")
|
|
|
|
elseif(ARCH STREQUAL "amd64")
|
|
|
|
set(OARCH "athlon64" CACHE STRING
|
|
|
|
"Generate instructions for this CPU type. Specify one of:
|
|
|
|
k8 opteron athlon64 athlon-fx")
|
|
|
|
elseif(ARCH STREQUAL "arm")
|
|
|
|
set(OARCH "armv7-a" CACHE STRING
|
|
|
|
"Generate instructions for this CPU type. Specify one of:
|
|
|
|
armv5te armv7-a")
|
|
|
|
endif()
|
2011-05-16 13:12:07 +00:00
|
|
|
|
2021-04-13 18:08:04 +00:00
|
|
|
if(ARCH STREQUAL "i386" OR ARCH STREQUAL "amd64")
|
|
|
|
set(TUNE "generic" CACHE STRING
|
|
|
|
"Which CPU ReactOS should be optimized for.")
|
|
|
|
elseif(ARCH STREQUAL "arm")
|
|
|
|
set(TUNE "generic-arch" CACHE STRING
|
|
|
|
"Which CPU ReactOS should be optimized for.")
|
|
|
|
endif()
|
2011-05-16 13:12:07 +00:00
|
|
|
|
2013-07-31 13:04:38 +00:00
|
|
|
set(OPTIMIZE "4" CACHE STRING
|
2013-01-22 22:38:40 +00:00
|
|
|
"What level of optimization to use.
|
2014-04-01 08:58:08 +00:00
|
|
|
0 = Off
|
|
|
|
1 = Optimize for size (-Os) with some additional options
|
2013-01-22 22:38:40 +00:00
|
|
|
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)")
|
2011-05-16 13:12:07 +00:00
|
|
|
|
2012-03-10 23:38:37 +00:00
|
|
|
set(LTCG FALSE CACHE BOOL
|
|
|
|
"Whether to build with link-time code generation")
|
|
|
|
|
2011-05-16 13:12:07 +00:00
|
|
|
set(GDB FALSE CACHE BOOL
|
|
|
|
"Whether to compile for debugging with GDB.
|
2013-04-18 21:19:09 +00:00
|
|
|
If you don't use GDB, don't enable this.")
|
2011-05-16 13:12:07 +00:00
|
|
|
|
2012-08-27 18:58:27 +00:00
|
|
|
if(CMAKE_BUILD_TYPE STREQUAL "Release")
|
2012-01-14 17:31:20 +00:00
|
|
|
set(DBG FALSE CACHE BOOL
|
2011-06-24 21:28:43 +00:00
|
|
|
"Whether to compile for debugging.")
|
2012-01-14 17:31:20 +00:00
|
|
|
else()
|
|
|
|
set(DBG TRUE CACHE BOOL
|
|
|
|
"Whether to compile for debugging.")
|
|
|
|
endif()
|
2011-06-24 21:28:43 +00:00
|
|
|
|
2019-08-19 22:07:45 +00:00
|
|
|
if(CMAKE_C_COMPILER_ID STREQUAL "GNU")
|
|
|
|
set(GCC TRUE CACHE BOOL "The compiler is GCC")
|
|
|
|
set(CLANG FALSE CACHE BOOL "The compiler is LLVM Clang")
|
|
|
|
elseif(CMAKE_C_COMPILER_ID STREQUAL "Clang")
|
2020-09-10 21:23:14 +00:00
|
|
|
# We can use LLVM Clang mimicking CL or GCC. Account for this
|
|
|
|
if (MSVC)
|
|
|
|
set(GCC FALSE CACHE BOOL "The compiler is GCC")
|
|
|
|
else()
|
|
|
|
set(GCC TRUE CACHE BOOL "The compiler is GCC")
|
|
|
|
endif()
|
2019-08-19 22:07:45 +00:00
|
|
|
set(CLANG TRUE CACHE BOOL "The compiler is LLVM Clang")
|
2021-04-10 02:12:48 +00:00
|
|
|
elseif(MSVC) # aka CMAKE_C_COMPILER_ID STREQUAL "MSVC"
|
2019-08-19 22:07:45 +00:00
|
|
|
set(GCC FALSE CACHE BOOL "The compiler is GCC")
|
|
|
|
set(CLANG FALSE CACHE BOOL "The compiler is LLVM Clang")
|
|
|
|
# MSVC variable is already set by cmake
|
|
|
|
else()
|
|
|
|
message("WARNING: the compiler has not been recognized")
|
|
|
|
endif()
|
|
|
|
|
2017-10-27 21:18:01 +00:00
|
|
|
if(MSVC AND (NOT USE_CLANG_CL))
|
2011-06-24 21:28:43 +00:00
|
|
|
set(KDBG FALSE CACHE BOOL
|
|
|
|
"Whether to compile in the integrated kernel debugger.")
|
2012-08-27 18:58:27 +00:00
|
|
|
if(CMAKE_BUILD_TYPE STREQUAL "Release")
|
2012-01-14 17:31:20 +00:00
|
|
|
set(_WINKD_ FALSE CACHE BOOL "Whether to compile with the KD protocol.")
|
|
|
|
else()
|
|
|
|
set(_WINKD_ TRUE CACHE BOOL "Whether to compile with the KD protocol.")
|
|
|
|
endif()
|
2012-09-09 21:12:00 +00:00
|
|
|
|
2011-06-24 21:28:43 +00:00
|
|
|
else()
|
2013-03-16 23:28:27 +00:00
|
|
|
if(CMAKE_BUILD_TYPE STREQUAL "Release")
|
|
|
|
set(KDBG FALSE CACHE BOOL "Whether to compile in the integrated kernel debugger.")
|
|
|
|
else()
|
|
|
|
set(KDBG TRUE CACHE BOOL "Whether to compile in the integrated kernel debugger.")
|
|
|
|
endif()
|
|
|
|
set(_WINKD_ FALSE CACHE BOOL "Whether to compile with the KD protocol.")
|
2011-06-24 21:28:43 +00:00
|
|
|
endif()
|
2011-05-16 13:12:07 +00:00
|
|
|
|
2021-06-28 14:54:09 +00:00
|
|
|
option(BUILD_MP "Whether to build the multiprocessor versions of NTOSKRNL and HAL." ON)
|
2011-05-16 13:12:07 +00:00
|
|
|
|
2021-03-20 14:53:32 +00:00
|
|
|
cmake_dependent_option(ISAPNP_ENABLE "Whether to enable the ISA PnP support." ON
|
|
|
|
"ARCH STREQUAL i386 AND NOT SARCH STREQUAL xbox" OFF)
|
|
|
|
|
2015-03-06 00:43:46 +00:00
|
|
|
set(GENERATE_DEPENDENCY_GRAPH FALSE CACHE BOOL
|
2014-04-01 08:58:08 +00:00
|
|
|
"Whether to create a GraphML dependency graph of DLLs.")
|
2012-01-05 17:19:15 +00:00
|
|
|
|
|
|
|
if(MSVC)
|
2021-04-13 18:08:04 +00:00
|
|
|
option(_PREFAST_ "Whether to enable PREFAST while compiling." OFF)
|
|
|
|
option(_VS_ANALYZE_ "Whether to enable static analysis while compiling." OFF)
|
2020-06-02 19:27:07 +00:00
|
|
|
# RTC are incompatible with compiler optimizations.
|
|
|
|
cmake_dependent_option(RUNTIME_CHECKS "Whether to enable runtime checks on MSVC" ON
|
2020-12-14 18:09:14 +00:00
|
|
|
"CMAKE_BUILD_TYPE STREQUAL Debug" OFF)
|
2020-04-09 01:40:17 +00:00
|
|
|
endif()
|
|
|
|
|
|
|
|
if(GCC)
|
|
|
|
option(STACK_PROTECTOR "Whether to enable the GCC stack checker while compiling" OFF)
|
2012-01-05 17:19:15 +00:00
|
|
|
endif()
|
2013-11-01 11:58:31 +00:00
|
|
|
|
|
|
|
set(USE_DUMMY_PSEH FALSE CACHE BOOL
|
2013-11-02 14:33:18 +00:00
|
|
|
"Whether to disable PSEH support.")
|