4c85a14e87184006acb91fee3484ff25c1c16d2c
[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 SET(CMAKE_IDL_COMPILER midl)
33
34 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>")
35 SET(CMAKE_IDL_COMPILE_OBJECT "<CMAKE_IDL_COMPILER> <FLAGS> <DEFINES> /win32 /Dstrict_context_handle= /h <OBJECT> <SOURCE>")
36
37 SET(CMAKE_ASM_COMPILE_OBJECT
38 "<CMAKE_C_COMPILER> /nologo /X /I${REACTOS_SOURCE_DIR}/include/asm /I${REACTOS_BINARY_DIR}/include/asm <FLAGS> <DEFINES> /D__ASM__ /D_USE_ML /EP /c <SOURCE> > <OBJECT>.tmp"
39 "<CMAKE_ASM_COMPILER> /nologo /Fo<OBJECT> /c /Ta <OBJECT>.tmp")
40
41 set(CMAKE_C_FLAGS_INIT "/DWIN32 /D_WINDOWS /W1 /Zm1000")
42 set(CMAKE_C_FLAGS_DEBUG_INIT "/D_DEBUG /MDd /Zi /Ob0 /Od")
43 SET(CMAKE_CXX_FLAGS_DEBUG_INIT "/D_DEBUG /MDd /Zi /Ob0 /Od")
44
45 set(CMAKE_FIND_ROOT_PATH_MODE_PROGRAM NEVER)
46 set(CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY)
47 set(CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY)
48
49 # Prevent from using run time checking when testing the compiler
50 set(CMAKE_BUILD_TYPE "RelwithDebInfo" CACHE STRING "Build Type")
51
52 set(CMAKE_C_STANDARD_LIBRARIES "" CACHE INTERNAL "")