Author: akhaldi
Date: Sat Sep 25 20:44:46 2010
New Revision: 48893
URL:
http://svn.reactos.org/svn/reactos?rev=48893&view=rev
Log:
[CMAKE]
- Introduce proper set_entrypoint and set_subsystem macros for both mingw and msvc.
- Fix the subsystem for console apps.
Modified:
branches/cmake-bringup/gcc.cmake
branches/cmake-bringup/msc.cmake
Modified: branches/cmake-bringup/gcc.cmake
URL:
http://svn.reactos.org/svn/reactos/branches/cmake-bringup/gcc.cmake?rev=488…
==============================================================================
--- branches/cmake-bringup/gcc.cmake [iso-8859-1] (original)
+++ branches/cmake-bringup/gcc.cmake [iso-8859-1] Sat Sep 25 20:44:46 2010
@@ -35,11 +35,21 @@
# Macros
macro(set_entrypoint MODULE ENTRYPOINT)
- set_target_properties(${MODULE} PROPERTIES LINK_FLAGS
"-Wl,-entry,_${ENTRYPOINT}")
+ set(NEW_LINKER_FLAGS "-Wl,-entry,_${ENTRYPOINT}")
+ get_target_property(LINKER_FLAGS ${MODULE} LINK_FLAGS)
+ if(LINKER_FLAGS)
+ set(NEW_LINKER_FLAGS "${LINKER_FLAGS} ${NEW_LINKER_FLAGS}")
+ endif()
+ set_target_properties(${MODULE} PROPERTIES LINK_FLAGS ${NEW_LINKER_FLAGS})
endmacro()
macro(set_subsystem MODULE SUBSYSTEM)
- set_target_properties(${MODULE} PROPERTIES LINK_FLAGS
"-Wl,--subsystem,${SUBSYSTEM}")
+ set(NEW_LINKER_FLAGS "-Wl,--subsystem,${SUBSYSTEM}")
+ get_target_property(LINKER_FLAGS ${MODULE} LINK_FLAGS)
+ if(LINKER_FLAGS)
+ set(NEW_LINKER_FLAGS "${LINKER_FLAGS} ${NEW_LINKER_FLAGS}")
+ endif()
+ set_target_properties(${MODULE} PROPERTIES LINK_FLAGS ${NEW_LINKER_FLAGS})
endmacro()
macro(add_importlibs MODULE)
@@ -61,7 +71,7 @@
set_entrypoint(${MODULE} WinMainCRTStartup)
endif()
if(${TYPE} MATCHES win32cui)
- set_subsystem(${MODULE} windows)
+ set_subsystem(${MODULE} console)
set_entrypoint(${MODULE} mainCRTStartup)
endif()
if(${TYPE} MATCHES win32dll)
Modified: branches/cmake-bringup/msc.cmake
URL:
http://svn.reactos.org/svn/reactos/branches/cmake-bringup/msc.cmake?rev=488…
==============================================================================
--- branches/cmake-bringup/msc.cmake [iso-8859-1] (original)
+++ branches/cmake-bringup/msc.cmake [iso-8859-1] Sat Sep 25 20:44:46 2010
@@ -15,11 +15,21 @@
add_definitions(-Dinline=__inline -D__STDC__=1)
macro(set_entrypoint MODULE ENTRYPOINT)
- set_target_properties(${MODULE} PROPERTIES LINK_FLAGS
"/ENTRY:${ENTRYPOINT}")
+ set(NEW_LINKER_FLAGS "/ENTRY:${ENTRYPOINT}")
+ get_target_property(LINKER_FLAGS ${MODULE} LINK_FLAGS)
+ if(LINKER_FLAGS)
+ set(NEW_LINKER_FLAGS "${LINKER_FLAGS} ${NEW_LINKER_FLAGS}")
+ endif()
+ set_target_properties(${MODULE} PROPERTIES LINK_FLAGS ${NEW_LINKER_FLAGS})
endmacro()
macro(set_subsystem MODULE SUBSYSTEM)
- set_target_properties(${MODULE} PROPERTIES LINK_FLAGS
"/subsystem:${SUBSYSTEM}")
+ set(NEW_LINKER_FLAGS "/subsystem:${SUBSYSTEM}")
+ get_target_property(LINKER_FLAGS ${MODULE} LINK_FLAGS)
+ if(LINKER_FLAGS)
+ set(NEW_LINKER_FLAGS "${LINKER_FLAGS} ${NEW_LINKER_FLAGS}")
+ endif()
+ set_target_properties(${MODULE} PROPERTIES LINK_FLAGS ${NEW_LINKER_FLAGS})
endmacro()
macro(add_importlibs MODULE)