2010-09-19 20:06:02 +00:00
|
|
|
|
|
|
|
if(CMAKE_SYSTEM_PROCESSOR MATCHES "x86")
|
|
|
|
add_definitions(-D__i386__)
|
|
|
|
endif()
|
|
|
|
|
|
|
|
add_definitions(-Dinline=__inline)
|
|
|
|
|
|
|
|
if(NOT CMAKE_CROSSCOMPILING)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
else()
|
|
|
|
|
|
|
|
add_definitions(/GS- /Zl /Zi)
|
|
|
|
add_definitions(-Dinline=__inline -D__STDC__=1)
|
|
|
|
|
|
|
|
macro(set_entrypoint MODULE ENTRYPOINT)
|
|
|
|
set_target_properties(${MODULE} PROPERTIES LINK_FLAGS "/ENTRY:${ENTRYPOINT}")
|
|
|
|
endmacro()
|
|
|
|
|
2010-09-19 23:03:25 +00:00
|
|
|
macro(set_subsystem MODULE SUBSYSTEM)
|
|
|
|
set_target_properties(${MODULE} PROPERTIES LINK_FLAGS "/subsystem:${SUBSYSTEM}")
|
|
|
|
endmacro()
|
|
|
|
|
2010-09-19 20:06:02 +00:00
|
|
|
macro(add_importlibs MODULE)
|
|
|
|
FOREACH(LIB ${ARGN})
|
|
|
|
target_link_libraries(${MODULE} ${LIB}.LIB)
|
|
|
|
ENDFOREACH()
|
|
|
|
endmacro()
|
|
|
|
|
|
|
|
macro(set_module_type MODULE TYPE)
|
2010-09-19 23:03:25 +00:00
|
|
|
if(${TYPE} MATCHES nativecui)
|
|
|
|
set_subsystem(${MODULE} native)
|
|
|
|
add_importlibs(${MODULE} ntdll)
|
|
|
|
endif()
|
2010-09-19 20:06:02 +00:00
|
|
|
if (${TYPE} MATCHES win32gui)
|
2010-09-19 23:03:25 +00:00
|
|
|
set_subsystem(${MODULE} windows)
|
2010-09-19 20:06:02 +00:00
|
|
|
endif ()
|
|
|
|
endmacro()
|
|
|
|
|
|
|
|
endif()
|
2010-09-19 23:03:25 +00:00
|
|
|
|
|
|
|
set(CMAKE_C_FLAGS_DEBUG_INIT "/D_DEBUG /MDd /Zi /Ob0 /Od")
|
|
|
|
SET(CMAKE_CXX_FLAGS_DEBUG_INIT "/D_DEBUG /MDd /Zi /Ob0 /Od")
|
|
|
|
|