[CMAKE]: Correctly set valid PE image version numbers for the OS subsystem (GCC build...
[reactos.git] / reactos / sdk / cmake / CMakeMacros.cmake
index 8af76ea..850bb7f 100644 (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()