xref: /reactos/base/setup/welcome/CMakeLists.txt (revision 8e1fa034)
1
2file(GLOB welcome_rc_deps res/*.*)
3add_rc_deps(welcome.rc ${welcome_rc_deps})
4add_executable(welcome welcome.c welcome.rc)
5set_module_type(welcome win32gui UNICODE)
6add_importlibs(welcome gdi32 user32 shell32 msvcrt kernel32 ntdll)
7
8# Reduce the required subsystem to WinNT 4.0 for i386 builds only.
9if(ARCH STREQUAL "i386")
10    if(MSVC)
11        # NOTE: We cannot use the following command:
12        #   target_link_options(welcome PRIVATE "/SUBSYSTEM:WINDOWS,4.00")
13        # because it would act at the level of the LINK.EXE linker flags,
14        # which only accepts a subsystem version >= 5.10 (Windows XP+) on
15        # latest MSVC versions.
16        # So to work around this problem, we use a post-build command by
17        # employing EDITBIN.EXE that does not check the subsystem version.
18        #
19        add_custom_command(
20            TARGET welcome POST_BUILD
21            COMMAND editbin.exe /NOLOGO /SUBSYSTEM:WINDOWS,4.00 $<TARGET_FILE:welcome>
22            VERBATIM)
23    else()
24        # The binutils linker does not set a lower limit on the subsystem.
25        # Otherwise we would use: objcopy --subsystem windows:4.00 $<TARGET_FILE:welcome>
26        target_link_options(welcome PRIVATE "-Wl,--subsystem,windows:4.00")
27    endif()
28endif()
29
30add_cd_file(TARGET welcome DESTINATION reactos NO_CAB FOR bootcd)
31