[RAPPS] Usability fixes.
[reactos.git] / toolchain-msvc.cmake
1
2 if(NOT ARCH)
3 set(ARCH i386)
4 endif()
5
6 # Default to Debug for the build type
7 if(NOT DEFINED CMAKE_BUILD_TYPE)
8 set(CMAKE_BUILD_TYPE "Debug" CACHE STRING
9 "Choose the type of build, options are: None(CMAKE_CXX_FLAGS or CMAKE_C_FLAGS used) Debug Release RelWithDebInfo MinSizeRel.")
10 endif()
11
12 # the name of the target operating system
13 set(CMAKE_SYSTEM_NAME Windows)
14 set(CMAKE_SYSTEM_PROCESSOR i686)
15
16 # which compilers to use for C and C++
17 # clang-cl gets detected as "Clang" instead of "MSVC" so we force it here
18 if(USE_CLANG_CL)
19 include(CMakeForceCompiler)
20 CMAKE_FORCE_C_COMPILER(clang-cl MSVC)
21 set(CMAKE_C_COMPILER_VERSION "16.00.40219.01")
22 if(ARCH STREQUAL "i386")
23 set(MSVC_C_ARCHITECTURE_ID "X86")
24 endif()
25 include(${CMAKE_ROOT}/Modules/CMakeClDeps.cmake)
26 else()
27 set(CMAKE_C_COMPILER cl)
28 endif()
29
30 if(ARCH STREQUAL "arm")
31 include(CMakeForceCompiler)
32 CMAKE_FORCE_CXX_COMPILER(cl MSVC)
33 else()
34 if(USE_CLANG_CL)
35 include(CMakeForceCompiler)
36 CMAKE_FORCE_CXX_COMPILER(clang-cl MSVC)
37 else()
38 set(CMAKE_CXX_COMPILER cl)
39 endif()
40 endif()
41
42 set(CMAKE_MC_COMPILER mc)
43 set(CMAKE_RC_COMPILER rc)
44 if(ARCH STREQUAL "amd64")
45 set(CMAKE_ASM_COMPILER ml64)
46 elseif(ARCH STREQUAL "arm")
47 set(CMAKE_ASM_COMPILER armasm)
48 else()
49 set(CMAKE_ASM_COMPILER ml)
50 endif()
51 set(CMAKE_ASM_COMPILER_ID "VISUAL")
52
53 set(CMAKE_C_STANDARD_LIBRARIES "" CACHE INTERNAL "")
54
55 if(CMAKE_SYSTEM_PROCESSOR STREQUAL "x86")
56 add_definitions(-D__i386__)
57 endif()