[CMAKE]: Make simple rule for building ASM files.
[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
22 # adjust the default behaviour of the FIND_XXX() commands:
23 # search headers and libraries in the target environment, search
24 # programs in the host environment
25 set(CMAKE_FIND_ROOT_PATH_MODE_PROGRAM NEVER)
26 set(CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY)
27 set(CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY)