[CMAKE]
[reactos.git] / toolchain-mingw32.cmake
1
2 SET(ARCH i386)
3
4 # Choose the right MinGW prefix
5 if (CMAKE_HOST_SYSTEM_NAME MATCHES Windows)
6 set(MINGW_PREFIX "")
7 else()
8 set(MINGW_PREFIX "mingw32-")
9 endif()
10
11 # the name of the target operating system
12 SET(CMAKE_SYSTEM_NAME Windows)
13 SET(CMAKE_SYSTEM_PROCESSOR i686)
14
15 # which compilers to use for C and C++
16 SET(CMAKE_C_COMPILER ${MINGW_PREFIX}gcc)
17 SET(CMAKE_CXX_COMPILER ${MINGW_PREFIX}g++)
18 SET(CMAKE_RC_COMPILER ${MINGW_PREFIX}windres)
19 SET(CMAKE_ASM_COMPILER ${MINGW_PREFIX}gcc)
20 SET(CMAKE_ASM_COMPILE_OBJECT "<CMAKE_ASM_COMPILER> -x assembler-with-cpp -o <OBJECT> <FLAGS> <DEFINES> -D__ASM__ -c <SOURCE>")
21 SET(CMAKE_RC_COMPILE_OBJECT "<CMAKE_RC_COMPILER> -O coff -I${REACTOS_SOURCE_DIR}/include/ -I${REACTOS_BINARY_DIR}/include/reactos -i <SOURCE> -o <OBJECT> <DEFINES> -DRC_INVOKED")
22
23 # Use stdcall fixups, and don't link with anything by default unless we say so
24 set(CMAKE_C_STANDARD_LIBRARIES "-lgcc") # We should add the environment libgcc here
25 SET(CMAKE_SHARED_LINKER_FLAGS "-Wl,--enable-stdcall-fixup -Wl,--kill-at -nodefaultlibs -nostdlib")
26
27 # adjust the default behaviour of the FIND_XXX() commands:
28 # search headers and libraries in the target environment, search
29 # programs in the host environment
30 set(CMAKE_FIND_ROOT_PATH_MODE_PROGRAM NEVER)
31 set(CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY)
32 set(CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY)