270709874c82031fa6c1e7d018661d50abc68cd2
[reactos.git] / msc.cmake
1
2 if(CMAKE_SYSTEM_PROCESSOR MATCHES "x86")
3 add_definitions(-D__i386__)
4 endif()
5
6 add_definitions(-Dinline=__inline)
7
8 if(NOT CMAKE_CROSSCOMPILING)
9
10
11
12 else()
13
14 add_definitions(/GS- /Zl /Zi)
15 add_definitions(-Dinline=__inline -D__STDC__=1)
16
17 macro(set_entrypoint MODULE ENTRYPOINT)
18 set_target_properties(${MODULE} PROPERTIES LINK_FLAGS "/ENTRY:${ENTRYPOINT}")
19 endmacro()
20
21 macro(set_subsystem MODULE SUBSYSTEM)
22 set_target_properties(${MODULE} PROPERTIES LINK_FLAGS "/subsystem:${SUBSYSTEM}")
23 endmacro()
24
25 macro(add_importlibs MODULE)
26 FOREACH(LIB ${ARGN})
27 target_link_libraries(${MODULE} ${LIB}.LIB)
28 ENDFOREACH()
29 endmacro()
30
31 macro(set_module_type MODULE TYPE)
32 if(${TYPE} MATCHES nativecui)
33 set_subsystem(${MODULE} native)
34 add_importlibs(${MODULE} ntdll)
35 endif()
36 if (${TYPE} MATCHES win32gui)
37 set_subsystem(${MODULE} windows)
38 endif ()
39 if (${TYPE} MATCHES win32cui)
40 set_subsystem(${MODULE} windows)
41 set_entrypoint(${MODULE} mainCRTStartup)
42 endif ()
43 endmacro()
44
45 endif()
46
47 set(CMAKE_C_FLAGS_DEBUG_INIT "/D_DEBUG /MDd /Zi /Ob0 /Od")
48 SET(CMAKE_CXX_FLAGS_DEBUG_INIT "/D_DEBUG /MDd /Zi /Ob0 /Od")
49