MSVC workarounds should apply to all non-MinGW builds

This commit is contained in:
David Hrdlička
2021-12-19 09:44:26 +01:00
parent 6809f379cd
commit 043ab9ce77
2 changed files with 10 additions and 10 deletions

View File

@@ -57,10 +57,10 @@ target_link_libraries(86Box cpu chipset mch dev mem fdd game cdrom zip mo hdd
net print scsi sio snd vid voodoo plat ui) net print scsi sio snd vid voodoo plat ui)
if(WIN32 AND ARCH STREQUAL "i386") if(WIN32 AND ARCH STREQUAL "i386")
if(MSVC) if(MINGW)
target_link_options(86Box PRIVATE "/LARGEADDRESSAWARE")
else()
target_link_options(86Box PRIVATE "LINKER:--large-address-aware") target_link_options(86Box PRIVATE "LINKER:--large-address-aware")
else()
target_link_options(86Box PRIVATE "LINKER:/LARGEADDRESSAWARE")
endif() endif()
endif() endif()

View File

@@ -27,18 +27,18 @@ if(NOT CPPTHREADS)
target_sources(plat PRIVATE win_thread.c) target_sources(plat PRIVATE win_thread.c)
endif() endif()
if(MSVC) if(NOT MINGW)
# MSVC complains when we include the manifest from 86Box.rc... # MSVC linker adds its own manifest to the executable, which fails if
# On the bright side, CMake supports passing the manifest as a source # we include ours in 86Box.rc. We therefore need to pass the manifest
# file when using MSVC, so we might just as well do that! # directly as as a source file, so the linker can use that instead.
target_compile_definitions(ui PRIVATE NO_INCLUDE_MANIFEST) set_property(SOURCE 86Box.rc PROPERTY COMPILE_DEFINITIONS NO_INCLUDE_MANIFEST)
target_sources(86Box PRIVATE 86Box.manifest) target_sources(86Box PRIVATE 86Box.manifest)
# Append null to resource strings (fixes file dialogs) # Append null to resource strings (fixes file dialogs)
set_property(SOURCE 86Box.rc PROPERTY COMPILE_FLAGS -n) set_property(SOURCE 86Box.rc PROPERTY COMPILE_FLAGS -n)
endif()
if(NOT MINGW) # `opendir` is only included in MinGW, so include an implementation
# for other builds.
target_sources(plat PRIVATE win_opendir.c) target_sources(plat PRIVATE win_opendir.c)
endif() endif()