summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGravatar James Rowe2018-01-15 20:53:53 -0700
committerGravatar James Rowe2018-01-16 01:15:52 -0700
commite026b66bbbb78f3c43c067eb94675d4782fb70b6 (patch)
treed64dd737b71c7845c92b598c3e2aee4314343537
parentMerge pull request #25 from chris062689/master (diff)
downloadyuzu-e026b66bbbb78f3c43c067eb94675d4782fb70b6.tar.gz
yuzu-e026b66bbbb78f3c43c067eb94675d4782fb70b6.tar.xz
yuzu-e026b66bbbb78f3c43c067eb94675d4782fb70b6.zip
Build: Add unicorn as a submodule and build it if needed
Adds a cmake custom target that will build unicorn on first compile and uses this in the build scripts as well. Updates Appveyor and Travis build scripts to work with the new unicorn build, and updates the paths to all of the different artifacts.
-rw-r--r--.gitmodules3
-rwxr-xr-x.travis/linux/docker.sh10
-rwxr-xr-x.travis/macos/build.sh2
-rwxr-xr-x.travis/macos/deps.sh6
-rw-r--r--CMakeLists.txt25
-rw-r--r--appveyor.yml20
m---------externals/unicorn0
-rw-r--r--src/core/arm/unicorn/arm_unicorn.cpp2
8 files changed, 41 insertions, 27 deletions
diff --git a/.gitmodules b/.gitmodules
index 07479dd78..d5a7ade4f 100644
--- a/.gitmodules
+++ b/.gitmodules
@@ -19,3 +19,6 @@
19[submodule "lz4"] 19[submodule "lz4"]
20 path = externals/lz4 20 path = externals/lz4
21 url = http://github.com/lz4/lz4.git 21 url = http://github.com/lz4/lz4.git
22[submodule "unicorn"]
23 path = externals/unicorn
24 url = https://github.com/yuzu-emu/unicorn
diff --git a/.travis/linux/docker.sh b/.travis/linux/docker.sh
index a85225c5a..8a23b54b1 100755
--- a/.travis/linux/docker.sh
+++ b/.travis/linux/docker.sh
@@ -1,22 +1,16 @@
1#!/bin/bash -ex 1#!/bin/bash -ex
2 2
3apt-get update 3apt-get update
4apt-get install -y build-essential git libcurl4-openssl-dev libqt5opengl5-dev libsdl2-dev libssl-dev python qtbase5-dev wget 4apt-get install -y build-essential git libqt5opengl5-dev libsdl2-dev libssl-dev python qtbase5-dev wget
5 5
6# Get a recent version of CMake 6# Get a recent version of CMake
7wget https://cmake.org/files/v3.10/cmake-3.10.1-Linux-x86_64.sh 7wget https://cmake.org/files/v3.10/cmake-3.10.1-Linux-x86_64.sh
8sh cmake-3.10.1-Linux-x86_64.sh --exclude-subdir --prefix=/ --skip-license 8sh cmake-3.10.1-Linux-x86_64.sh --exclude-subdir --prefix=/ --skip-license
9 9
10mkdir /unicorn
11cd /unicorn
12git clone https://github.com/yuzu-emu/unicorn .
13UNICORN_ARCHS=aarch64 ./make.sh
14./make.sh install
15
16cd /yuzu 10cd /yuzu
17 11
18mkdir build && cd build 12mkdir build && cd build
19cmake .. -DUSE_SYSTEM_CURL=ON -DCMAKE_BUILD_TYPE=Release 13cmake .. -DYUZU_BUILD_UNICORN=ON -DCMAKE_BUILD_TYPE=Release
20make -j4 14make -j4
21 15
22ctest -VV -C Release 16ctest -VV -C Release
diff --git a/.travis/macos/build.sh b/.travis/macos/build.sh
index e1c54af55..177e8ac3b 100755
--- a/.travis/macos/build.sh
+++ b/.travis/macos/build.sh
@@ -8,7 +8,7 @@ export UNICORNDIR=$(pwd)/externals/unicorn
8 8
9mkdir build && cd build 9mkdir build && cd build
10cmake --version 10cmake --version
11cmake .. -DUSE_SYSTEM_CURL=ON -DCMAKE_OSX_ARCHITECTURES="x86_64;x86_64h" -DCMAKE_BUILD_TYPE=Release 11cmake .. -DYUZU_BUILD_UNICORN=ON -DCMAKE_OSX_ARCHITECTURES="x86_64;x86_64h" -DCMAKE_BUILD_TYPE=Release
12make -j4 12make -j4
13 13
14ctest -VV -C Release 14ctest -VV -C Release
diff --git a/.travis/macos/deps.sh b/.travis/macos/deps.sh
index 7dea80438..b46482bbe 100755
--- a/.travis/macos/deps.sh
+++ b/.travis/macos/deps.sh
@@ -2,9 +2,3 @@
2 2
3brew update 3brew update
4brew install dylibbundler p7zip qt5 sdl2 4brew install dylibbundler p7zip qt5 sdl2
5
6mkdir externals/unicorn
7pushd externals/unicorn
8git clone https://github.com/yuzu-emu/unicorn .
9UNICORN_ARCHS=aarch64 ./make.sh macos-universal-no
10popd
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 3da8465b9..f1a4d0152 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -224,6 +224,31 @@ if (YUZU_USE_BUNDLED_UNICORN)
224 set(LIBUNICORN_INCLUDE_DIR "${UNICORN_PREFIX}/include" CACHE PATH "Path to Unicorn headers") 224 set(LIBUNICORN_INCLUDE_DIR "${UNICORN_PREFIX}/include" CACHE PATH "Path to Unicorn headers")
225 set(LIBUNICORN_LIBRARY "${UNICORN_PREFIX}/lib/x64/unicorn_dynload.lib" CACHE PATH "Path to Unicorn library") 225 set(LIBUNICORN_LIBRARY "${UNICORN_PREFIX}/lib/x64/unicorn_dynload.lib" CACHE PATH "Path to Unicorn library")
226 set(UNICORN_DLL_DIR "${UNICORN_PREFIX}/lib/x64/" CACHE PATH "Path to unicorn.dll") 226 set(UNICORN_DLL_DIR "${UNICORN_PREFIX}/lib/x64/" CACHE PATH "Path to unicorn.dll")
227elseif (YUZU_BUILD_UNICORN)
228 if (MSVC)
229 message(FATAL_ERROR "Cannot build unicorn on msvc. Use YUZU_USE_BUNDLED_UNICORN instead")
230 elseif (MINGW)
231 set(UNICORN_LIB_NAME "unicorn.a")
232 else()
233 set(UNICORN_LIB_NAME "libunicorn.a")
234 endif()
235
236 set(UNICORN_FOUND YES)
237 set(UNICORN_PREFIX ${CMAKE_SOURCE_DIR}/externals/unicorn)
238 set(LIBUNICORN_LIBRARY "${UNICORN_PREFIX}/${UNICORN_LIB_NAME}" CACHE PATH "Path to Unicorn library")
239 set(LIBUNICORN_INCLUDE_DIR "${UNICORN_PREFIX}/include" CACHE PATH "Path to Unicorn headers")
240 set(UNICORN_DLL_DIR "${UNICORN_PREFIX}/" CACHE PATH "Path to unicorn dynamic library")
241
242 add_custom_command(OUTPUT ${LIBUNICORN_LIBRARY}
243 COMMAND ${CMAKE_COMMAND} -E env UNICORN_ARCHS="aarch64" /bin/sh make.sh
244 WORKING_DIRECTORY ${UNICORN_PREFIX}
245 )
246 # ALL makes this custom target build every time
247 # but it won't actually build if LIBUNICORN_LIBRARY exists
248 add_custom_target(unicorn-build ALL
249 DEPENDS ${LIBUNICORN_LIBRARY}
250 )
251 unset(UNICORN_LIB_NAME)
227else() 252else()
228 find_package(Unicorn REQUIRED) 253 find_package(Unicorn REQUIRED)
229endif() 254endif()
diff --git a/appveyor.yml b/appveyor.yml
index f491e5f0b..9d2aa156b 100644
--- a/appveyor.yml
+++ b/appveyor.yml
@@ -28,7 +28,6 @@ install:
28 if ($env:BUILD_TYPE -eq 'mingw') { 28 if ($env:BUILD_TYPE -eq 'mingw') {
29 $dependencies = "mingw64/mingw-w64-x86_64-cmake", 29 $dependencies = "mingw64/mingw-w64-x86_64-cmake",
30 "mingw64/mingw-w64-x86_64-qt5", 30 "mingw64/mingw-w64-x86_64-qt5",
31 "mingw64/mingw-w64-x86_64-curl",
32 "mingw64/mingw-w64-x86_64-SDL2" 31 "mingw64/mingw-w64-x86_64-SDL2"
33 # redirect err to null to prevent warnings from becoming errors 32 # redirect err to null to prevent warnings from becoming errors
34 # workaround to prevent pacman from failing due to cyclical dependencies 33 # workaround to prevent pacman from failing due to cyclical dependencies
@@ -42,9 +41,9 @@ before_build:
42 - ps: | 41 - ps: |
43 if ($env:BUILD_TYPE -eq 'msvc') { 42 if ($env:BUILD_TYPE -eq 'msvc') {
44 # redirect stderr and change the exit code to prevent powershell from cancelling the build if cmake prints a warning 43 # redirect stderr and change the exit code to prevent powershell from cancelling the build if cmake prints a warning
45 cmd /C 'cmake -G "Visual Studio 15 2017 Win64" -DYUZU_USE_BUNDLED_QT=1 -DYUZU_USE_BUNDLED_SDL2=1 -DYUZU_USE_BUNDLED_UNICORN=1 -DCMAKE_USE_OPENSSL=0 .. 2>&1 && exit 0' 44 cmd /C 'cmake -G "Visual Studio 15 2017 Win64" -DYUZU_USE_BUNDLED_QT=1 -DYUZU_USE_BUNDLED_SDL2=1 -DYUZU_USE_BUNDLED_UNICORN=1 .. 2>&1 && exit 0'
46 } else { 45 } else {
47 C:\msys64\usr\bin\bash.exe -lc "cmake -G 'MSYS Makefiles' -DUSE_SYSTEM_CURL=1 -DYUZU_USE_BUNDLED_CURL=1 -DCMAKE_BUILD_TYPE=Release .. 2>&1" 46 C:\msys64\usr\bin\bash.exe -lc "cmake -G 'MSYS Makefiles' -DYUZU_BUILD_UNICORN=1 -DCMAKE_BUILD_TYPE=Release .. 2>&1"
48 } 47 }
49 - cd .. 48 - cd ..
50 49
@@ -81,11 +80,12 @@ after_build:
81 $env:BUILD_SYMBOLS = $MSVC_BUILD_PDB 80 $env:BUILD_SYMBOLS = $MSVC_BUILD_PDB
82 $env:BUILD_UPDATE = $MSVC_SEVENZIP 81 $env:BUILD_UPDATE = $MSVC_SEVENZIP
83 82
84 7z a -tzip $MSVC_BUILD_PDB .\msvc_build\bin\release\*.pdb 83 mkdir pdb
85 rm .\msvc_build\bin\release\*.pdb 84 Get-ChildItem ".\msvc_build\bin\" -Recurse -Filter "*.pdb" | Copy-Item -destination .\pdb
85 7z a -tzip $MSVC_BUILD_PDB .\pdb\*.pdb
86 86
87 mkdir $RELEASE_DIST 87 mkdir $RELEASE_DIST
88 Copy-Item .\msvc_build\bin\release\* -Destination $RELEASE_DIST -Recurse 88 Get-ChildItem ".\msvc_build\bin\" -Recurse -Filter "yuzu*.exe" | Copy-Item -destination $RELEASE_DIST
89 Copy-Item .\license.txt -Destination $RELEASE_DIST 89 Copy-Item .\license.txt -Destination $RELEASE_DIST
90 Copy-Item .\README.md -Destination $RELEASE_DIST 90 Copy-Item .\README.md -Destination $RELEASE_DIST
91 7z a -tzip $MSVC_BUILD_ZIP $RELEASE_DIST\* 91 7z a -tzip $MSVC_BUILD_ZIP $RELEASE_DIST\*
@@ -104,16 +104,14 @@ after_build:
104 $env:BUILD_UPDATE = $MINGW_SEVENZIP 104 $env:BUILD_UPDATE = $MINGW_SEVENZIP
105 105
106 $CMAKE_SOURCE_DIR = "$env:APPVEYOR_BUILD_FOLDER" 106 $CMAKE_SOURCE_DIR = "$env:APPVEYOR_BUILD_FOLDER"
107 $CMAKE_BINARY_DIR = "$CMAKE_SOURCE_DIR/mingw_build" 107 $CMAKE_BINARY_DIR = "$CMAKE_SOURCE_DIR/mingw_build/bin"
108 $RELEASE_DIST = $RELEASE_DIST + "-mingw" 108 $RELEASE_DIST = $RELEASE_DIST + "-mingw"
109 109
110 mkdir $RELEASE_DIST 110 mkdir $RELEASE_DIST
111 mkdir $RELEASE_DIST/platforms 111 mkdir $RELEASE_DIST/platforms
112 112
113 # copy the compiled binaries and other release files to the release folder 113 # copy the compiled binaries and other release files to the release folder
114 Get-ChildItem "$CMAKE_BINARY_DIR" -Recurse -Filter "yuzu*.exe" | Copy-Item -destination $RELEASE_DIST 114 Get-ChildItem "$CMAKE_BINARY_DIR" -Filter "yuzu*.exe" | Copy-Item -destination $RELEASE_DIST
115 # copy the libcurl dll
116 Get-ChildItem "$CMAKE_BINARY_DIR" -Recurse -Filter "libcurl.dll" | Copy-Item -destination $RELEASE_DIST
117 Copy-Item -path "$CMAKE_SOURCE_DIR/license.txt" -destination $RELEASE_DIST 115 Copy-Item -path "$CMAKE_SOURCE_DIR/license.txt" -destination $RELEASE_DIST
118 Copy-Item -path "$CMAKE_SOURCE_DIR/README.md" -destination $RELEASE_DIST 116 Copy-Item -path "$CMAKE_SOURCE_DIR/README.md" -destination $RELEASE_DIST
119 # copy all the dll dependencies to the release folder 117 # copy all the dll dependencies to the release folder
@@ -122,7 +120,7 @@ after_build:
122 # QT dll dependencies 120 # QT dll dependencies
123 "libbz2-*.dll","libicudt*.dll","libicuin*.dll","libicuuc*.dll","libffi-*.dll", 121 "libbz2-*.dll","libicudt*.dll","libicuin*.dll","libicuuc*.dll","libffi-*.dll",
124 "libfreetype-*.dll","libglib-*.dll","libgobject-*.dll","libgraphite2.dll","libiconv-*.dll", 122 "libfreetype-*.dll","libglib-*.dll","libgobject-*.dll","libgraphite2.dll","libiconv-*.dll",
125 "libharfbuzz-*.dll","libintl-*.dll","libpcre-*.dll","libpcre16-*.dll","libpng16-*.dll", 123 "libharfbuzz-*.dll","libintl-*.dll","libpcre-*.dll","libpcre2-16-*.dll","libpcre16-*.dll","libpng16-*.dll",
126 # Runtime/Other dependencies 124 # Runtime/Other dependencies
127 "libgcc_s_seh-*.dll","libstdc++-*.dll","libwinpthread-*.dll","SDL2.dll","zlib1.dll" 125 "libgcc_s_seh-*.dll","libstdc++-*.dll","libwinpthread-*.dll","SDL2.dll","zlib1.dll"
128 foreach ($file in $MingwDLLs) { 126 foreach ($file in $MingwDLLs) {
diff --git a/externals/unicorn b/externals/unicorn
new file mode 160000
Subproject 73f45735354396766a4bfb26d0b96b06e5cf31b
diff --git a/src/core/arm/unicorn/arm_unicorn.cpp b/src/core/arm/unicorn/arm_unicorn.cpp
index 13f6c658c..0cd519ea3 100644
--- a/src/core/arm/unicorn/arm_unicorn.cpp
+++ b/src/core/arm/unicorn/arm_unicorn.cpp
@@ -11,7 +11,7 @@
11#include "core/hle/kernel/svc.h" 11#include "core/hle/kernel/svc.h"
12 12
13// Load Unicorn DLL once on Windows using RAII 13// Load Unicorn DLL once on Windows using RAII
14#ifdef _WIN32 14#ifdef MSVC
15#include <unicorn_dynload.h> 15#include <unicorn_dynload.h>
16struct LoadDll { 16struct LoadDll {
17private: 17private: