[CMAKE]: Correctly set valid PE image version numbers for the OS subsystem (GCC builds), and image and OS version numbers from the NT OS version ReactOS is based on.

svn path=/trunk/; revision=75333
This commit is contained in:
Hermès Bélusca-Maïto 2017-07-13 20:50:49 +00:00
parent 899d12e786
commit 00d7ab957b
2 changed files with 13 additions and 5 deletions

View file

@ -581,12 +581,20 @@ function(set_module_type MODULE TYPE)
set_subsystem(${MODULE} ${__subsystem})
endif()
#set unicode definitions
# Set the PE image version numbers from the NT OS version ReactOS is based on
if (MSVC)
add_target_link_flags(${MODULE} "/VERSION:5.01")
else()
add_target_link_flags(${MODULE} "-Wl,--major-image-version,5 -Wl,--minor-image-version,01")
add_target_link_flags(${MODULE} "-Wl,--major-os-version,5 -Wl,--minor-os-version,01")
endif()
# Set unicode definitions
if(__module_UNICODE)
add_target_compile_definitions(${MODULE} UNICODE _UNICODE)
endif()
# set entry point
# Set entry point
if(__module_ENTRYPOINT OR (__module_ENTRYPOINT STREQUAL "0"))
list(GET __module_ENTRYPOINT 0 __entrypoint)
list(LENGTH __module_ENTRYPOINT __length)
@ -633,7 +641,7 @@ function(set_module_type MODULE TYPE)
endif()
endif()
#set base address
# Set base address
if(__module_IMAGEBASE)
set_image_base(${MODULE} ${__module_IMAGEBASE})
elseif(${TYPE} STREQUAL win32dll)
@ -662,7 +670,7 @@ function(set_module_type MODULE TYPE)
set_target_properties(${MODULE} PROPERTIES SUFFIX ".cpl")
endif()
# do compiler specific stuff
# Do compiler specific stuff
set_module_type_toolchain(${MODULE} ${TYPE})
endfunction()

View file

@ -289,7 +289,7 @@ function(set_entrypoint MODULE ENTRYPOINT)
endfunction()
function(set_subsystem MODULE SUBSYSTEM)
add_target_link_flags(${MODULE} "-Wl,--subsystem,${SUBSYSTEM}")
add_target_link_flags(${MODULE} "-Wl,--subsystem,${SUBSYSTEM}:5.01")
endfunction()
function(set_image_base MODULE IMAGE_BASE)