Browse Source

Try to fix the target idendification when using MSVC

Panagiotis Christopoulos Charitos 7 months ago
parent
commit
2aa7817603
1 changed files with 7 additions and 1 deletions
  1. 7 1
      CMakeLists.txt

+ 7 - 1
CMakeLists.txt

@@ -110,7 +110,13 @@ if(GCC OR CLANG)
 		message(FATAL_ERROR "Couldn't find the target architecture from: ${target_arch} or ${CMAKE_SYSTEM_PROCESSOR}")
 	endif()
 elseif(MSVC)
-	set(X86 TRUE)
+	if(${CMAKE_CXX_COMPILER_ARCHITECTURE_ID} MATCHES "arm" OR ${CMAKE_CXX_COMPILER_ARCHITECTURE_ID} MATCHES "ARM")
+		set(ARM TRUE)
+	elseif(${CMAKE_CXX_COMPILER_ARCHITECTURE_ID} MATCHES "x64")
+		set(X86 TRUE)
+	else()
+		message(FATAL_ERROR "Couldn't find the target architecture from: ${CMAKE_CXX_COMPILER_ARCHITECTURE_ID}")
+	endif()
 else()
 	message(FATAL_ERROR "Couldn't find the target architecture")
 endif()