Author: tkreuzer
Date: Sat Aug 20 12:29:51 2011
New Revision: 53337
URL:
http://svn.reactos.org/svn/reactos?rev=53337&view=rev
Log:
[CMAKE]
- handle stdcall decoration in MSVC set_entrypoint
Modified:
trunk/reactos/cmake/msvc.cmake
Modified: trunk/reactos/cmake/msvc.cmake
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/cmake/msvc.cmake?rev=53337…
==============================================================================
--- trunk/reactos/cmake/msvc.cmake [iso-8859-1] (original)
+++ trunk/reactos/cmake/msvc.cmake [iso-8859-1] Sat Aug 20 12:29:51 2011
@@ -59,11 +59,17 @@
macro(add_pch _target_name _FILE)
endmacro()
-function(set_entrypoint MODULE ENTRYPOINT)
- if(${ENTRYPOINT} STREQUAL "0")
- add_linkerflag(${MODULE} "/NOENTRY")
+function(set_entrypoint _module _entrypoint)
+ if(${_entrypoint} STREQUAL "0")
+ add_linkerflag(${_module} "/NOENTRY")
+ elseif(ARCH MATCHES i386)
+ set(_entrysymbol ${_entrypoint})
+ if (${ARGC} GREATER 2)
+ set(_entrysymbol ${_entrysymbol}@${ARGV2})
+ endif()
+ add_linkerflag(${_module} "/ENTRY:${_entrysymbol}")
else()
- add_linkerflag(${MODULE} "/ENTRY:${ENTRYPOINT}")
+ add_linkerflag(${_module} "/ENTRY:${_entrypoint}")
endif()
endfunction()
@@ -79,7 +85,7 @@
add_dependencies(${MODULE} psdk)
if(${TYPE} MATCHES nativecui)
set_subsystem(${MODULE} native)
- set_entrypoint(${MODULE} NtProcessStartup@4)
+ set_entrypoint(${MODULE} NtProcessStartup 4)
elseif (${TYPE} MATCHES win32gui)
set_subsystem(${MODULE} windows)
if(IS_UNICODE)
@@ -96,7 +102,7 @@
endif(IS_UNICODE)
elseif(${TYPE} MATCHES win32dll)
# Need this only because mingw library is broken
- set_entrypoint(${MODULE} DllMainCRTStartup@12)
+ set_entrypoint(${MODULE} DllMainCRTStartup 12)
if(DEFINED baseaddress_${MODULE})
set_image_base(${MODULE} ${baseaddress_${MODULE}})
else()
@@ -104,16 +110,16 @@
endif()
add_linkerflag(${MODULE} "/DLL")
elseif(${TYPE} MATCHES win32ocx)
- set_entrypoint(${MODULE} DllMainCRTStartup@12)
+ set_entrypoint(${MODULE} DllMainCRTStartup 12)
set_target_properties(${MODULE} PROPERTIES SUFFIX ".ocx")
add_linkerflag(${MODULE} "/DLL")
elseif(${TYPE} MATCHES cpl)
- set_entrypoint(${MODULE} DllMainCRTStartup@12)
+ set_entrypoint(${MODULE} DllMainCRTStartup 12)
set_target_properties(${MODULE} PROPERTIES SUFFIX ".cpl")
add_linkerflag(${MODULE} "/DLL")
elseif(${TYPE} MATCHES kernelmodedriver)
set_target_properties(${MODULE} PROPERTIES SUFFIX ".sys")
- set_entrypoint(${MODULE} DriverEntry@8)
+ set_entrypoint(${MODULE} DriverEntry 8)
set_subsystem(${MODULE} native)
set_image_base(${MODULE} 0x00010000)
add_linkerflag(${MODULE} "/DRIVER")