diff --git a/build/CompilerAndLinker.cmake b/build/CompilerAndLinker.cmake index 69c0d13..a61b58a 100644 --- a/build/CompilerAndLinker.cmake +++ b/build/CompilerAndLinker.cmake @@ -45,6 +45,17 @@ else() set(DIRECTX_HOST_ARCH x64) endif() +#--- Check DIRECTX_ARCH value +if(CMAKE_SIZEOF_VOID_P EQUAL 8) + if(DIRECTX_ARCH MATCHES "x86|^arm$") + message(FATAL_ERROR "64-bit toolset mismatch detected for DIRECTX_ARCH setting") + endif() +elseif(CMAKE_SIZEOF_VOID_P EQUAL 4) + if(DIRECTX_ARCH MATCHES "x64|arm64") + message(FATAL_ERROR "32-bit toolset mismatch detected for DIRECTX_ARCH setting") + endif() +endif() + #--- Build with Unicode Win32 APIs per "UTF-8 Everywhere" if(WIN32) list(APPEND COMPILER_DEFINES _UNICODE UNICODE)