From e86bdb16019be278974fcab75255ae37cc600747 Mon Sep 17 00:00:00 2001
From: MerryMage <MerryMage@users.noreply.github.com>
Date: Sat, 13 Jan 2018 22:14:04 +0000
Subject: [PATCH] Fix build on macOS and linux

---
 .../{CopyCitraQt5Deps.cmake => CopyYuzuQt5Deps.cmake}     | 4 ++--
 .../{CopyCitraSDLDeps.cmake => CopyYuzuSDLDeps.cmake}     | 4 ++--
 src/core/hle/lock.cpp                                     | 2 --
 src/tests/core/memory/memory.cpp                          | 2 +-
 src/video_core/renderer_opengl/renderer_opengl.cpp        | 1 +
 src/yuzu/CMakeLists.txt                                   | 8 +++++---
 6 files changed, 11 insertions(+), 10 deletions(-)
 rename CMakeModules/{CopyCitraQt5Deps.cmake => CopyYuzuQt5Deps.cmake} (89%)
 rename CMakeModules/{CopyCitraSDLDeps.cmake => CopyYuzuSDLDeps.cmake} (68%)

diff --git a/CMakeModules/CopyCitraQt5Deps.cmake b/CMakeModules/CopyYuzuQt5Deps.cmake
similarity index 89%
rename from CMakeModules/CopyCitraQt5Deps.cmake
rename to CMakeModules/CopyYuzuQt5Deps.cmake
index 342d0b9157..ed24c742c8 100644
--- a/CMakeModules/CopyCitraQt5Deps.cmake
+++ b/CMakeModules/CopyYuzuQt5Deps.cmake
@@ -1,4 +1,4 @@
-function(copy_citra_Qt5_deps target_dir)
+function(copy_yuzu_Qt5_deps target_dir)
     include(WindowsCopyFiles)
     set(DLL_DEST "${CMAKE_BINARY_DIR}/bin/$<CONFIG>/")
     set(Qt5_DLL_DIR "${Qt5_DIR}/../../../bin")
@@ -14,4 +14,4 @@ function(copy_citra_Qt5_deps target_dir)
         Qt5Widgets$<$<CONFIG:Debug>:d>.*
     )
     windows_copy_files(yuzu ${Qt5_PLATFORMS_DIR} ${PLATFORMS} qwindows$<$<CONFIG:Debug>:d>.*)
-endfunction(copy_citra_Qt5_deps)
+endfunction(copy_yuzu_Qt5_deps)
diff --git a/CMakeModules/CopyCitraSDLDeps.cmake b/CMakeModules/CopyYuzuSDLDeps.cmake
similarity index 68%
rename from CMakeModules/CopyCitraSDLDeps.cmake
rename to CMakeModules/CopyYuzuSDLDeps.cmake
index 4f9e4aeb90..5963684f45 100644
--- a/CMakeModules/CopyCitraSDLDeps.cmake
+++ b/CMakeModules/CopyYuzuSDLDeps.cmake
@@ -1,5 +1,5 @@
-function(copy_citra_SDL_deps target_dir)
+function(copy_yuzu_SDL_deps target_dir)
     include(WindowsCopyFiles)
     set(DLL_DEST "${CMAKE_BINARY_DIR}/bin/$<CONFIG>/")
     windows_copy_files(${target_dir} ${SDL2_DLL_DIR} ${DLL_DEST} SDL2.dll)
-endfunction(copy_citra_SDL_deps)
+endfunction(copy_yuzu_SDL_deps)
diff --git a/src/core/hle/lock.cpp b/src/core/hle/lock.cpp
index 1c24c7ce95..be4bfce3bd 100644
--- a/src/core/hle/lock.cpp
+++ b/src/core/hle/lock.cpp
@@ -2,8 +2,6 @@
 // Licensed under GPLv2 or any later version
 // Refer to the license.txt file included.
 
-#pragma once
-
 #include <core/hle/lock.h>
 
 namespace HLE {
diff --git a/src/tests/core/memory/memory.cpp b/src/tests/core/memory/memory.cpp
index 671afb702b..165496a548 100644
--- a/src/tests/core/memory/memory.cpp
+++ b/src/tests/core/memory/memory.cpp
@@ -7,7 +7,7 @@
 #include "core/hle/kernel/process.h"
 #include "core/memory.h"
 
-TEST_CASE("Memory::IsValidVirtualAddress", "[core][memory]") {
+TEST_CASE("Memory::IsValidVirtualAddress", "[core][memory][!hide]") {
     SECTION("these regions should not be mapped on an empty process") {
         auto process = Kernel::Process::Create("");
         CHECK(Memory::IsValidVirtualAddress(*process, Memory::PROCESS_IMAGE_VADDR) == false);
diff --git a/src/video_core/renderer_opengl/renderer_opengl.cpp b/src/video_core/renderer_opengl/renderer_opengl.cpp
index 410b0e9595..a5df91604c 100644
--- a/src/video_core/renderer_opengl/renderer_opengl.cpp
+++ b/src/video_core/renderer_opengl/renderer_opengl.cpp
@@ -4,6 +4,7 @@
 
 #include <algorithm>
 #include <cstddef>
+#include <cstring>
 #include <cstdlib>
 #include <memory>
 #include <glad/glad.h>
diff --git a/src/yuzu/CMakeLists.txt b/src/yuzu/CMakeLists.txt
index 95d5217060..1ec6abbb42 100644
--- a/src/yuzu/CMakeLists.txt
+++ b/src/yuzu/CMakeLists.txt
@@ -70,7 +70,9 @@ else()
 endif()
 
 if (APPLE)
-    set(MACOSX_ICON "../../dist/citra.icns")
+    if (EXISTS "../../dist/yuzu.icns")
+        set(MACOSX_ICON "../../dist/yuzu.icns")
+    endif()
     set_source_files_properties(${MACOSX_ICON} PROPERTIES MACOSX_PACKAGE_LOCATION Resources)
     add_executable(yuzu MACOSX_BUNDLE ${SRCS} ${HEADERS} ${UI_HDRS} ${MACOSX_ICON})
     set_target_properties(yuzu PROPERTIES MACOSX_BUNDLE_INFO_PLIST ${CMAKE_CURRENT_SOURCE_DIR}/Info.plist)
@@ -89,7 +91,7 @@ if (MSVC)
     include(CopyCitraQt5Deps)
     include(CopyCitraSDLDeps)
     include(CopyYuzuUnicornDeps)
-    copy_citra_Qt5_deps(yuzu)
-    copy_citra_SDL_deps(yuzu)
+    copy_yuzu_Qt5_deps(yuzu)
+    copy_yuzu_SDL_deps(yuzu)
     copy_yuzu_unicorn_deps(yuzu)
 endif()