https://git.reactos.org/?p=reactos.git;a=commitdiff;h=a0dae6094e70bf2bee7d49e061bf8162909408dc

commit a0dae6094e70bf2bee7d49e061bf8162909408dc
Author:     Hermès Bélusca-Maïto <[email protected]>
AuthorDate: Sun May 20 21:59:40 2018 +0200
Commit:     Hermès Bélusca-Maïto <[email protected]>
CommitDate: Mon Oct 8 21:00:14 2018 +0200

    [WELCOME] Reduce Welcome's SUBSYSTEM requirements to WinNT 4 for x86 builds 
only, so that we can still show something in old NT OSes.
---
 base/setup/welcome/CMakeLists.txt | 23 +++++++++++++++++++++++
 1 file changed, 23 insertions(+)

diff --git a/base/setup/welcome/CMakeLists.txt 
b/base/setup/welcome/CMakeLists.txt
index e8b3f247fb..3ac8d946f4 100644
--- a/base/setup/welcome/CMakeLists.txt
+++ b/base/setup/welcome/CMakeLists.txt
@@ -4,4 +4,27 @@ add_rc_deps(welcome.rc ${welcome_rc_deps})
 add_executable(welcome welcome.c welcome.rc)
 set_module_type(welcome win32gui UNICODE)
 add_importlibs(welcome gdi32 user32 shell32 msvcrt kernel32 ntdll)
+
+# Reduce the required subsystem to WinNT 4.0 for i386 builds only.
+if(ARCH STREQUAL "i386")
+    if(MSVC)
+        # NOTE: We cannot use the following command:
+        #   add_target_link_flags(welcome "/SUBSYSTEM:WINDOWS,4.00")
+        # because it would act at the level of the LINK.EXE linker flags,
+        # which only accepts a subsystem version >= 5.10 (Windows XP+) on
+        # latest MSVC versions.
+        # So to work around this problem, we use a post-build command by
+        # employing EDITBIN.EXE that does not check the subsystem version.
+        #
+        add_custom_command(
+            TARGET welcome POST_BUILD
+            COMMAND editbin.exe /NOLOGO /SUBSYSTEM:WINDOWS,4.00 
$<TARGET_FILE:welcome>
+            VERBATIM)
+    else()
+        # The binutils linker does not set a lower limit on the subsystem.
+        # Otherwise we would use: objcopy --subsystem windows:4.00 
$<TARGET_FILE:welcome>
+        add_target_link_flags(welcome "-Wl,--subsystem,windows:4.00")
+    endif()
+endif()
+
 add_cd_file(TARGET welcome DESTINATION reactos NO_CAB FOR bootcd)

Reply via email to