[CMAKE]
[reactos.git] / toolchain-msvc.cmake
1
2 if(NOT ARCH)
3 set(ARCH i386)
4 endif()
5
6 # WDK support
7 string(REPLACE * ${ARCH} ATL_LIB_PATH $ENV{ATL_LIB_PATH})
8 string(REPLACE * ${ARCH} CRT_LIB_PATH $ENV{CRT_LIB_PATH})
9 string(REPLACE * ${ARCH} DDK_LIB_PATH $ENV{DDK_LIB_PATH})
10 string(REPLACE * ${ARCH} KMDF_LIB_PATH $ENV{KMDF_LIB_PATH})
11 string(REPLACE * ${ARCH} MFC_LIB_PATH $ENV{MFC_LIB_PATH})
12 string(REPLACE * ${ARCH} SDK_LIB_PATH $ENV{SDK_LIB_PATH})
13
14 link_directories(
15 #${ATL_LIB_PATH}
16 ${CRT_LIB_PATH}
17 ${DDK_LIB_PATH}
18 # ${IFSKIT_LIB_PATH}
19 # ${KMDF_LIB_PATH}
20 # ${MFC_LIB_PATH}
21 ${SDK_LIB_PATH})
22
23 # the name of the target operating system
24 set(CMAKE_SYSTEM_NAME Windows)
25 set(CMAKE_SYSTEM_PROCESSOR i686)
26
27 # which compilers to use for C and C++
28 set(CMAKE_C_COMPILER cl)
29 set(CMAKE_CXX_COMPILER cl)
30 SET(CMAKE_RC_COMPILER rc)
31 SET(CMAKE_ASM_COMPILER ml)
32
33 SET(CMAKE_RC_COMPILE_OBJECT "<CMAKE_RC_COMPILER> <DEFINES> /I${REACTOS_SOURCE_DIR}/include/psdk /I${REACTOS_BINARY_DIR}/include/psdk /I${REACTOS_SOURCE_DIR}/include/ /I${REACTOS_SOURCE_DIR}/include/reactos /I${REACTOS_BINARY_DIR}/include/reactos /I${REACTOS_SOURCE_DIR}/include/reactos/wine /I${REACTOS_SOURCE_DIR}/include/crt /I${REACTOS_SOURCE_DIR}/include/crt/mingw32 /fo <OBJECT> <SOURCE>")
34
35 set(CMAKE_C_FLAGS_INIT "/DWIN32 /D_WINDOWS /W1 /Zm1000")
36 set(CMAKE_C_FLAGS_DEBUG_INIT "/D_DEBUG /MDd /Zi /Ob0 /Od")
37 SET(CMAKE_CXX_FLAGS_DEBUG_INIT "/D_DEBUG /MDd /Zi /Ob0 /Od")
38
39 set(CMAKE_FIND_ROOT_PATH_MODE_PROGRAM NEVER)
40 set(CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY)
41 set(CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY)
42
43 # Prevent from using run time checking when testing the compiler
44 set(CMAKE_BUILD_TYPE "RelwithDebInfo" CACHE STRING "Build Type")