rvthtool/cmake/platform/win32-msvc.cmake
David Korth f321fe5e65 Initial import of RVT-H Tool.
This program will allow for managing Nintendo RVT-H Reader devkits,
including dumping existing images and installing new images.

The current version doesn't actually do anything. It's mostly a copy
of the infrastructure from rom-properties, with some changes. In
particular, we're using CMake's TARGET_COMPILE_FEATURES() instead of
manually detecting C99 support.
2018-01-15 06:58:54 -05:00

65 lines
2.7 KiB
CMake

# Win32-specific CFLAGS/CXXFLAGS.
# For Microsoft Visual C++ compilers.
# Basic platform flags for MSVC:
# - wchar_t should be a distinct type. (MSVC 2002+)
IF(MSVC_VERSION GREATER 1200)
SET(RP_C_FLAGS_WIN32 "${RP_C_FLAGS_WIN32} /Zc:wchar_t")
ENDIF()
# NOTE: This program is Unicode only on Windows.
# No ANSI support.
# Subsystem and minimum Windows version:
# - If 32-bit: 5.00
# - If 64-bit: 5.02
# ROM Properties does NOT support ANSI Windows.
# MSVC 2010's minimum supported target OS is XP SP2.
# MSVC 2012 and later has a minimum subsystem value of 5.01.
# NOTE: CMake sets /subsystem:windows or /subsystem:console itself,
# but with the MSBUILD generator, that's *before* this one, which
# results in console programs being linked as Windows.
# Use the SET_WINDOWS_SUBSYSTEM(_target _subsystem) function defined in
# platform.cmake. That macro will only do anything if building with
# MSVC, since the variables won't be defined anywhere else.
# NOTE: MS_ENH_RSA_AES_PROV is only available starting with
# Windows XP. Because we're actually using some XP-specific
# functionality now, the minimum version is now Windows XP.
IF(MSVC AND CMAKE_CL_64)
# 64-bit, Unicode Windows only. (MSVC)
# (There is no 64-bit ANSI Windows.)
# Minimum target version is Windows Server 2003 / XP 64-bit.
SET(RP_WIN32_SUBSYSTEM_VERSION "5.02")
ELSEIF(NOT MSVC AND CMAKE_SIZEOF_VOID_P EQUAL 8)
# 64-bit, Unicode Windows only. (MinGW)
# (There is no 64-bit ANSI Windows.)
# Minimum target version is Windows Server 2003 / XP 64-bit.
SET(RP_WIN32_SUBSYSTEM_VERSION "5.02")
ELSE()
# 32-bit, Unicode Windows only.
IF(MSVC_VERSION GREATER 1600)
# MSVC 2012 or later.
# Minimum target version is Windows XP.
SET(MCRECOVER_LINKER_FLAGS_WIN32_EXE "/SUBSYSTEM:WINDOWS,5.01")
SET(MCRECOVER_LINKER_FLAGS_CONSOLE_EXE "/SUBSYSTEM:CONSOLE,5.01")
ELSE()
# MSVC 2010 or earlier.
SET(MCRECOVER_LINKER_FLAGS_WIN32_EXE "/SUBSYSTEM:WINDOWS,5.00")
SET(MCRECOVER_LINKER_FLAGS_CONSOLE_EXE "/SUBSYSTEM:CONSOLE,5.00")
ENDIF()
ENDIF()
SET(RP_LINKER_FLAGS_WIN32_EXE "/SUBSYSTEM:WINDOWS,${RP_WIN32_SUBSYSTEM_VERSION}")
SET(RP_LINKER_FLAGS_CONSOLE_EXE "/SUBSYSTEM:CONSOLE,${RP_WIN32_SUBSYSTEM_VERSION}")
UNSET(RP_WIN32_SUBSYSTEM_VERSION)
# Append the CFLAGS and LDFLAGS.
SET(RP_C_FLAGS_COMMON "${RP_C_FLAGS_COMMON} ${RP_C_FLAGS_WIN32}")
SET(RP_CXX_FLAGS_COMMON "${RP_CXX_FLAGS_COMMON} ${RP_C_FLAGS_WIN32} ${RP_CXX_FLAGS_WIN32}")
SET(RP_EXE_LINKER_FLAGS_COMMON "${RP_EXE_LINKER_FLAGS_COMMON} ${RP_EXE_LINKER_FLAGS_WIN32}")
SET(RP_SHARED_LINKER_FLAGS_COMMON "${RP_SHARED_LINKER_FLAGS_COMMON} ${RP_EXE_LINKER_FLAGS_WIN32}")
SET(RP_MODULE_LINKER_FLAGS_COMMON "${RP_MODULE_LINKER_FLAGS_COMMON} ${RP_EXE_LINKER_FLAGS_WIN32}")
# Unset temporary variables.
UNSET(RP_C_FLAGS_WIN32)
UNSET(RP_EXE_LINKER_FLAGS_WIN32)