rvthtool/cmake/platform/win32.cmake
David Korth 43372103cb Port over CMake changes from rom-properties.
- CPUInstructionSetFlags.cmake: Add more CPU architectures.

- DirInstallPaths.cmake: Set ${TARGET_CPU_ARCH} and add more
  CPU architectures.

- FindNETTLE.cmake: Use ${TARGET_CPU_ARCH}.

- SplitDebugInformation.cmake: Add the `mold` workaround.

- options.cmake: Disable split debug by default on macOS.

- platform.cmake: Minor cleanups.

- gcc.cmake: Code coverage cleanup, check for "--no-undefined" and
  "--no-allow-shlib-undefined" (but only allow them on Linux),
  and check for "-ftree-vectorize".

- msvc.cmake:
  - Add: /we4477 /MP /guard:cf /guard:ehcont /permissive-
  - On i386 only: /SAFESEH
  - Disable /Zc:externC /Zc:noexceptTypes on Clang.
  - Disable thread-safe statics only on i386 and amd64.

- win32-gcc.cmake, win32-msvc.cmake:
  - Various flag changes.
2023-11-25 10:09:48 -05:00

32 lines
1.2 KiB
CMake

# Win32-specific CFLAGS/CXXFLAGS.
# Basic platform flags:
# - Enable strict type checking in the Windows headers.
# - Define WIN32_LEAN_AND_MEAN to reduce the number of Windows headers included.
# - Define NOMINMAX to disable the MIN() and MAX() macros.
ADD_DEFINITIONS(-DSTRICT -DWIN32_LEAN_AND_MEAN -DNOMINMAX)
# NOTE: This program only supports Unicode on Windows.
# No support for ANSI Windows, i.e. Win9x.
ADD_DEFINITIONS(-DUNICODE -D_UNICODE)
# Minimum Windows version for the SDK is Windows XP.
ADD_DEFINITIONS(-DWINVER=0x0501 -D_WIN32_WINNT=0x0501 -D_WIN32_IE=0x0600)
# Enable secure template overloads for C++.
# References:
# - MinGW's _mingw_secapi.h
# - http://msdn.microsoft.com/en-us/library/ms175759%28v=VS.100%29.aspx
ADD_DEFINITIONS(-D_CRT_SECURE_CPP_OVERLOAD_SECURE_NAMES=1)
ADD_DEFINITIONS(-D_CRT_SECURE_CPP_OVERLOAD_SECURE_NAMES_MEMORY=1)
ADD_DEFINITIONS(-D_CRT_SECURE_CPP_OVERLOAD_STANDARD_NAMES=1)
ADD_DEFINITIONS(-D_CRT_SECURE_CPP_OVERLOAD_STANDARD_NAMES_COUNT=1)
ADD_DEFINITIONS(-D_CRT_SECURE_CPP_OVERLOAD_STANDARD_NAMES_MEMORY=1)
# Compiler-specific Win32 flags.
IF(MSVC)
INCLUDE(cmake/platform/win32-msvc.cmake)
ELSE(MSVC)
INCLUDE(cmake/platform/win32-gcc.cmake)
ENDIF(MSVC)