summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorspycrab <spycrab@users.noreply.github.com>2020-02-13 20:31:49 +0100
committerGitHub <noreply@github.com>2020-02-13 20:31:49 +0100
commitd2b79df40b1e1c31ef8057a8e6600a6e1eb3f852 (patch)
treebb448fdeac82c97d678f0a4965ad44290e9ceb71
parenta9dc4ac3f0eb692fb0c18cf3b5bd513c909117db (diff)
parent213a9adcffe33c9a15993a31d142d74d2b4cc128 (diff)
Merge pull request #8627 from spycrab/cmake_vs_arm
CMake: Fix building ARM64 on Windows
-rw-r--r--CMakeLists.txt9
-rw-r--r--CMakeSettings.json46
-rw-r--r--Source/Core/Common/Arm64Emitter.cpp4
-rw-r--r--Source/Core/Common/CMakeLists.txt4
-rw-r--r--Source/Core/Common/Hash.cpp6
-rw-r--r--Source/Core/DolphinQt/CMakeLists.txt8
6 files changed, 72 insertions, 5 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 2422afa890..02d6916d86 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -112,6 +112,11 @@ set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/Binaries)
if (WIN32)
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_SOURCE_DIR}/Binary)
+
+ if (CMAKE_SYSTEM_PROCESSOR STREQUAL "aarch64")
+ string(APPEND CMAKE_RUNTIME_OUTPUT_DIRECTORY /ARM64)
+ endif()
+
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY_DEBUG ${CMAKE_RUNTIME_OUTPUT_DIRECTORY})
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY_RELEASE ${CMAKE_RUNTIME_OUTPUT_DIRECTORY})
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY_MINSIZEREL ${CMAKE_RUNTIME_OUTPUT_DIRECTORY})
@@ -200,9 +205,7 @@ elseif(_ARCH_64 AND CMAKE_SYSTEM_PROCESSOR MATCHES "x86_64|amd64|AMD64")
add_definitions(-D_M_X86_64=1)
check_and_add_flag(HAVE_SSE2 -msse2)
elseif(CMAKE_SYSTEM_PROCESSOR STREQUAL "aarch64")
- set(_M_ARM 1)
set(_M_ARM_64 1)
- add_definitions(-D_M_ARM=1)
add_definitions(-D_M_ARM_64=1)
# CRC instruction set is used in the CRC32 hash function
check_and_add_flag(HAVE_ARCH_ARMV8 -march=armv8-a+crc)
@@ -456,7 +459,7 @@ if(ENABLE_EGL)
endif()
if(ENCODE_FRAMEDUMPS)
- if(WIN32)
+ if(WIN32 AND _M_X86_64)
set(FFMPEG_DIR Externals/ffmpeg)
endif()
find_package(FFmpeg COMPONENTS avcodec avformat avutil swscale)
diff --git a/CMakeSettings.json b/CMakeSettings.json
index 3c6587e195..66db74ffad 100644
--- a/CMakeSettings.json
+++ b/CMakeSettings.json
@@ -29,6 +29,52 @@
"value": "${workspaceRoot}\\Externals\\Qt\\Qt5.14.1\\msvc2019_64\\lib\\cmake\\Qt5"
}
]
+ },
+ {
+ "name": "Release (arm64)",
+ "configurationType": "Release",
+ "generator": "Ninja",
+ "inheritEnvironments": [ "msvc_arm64_x64" ],
+ "buildCommandArgs": "",
+ "buildRoot": "${workspaceRoot}\\Build\\${name}",
+ "cmakeCommandArgs": "",
+ "variables": [
+ {
+ "name": "Qt5_DIR",
+ "value": "${workspaceRoot}\\Externals\\Qt\\Qt5.14.1\\msvc2019_arm64\\lib\\cmake\\Qt5"
+ },
+ {
+ "name": "CMAKE_SYSTEM_NAME",
+ "value": "Windows"
+ },
+ {
+ "name": "CMAKE_SYSTEM_PROCESSOR",
+ "value": "aarch64"
+ }
+ ]
+ },
+ {
+ "name": "Debug (arm64)",
+ "configurationType": "Debug",
+ "generator": "Ninja",
+ "inheritEnvironments": [ "msvc_arm64_x64" ],
+ "buildCommandArgs": "",
+ "buildRoot": "${workspaceRoot}\\Build\\${name}",
+ "cmakeCommandArgs": "",
+ "variables": [
+ {
+ "name": "Qt5_DIR",
+ "value": "${workspaceRoot}\\Externals\\Qt\\Qt5.14.1\\msvc2019_arm64\\lib\\cmake\\Qt5"
+ },
+ {
+ "name": "CMAKE_SYSTEM_NAME",
+ "value": "Windows"
+ },
+ {
+ "name": "CMAKE_SYSTEM_PROCESSOR",
+ "value": "aarch64"
+ }
+ ]
}
]
} \ No newline at end of file
diff --git a/Source/Core/Common/Arm64Emitter.cpp b/Source/Core/Common/Arm64Emitter.cpp
index 2790b50a75..caf27c707f 100644
--- a/Source/Core/Common/Arm64Emitter.cpp
+++ b/Source/Core/Common/Arm64Emitter.cpp
@@ -15,6 +15,10 @@
#include "Common/CommonTypes.h"
#include "Common/MathUtil.h"
+#ifdef _WIN32
+#include <Windows.h>
+#endif
+
namespace Arm64Gen
{
namespace
diff --git a/Source/Core/Common/CMakeLists.txt b/Source/Core/Common/CMakeLists.txt
index 0dd69b6c43..de68a145d7 100644
--- a/Source/Core/Common/CMakeLists.txt
+++ b/Source/Core/Common/CMakeLists.txt
@@ -156,9 +156,11 @@ elseif(WIN32)
PRIVATE
kernel32.lib
shlwapi.lib
- opengl32.lib
winmm.lib
)
+ if (_M_X86_64)
+ target_link_libraries(common PRIVATE opengl32.lib)
+ endif()
endif()
if(ANDROID)
diff --git a/Source/Core/Common/Hash.cpp b/Source/Core/Common/Hash.cpp
index ea2375f3c7..525f0b21e2 100644
--- a/Source/Core/Common/Hash.cpp
+++ b/Source/Core/Common/Hash.cpp
@@ -11,9 +11,13 @@
#include "Common/CommonFuncs.h"
#include "Common/Intrinsics.h"
-#if defined(_M_ARM_64) && !defined(_MSC_VER)
+#ifdef _M_ARM_64
+#ifdef _MSC_VER
+#include <intrin.h>
+#else
#include <arm_acle.h>
#endif
+#endif
namespace Common
{
diff --git a/Source/Core/DolphinQt/CMakeLists.txt b/Source/Core/DolphinQt/CMakeLists.txt
index 7812d21a8c..f0951cb3b5 100644
--- a/Source/Core/DolphinQt/CMakeLists.txt
+++ b/Source/Core/DolphinQt/CMakeLists.txt
@@ -296,6 +296,14 @@ PRIVATE
imgui
)
+if (WIN32)
+ target_link_libraries(dolphin-emu
+ PRIVATE
+ gdi32.lib
+ shell32.lib
+ )
+endif()
+
if(WIN32)
target_sources(dolphin-emu PRIVATE DolphinQt.manifest DolphinQt.rc)