Author: akhaldi
Date: Wed Nov 4 18:06:16 2015
New Revision: 69812
URL:
http://svn.reactos.org/svn/reactos?rev=69812&view=rev
Log:
[CMAKE] Properly handle hotpatchable flags requirements in MSVC builds. CORE-10477
Modified:
trunk/reactos/cmake/CMakeMacros.cmake
trunk/reactos/cmake/msvc.cmake
trunk/reactos/dll/directx/wine/d3d8/CMakeLists.txt
trunk/reactos/dll/directx/wine/d3d9/CMakeLists.txt
trunk/reactos/dll/directx/wine/ddraw/CMakeLists.txt
trunk/reactos/dll/directx/wine/dinput/CMakeLists.txt
trunk/reactos/dll/directx/wine/dinput8/CMakeLists.txt
trunk/reactos/dll/ntdll/CMakeLists.txt
trunk/reactos/dll/opengl/opengl32/CMakeLists.txt
trunk/reactos/dll/win32/iphlpapi/CMakeLists.txt
trunk/reactos/dll/win32/kernel32/CMakeLists.txt
trunk/reactos/dll/win32/kernel32_vista/CMakeLists.txt
trunk/reactos/dll/win32/shell32/CMakeLists.txt
trunk/reactos/dll/win32/winmm/CMakeLists.txt
trunk/reactos/dll/win32/xinput1_3/CMakeLists.txt
trunk/reactos/win32ss/user/user32/CMakeLists.txt
Modified: trunk/reactos/cmake/CMakeMacros.cmake
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/cmake/CMakeMacros.cmake?re…
==============================================================================
--- trunk/reactos/cmake/CMakeMacros.cmake [iso-8859-1] (original)
+++ trunk/reactos/cmake/CMakeMacros.cmake [iso-8859-1] Wed Nov 4 18:06:16 2015
@@ -540,7 +540,7 @@
endfunction()
function(set_module_type MODULE TYPE)
- cmake_parse_arguments(__module "UNICODE;HOTPATCHABLE" "IMAGEBASE"
"ENTRYPOINT" ${ARGN})
+ cmake_parse_arguments(__module "UNICODE" "IMAGEBASE"
"ENTRYPOINT" ${ARGN})
if(__module_UNPARSED_ARGUMENTS)
message(STATUS "set_module_type : unparsed arguments
${__module_UNPARSED_ARGUMENTS}, module : ${MODULE}")
@@ -572,17 +572,6 @@
#set unicode definitions
if(__module_UNICODE)
add_target_compile_definitions(${MODULE} UNICODE _UNICODE)
- endif()
-
- # Handle hotpatchable images.
- # GCC has this as a function attribute so we're handling it using
DECLSPEC_HOTPATCH
- if(__module_HOTPATCHABLE AND MSVC AND (NOT ARCH STREQUAL "arm"))
- if(ARCH STREQUAL "i386")
- set_property(TARGET ${MODULE} APPEND_STRING PROPERTY COMPILE_FLAGS "
/hotpatch")
- set_property(TARGET ${MODULE} APPEND_STRING PROPERTY LINK_FLAGS "
/FUNCTIONPADMIN:5")
- elseif(ARCH STREQUAL "amd64")
- set_property(TARGET ${MODULE} APPEND_STRING PROPERTY LINK_FLAGS "
/FUNCTIONPADMIN:6")
- endif()
endif()
# set entry point
Modified: trunk/reactos/cmake/msvc.cmake
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/cmake/msvc.cmake?rev=69812…
==============================================================================
--- trunk/reactos/cmake/msvc.cmake [iso-8859-1] (original)
+++ trunk/reactos/cmake/msvc.cmake [iso-8859-1] Wed Nov 4 18:06:16 2015
@@ -95,6 +95,14 @@
add_definitions("/D NDEBUG")
endif()
+# Hotpatchable images
+if(ARCH STREQUAL "i386")
+ add_compile_flags("/hotpatch")
+ set(_hotpatch_link_flag "/FUNCTIONPADMIN:5")
+elseif(ARCH STREQUAL "amd64")
+ set(_hotpatch_link_flag "/FUNCTIONPADMIN:6")
+endif()
+
if(MSVC_IDE AND (NOT DEFINED USE_FOLDER_STRUCTURE))
set(USE_FOLDER_STRUCTURE FALSE)
endif()
@@ -108,9 +116,9 @@
add_compile_flags("/RTC1")
endif()
-set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} /MANIFEST:NO /INCREMENTAL:NO
/SAFESEH:NO /NODEFAULTLIB /RELEASE")
-set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} /MANIFEST:NO
/INCREMENTAL:NO /SAFESEH:NO /NODEFAULTLIB /RELEASE /IGNORE:4104")
-set(CMAKE_MODULE_LINKER_FLAGS "${CMAKE_MODULE_LINKER_FLAGS} /MANIFEST:NO
/INCREMENTAL:NO /SAFESEH:NO /NODEFAULTLIB /RELEASE")
+set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} /MANIFEST:NO /INCREMENTAL:NO
/SAFESEH:NO /NODEFAULTLIB /RELEASE ${_hotpatch_link_flag}")
+set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} /MANIFEST:NO
/INCREMENTAL:NO /SAFESEH:NO /NODEFAULTLIB /RELEASE /IGNORE:4104
${_hotpatch_link_flag}")
+set(CMAKE_MODULE_LINKER_FLAGS "${CMAKE_MODULE_LINKER_FLAGS} /MANIFEST:NO
/INCREMENTAL:NO /SAFESEH:NO /NODEFAULTLIB /RELEASE ${_hotpatch_link_flag}")
if(CMAKE_DISABLE_NINJA_DEPSLOG)
set(cl_includes_flag "")
Modified: trunk/reactos/dll/directx/wine/d3d8/CMakeLists.txt
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/directx/wine/d3d8/CMak…
==============================================================================
--- trunk/reactos/dll/directx/wine/d3d8/CMakeLists.txt [iso-8859-1] (original)
+++ trunk/reactos/dll/directx/wine/d3d8/CMakeLists.txt [iso-8859-1] Wed Nov 4 18:06:16
2015
@@ -25,7 +25,7 @@
version.rc
${CMAKE_CURRENT_BINARY_DIR}/d3d8.def)
-set_module_type(d3d8 win32dll UNICODE HOTPATCHABLE)
+set_module_type(d3d8 win32dll UNICODE)
target_link_libraries(d3d8 uuid wine)
add_importlibs(d3d8 d3dwine msvcrt kernel32 ntdll)
add_pch(d3d8 d3d8_private.h SOURCE)
Modified: trunk/reactos/dll/directx/wine/d3d9/CMakeLists.txt
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/directx/wine/d3d9/CMak…
==============================================================================
--- trunk/reactos/dll/directx/wine/d3d9/CMakeLists.txt [iso-8859-1] (original)
+++ trunk/reactos/dll/directx/wine/d3d9/CMakeLists.txt [iso-8859-1] Wed Nov 4 18:06:16
2015
@@ -28,7 +28,7 @@
${CMAKE_CURRENT_BINARY_DIR}/d3d9_stubs.c
${CMAKE_CURRENT_BINARY_DIR}/d3d9.def)
-set_module_type(d3d9 win32dll UNICODE HOTPATCHABLE)
+set_module_type(d3d9 win32dll UNICODE)
target_link_libraries(d3d9 wine)
add_importlibs(d3d9 d3dwine msvcrt kernel32 ntdll)
add_pch(d3d9 d3d9_private.h SOURCE)
Modified: trunk/reactos/dll/directx/wine/ddraw/CMakeLists.txt
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/directx/wine/ddraw/CMa…
==============================================================================
--- trunk/reactos/dll/directx/wine/ddraw/CMakeLists.txt [iso-8859-1] (original)
+++ trunk/reactos/dll/directx/wine/ddraw/CMakeLists.txt [iso-8859-1] Wed Nov 4 18:06:16
2015
@@ -34,7 +34,7 @@
ddraw.rc
${CMAKE_CURRENT_BINARY_DIR}/ddraw.def)
-set_module_type(ddraw win32dll HOTPATCHABLE)
+set_module_type(ddraw win32dll)
target_link_libraries(ddraw wine uuid dxguid ${PSEH_LIB})
add_importlibs(ddraw advapi32 gdi32 user32 d3dwine msvcrt kernel32 ntdll)
add_dependencies(ddraw wineheaders)
Modified: trunk/reactos/dll/directx/wine/dinput/CMakeLists.txt
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/directx/wine/dinput/CM…
==============================================================================
--- trunk/reactos/dll/directx/wine/dinput/CMakeLists.txt [iso-8859-1] (original)
+++ trunk/reactos/dll/directx/wine/dinput/CMakeLists.txt [iso-8859-1] Wed Nov 4 18:06:16
2015
@@ -24,7 +24,7 @@
add_library(dinput_data_formats data_formats.c)
add_dependencies(dinput_data_formats psdk)
-set_module_type(dinput win32dll HOTPATCHABLE)
+set_module_type(dinput win32dll)
target_link_libraries(dinput dxguid uuid wine)
add_importlibs(dinput comctl32 ole32 user32 advapi32 msvcrt kernel32 ntdll)
add_pch(dinput dinput_private.h SOURCE)
Modified: trunk/reactos/dll/directx/wine/dinput8/CMakeLists.txt
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/directx/wine/dinput8/C…
==============================================================================
--- trunk/reactos/dll/directx/wine/dinput8/CMakeLists.txt [iso-8859-1] (original)
+++ trunk/reactos/dll/directx/wine/dinput8/CMakeLists.txt [iso-8859-1] Wed Nov 4 18:06:16
2015
@@ -8,7 +8,7 @@
${CMAKE_CURRENT_BINARY_DIR}/dinput8.def)
add_library(dinput8 SHARED ${SOURCE} version.rc)
-set_module_type(dinput8 win32dll HOTPATCHABLE)
+set_module_type(dinput8 win32dll)
target_link_libraries(dinput8 dxguid uuid wine)
add_importlibs(dinput8 ole32 msvcrt kernel32 ntdll)
add_cd_file(TARGET dinput8 DESTINATION reactos/system32 FOR all)
Modified: trunk/reactos/dll/ntdll/CMakeLists.txt
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/ntdll/CMakeLists.txt?r…
==============================================================================
--- trunk/reactos/dll/ntdll/CMakeLists.txt [iso-8859-1] (original)
+++ trunk/reactos/dll/ntdll/CMakeLists.txt [iso-8859-1] Wed Nov 4 18:06:16 2015
@@ -43,7 +43,7 @@
${CMAKE_CURRENT_BINARY_DIR}/ntdll_stubs.c
${CMAKE_CURRENT_BINARY_DIR}/ntdll.def)
-set_module_type(ntdll win32dll HOTPATCHABLE ENTRYPOINT 0)
+set_module_type(ntdll win32dll ENTRYPOINT 0)
#############################################
## HACK FOR MSVC COMPILATION WITH win32dll ##
set_subsystem(ntdll console)
Modified: trunk/reactos/dll/opengl/opengl32/CMakeLists.txt
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/opengl/opengl32/CMakeL…
==============================================================================
--- trunk/reactos/dll/opengl/opengl32/CMakeLists.txt [iso-8859-1] (original)
+++ trunk/reactos/dll/opengl/opengl32/CMakeLists.txt [iso-8859-1] Wed Nov 4 18:06:16
2015
@@ -57,8 +57,7 @@
target_link_libraries(opengl32 mingwex)
endif()
-set_module_type(opengl32 win32dll HOTPATCHABLE)
-
+set_module_type(opengl32 win32dll)
add_importlibs(opengl32 gdi32 user32 advapi32 msvcrt kernel32 ntdll)
add_pch(opengl32 opengl32.h SOURCE)
add_cd_file(TARGET opengl32 DESTINATION reactos/system32 FOR all)
Modified: trunk/reactos/dll/win32/iphlpapi/CMakeLists.txt
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/iphlpapi/CMakeLi…
==============================================================================
--- trunk/reactos/dll/win32/iphlpapi/CMakeLists.txt [iso-8859-1] (original)
+++ trunk/reactos/dll/win32/iphlpapi/CMakeLists.txt [iso-8859-1] Wed Nov 4 18:06:16 2015
@@ -25,7 +25,7 @@
iphlpapi.rc
${CMAKE_CURRENT_BINARY_DIR}/iphlpapi.def)
-set_module_type(iphlpapi win32dll UNICODE HOTPATCHABLE)
+set_module_type(iphlpapi win32dll UNICODE)
target_link_libraries(iphlpapi wine tdilib)
add_importlibs(iphlpapi icmp dhcpcsvc advapi32 ws2_32 msvcrt kernel32 ntdll)
add_pch(iphlpapi iphlpapi_private.h SOURCE)
Modified: trunk/reactos/dll/win32/kernel32/CMakeLists.txt
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/kernel32/CMakeLi…
==============================================================================
--- trunk/reactos/dll/win32/kernel32/CMakeLists.txt [iso-8859-1] (original)
+++ trunk/reactos/dll/win32/kernel32/CMakeLists.txt [iso-8859-1] Wed Nov 4 18:06:16 2015
@@ -103,7 +103,7 @@
kernel32.rc
${CMAKE_CURRENT_BINARY_DIR}/kernel32.def)
-set_module_type(kernel32 win32dll HOTPATCHABLE ENTRYPOINT DllMain 12)
+set_module_type(kernel32 win32dll ENTRYPOINT DllMain 12)
#############################################
## HACK FOR MSVC COMPILATION WITH win32dll ##
set_subsystem(kernel32 console)
Modified: trunk/reactos/dll/win32/kernel32_vista/CMakeLists.txt
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/kernel32_vista/C…
==============================================================================
--- trunk/reactos/dll/win32/kernel32_vista/CMakeLists.txt [iso-8859-1] (original)
+++ trunk/reactos/dll/win32/kernel32_vista/CMakeLists.txt [iso-8859-1] Wed Nov 4 18:06:16
2015
@@ -12,7 +12,7 @@
${CMAKE_CURRENT_BINARY_DIR}/kernel32_vista.def)
add_library(kernel32_vista SHARED ${SOURCE})
-set_module_type(kernel32_vista win32dll HOTPATCHABLE ENTRYPOINT DllMain 12)
+set_module_type(kernel32_vista win32dll ENTRYPOINT DllMain 12)
add_importlibs(kernel32_vista kernel32 ntdll)
add_dependencies(kernel32_vista psdk)
add_cd_file(TARGET kernel32_vista DESTINATION reactos/system32 FOR all)
Modified: trunk/reactos/dll/win32/shell32/CMakeLists.txt
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/shell32/CMakeLis…
==============================================================================
--- trunk/reactos/dll/win32/shell32/CMakeLists.txt [iso-8859-1] (original)
+++ trunk/reactos/dll/win32/shell32/CMakeLists.txt [iso-8859-1] Wed Nov 4 18:06:16 2015
@@ -81,7 +81,7 @@
${CMAKE_CURRENT_BINARY_DIR}/shell32_stubs.c
${CMAKE_CURRENT_BINARY_DIR}/shell32.def)
-set_module_type(shell32 win32dll UNICODE HOTPATCHABLE)
+set_module_type(shell32 win32dll UNICODE)
target_link_libraries(shell32 shellmenu shelldesktop atlnew wine uuid recyclebin)
add_delay_importlibs(shell32 uxtheme ole32 userenv version fmifs)
add_importlibs(shell32 advapi32 browseui gdi32 user32 powrprof comctl32 comdlg32 shdocvw
shlwapi devmgr winspool winmm msvcrt kernel32 ntdll)
Modified: trunk/reactos/dll/win32/winmm/CMakeLists.txt
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/winmm/CMakeLists…
==============================================================================
--- trunk/reactos/dll/win32/winmm/CMakeLists.txt [iso-8859-1] (original)
+++ trunk/reactos/dll/win32/winmm/CMakeLists.txt [iso-8859-1] Wed Nov 4 18:06:16 2015
@@ -21,7 +21,7 @@
winmm_res.rc
${CMAKE_CURRENT_BINARY_DIR}/winmm.def)
-set_module_type(winmm win32dll HOTPATCHABLE)
+set_module_type(winmm win32dll)
target_link_libraries(winmm wine ${PSEH_LIB})
add_importlibs(winmm advapi32 user32 msvcrt kernel32 ntdll)
add_pch(winmm winemm.h SOURCE)
Modified: trunk/reactos/dll/win32/xinput1_3/CMakeLists.txt
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/xinput1_3/CMakeL…
==============================================================================
--- trunk/reactos/dll/win32/xinput1_3/CMakeLists.txt [iso-8859-1] (original)
+++ trunk/reactos/dll/win32/xinput1_3/CMakeLists.txt [iso-8859-1] Wed Nov 4 18:06:16
2015
@@ -8,7 +8,7 @@
${CMAKE_CURRENT_BINARY_DIR}/xinput1_3.def)
add_library(xinput1_3 SHARED ${SOURCE} version.rc)
-set_module_type(xinput1_3 win32dll HOTPATCHABLE)
+set_module_type(xinput1_3 win32dll)
target_link_libraries(xinput1_3 wine)
add_importlibs(xinput1_3 msvcrt kernel32 ntdll)
add_cd_file(TARGET xinput1_3 DESTINATION reactos/system32 FOR all)
Modified: trunk/reactos/win32ss/user/user32/CMakeLists.txt
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/win32ss/user/user32/CMakeL…
==============================================================================
--- trunk/reactos/win32ss/user/user32/CMakeLists.txt [iso-8859-1] (original)
+++ trunk/reactos/win32ss/user/user32/CMakeLists.txt [iso-8859-1] Wed Nov 4 18:06:16
2015
@@ -69,7 +69,7 @@
user32.rc
${CMAKE_CURRENT_BINARY_DIR}/user32.def)
-set_module_type(user32 win32dll ENTRYPOINT DllMain 12 UNICODE HOTPATCHABLE)
+set_module_type(user32 win32dll ENTRYPOINT DllMain 12 UNICODE)
target_link_libraries(user32 user32_wsprintf wine win32ksys ${PSEH_LIB})
if(MSVC)