From 3a9778668aba3a19046a911f9bcb883bb35e393c Mon Sep 17 00:00:00 2001 From: scribam Date: Tue, 12 Jun 2018 20:03:53 +0200 Subject: [PATCH 1/3] asmjit: update build integration --- CMakeLists.txt | 4 +++- Utilities/JIT.h | 4 ++-- rpcs3/CMakeLists.txt | 6 ++++-- rpcs3/rpcs3.vcxproj | 8 ++++---- rpcs3_default.props | 2 +- 5 files changed, 14 insertions(+), 10 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 66b86f5f27..91790a47eb 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -8,7 +8,9 @@ if (WITH_GDB) add_definitions(-DWITH_GDB_DEBUGGER) endif() -set(ASMJIT_STATIC TRUE) +set(ASMJIT_EMBED TRUE) +set(ASMJIT_DIR "${CMAKE_CURRENT_LIST_DIR}/asmjit" CACHE PATH "Location of 'asmjit'") +include("${ASMJIT_DIR}/CMakeLists.txt") if (NOT CMAKE_BUILD_TYPE) message(STATUS "No build type selected, default to Release") diff --git a/Utilities/JIT.h b/Utilities/JIT.h index 1d27c4fbc0..6c3c792718 100644 --- a/Utilities/JIT.h +++ b/Utilities/JIT.h @@ -1,9 +1,9 @@ #pragma once -#define ASMJIT_STATIC +#define ASMJIT_EMBED #define ASMJIT_DEBUG -#include "asmjit.h" +#include #include #include diff --git a/rpcs3/CMakeLists.txt b/rpcs3/CMakeLists.txt index e700722283..72f61529d1 100644 --- a/rpcs3/CMakeLists.txt +++ b/rpcs3/CMakeLists.txt @@ -295,7 +295,6 @@ ${LLVM_INCLUDE_DIRS} "${RPCS3_SRC_DIR}/Crypto" "${RPCS3_SRC_DIR}/.." "${RPCS3_SRC_DIR}/../Utilities/yaml-cpp/include" -"${RPCS3_SRC_DIR}/../asmjit/src/asmjit" "${RPCS3_SRC_DIR}/../3rdparty/GSL/include" "${RPCS3_SRC_DIR}/../3rdparty/hidapi/hidapi" # Includes 3rdparty stuff that isn't included yet @@ -345,7 +344,6 @@ GLOB_RECURSE RPCS3_SRC "${RPCS3_SRC_DIR}/*.cpp" "${RPCS3_SRC_DIR}/../Utilities/*.cpp" -"${RPCS3_SRC_DIR}/../asmjit/src/asmjit/*.cpp" ) #File exclusion section @@ -380,6 +378,10 @@ endif() add_dependencies(rpcs3 GitVersion) +target_sources(rpcs3 PUBLIC ${ASMJIT_SRC}) +target_include_directories(rpcs3 PUBLIC ${ASMJIT_INCLUDE_DIR}) +target_link_libraries(rpcs3 ${ASMJIT_DEPS}) + if(NOT MSVC) find_package(GLEW 1.13.0 REQUIRED) target_link_libraries(rpcs3 GLEW::GLEW) diff --git a/rpcs3/rpcs3.vcxproj b/rpcs3/rpcs3.vcxproj index 8592927199..ecd9a90a1f 100644 --- a/rpcs3/rpcs3.vcxproj +++ b/rpcs3/rpcs3.vcxproj @@ -107,20 +107,20 @@ true - ..\3rdparty\hidapi\hidapi;.\;..\;..\asmjit\src\asmjit;..\Utilities\yaml-cpp\include;..\3rdparty\ffmpeg\WindowsInclude;..\3rdparty\cereal\include;..\3rdparty\ffmpeg\Windows\x86_64\Include;$(VC_IncludePath);$(WindowsSDK_IncludePath);$(UniversalCRT_IncludePath);..\3rdparty\minidx12\Include;..\3rdparty\GSL\include;..\3rdparty\libpng;..\3rdparty\GL;..\3rdparty\stblib;..\3rdparty\OpenAL\include;..\3rdparty\pugixml\src;..\3rdparty\Optional;..\3rdparty\discord-rpc\include + ..\3rdparty\hidapi\hidapi;.\;..\;..\asmjit\src;..\Utilities\yaml-cpp\include;..\3rdparty\ffmpeg\WindowsInclude;..\3rdparty\cereal\include;..\3rdparty\ffmpeg\Windows\x86_64\Include;$(VC_IncludePath);$(WindowsSDK_IncludePath);$(UniversalCRT_IncludePath);..\3rdparty\minidx12\Include;..\3rdparty\GSL\include;..\3rdparty\libpng;..\3rdparty\GL;..\3rdparty\stblib;..\3rdparty\OpenAL\include;..\3rdparty\pugixml\src;..\3rdparty\Optional;..\3rdparty\discord-rpc\include $(SolutionDir)lib\$(Configuration)-$(Platform)\;$(UniversalCRT_LibraryPath_x64);$(LibraryPath) - ..\3rdparty\hidapi\hidapi;.\;..\;..\asmjit\src\asmjit;..\Utilities\yaml-cpp\include;..\3rdparty\ffmpeg\WindowsInclude;..\3rdparty\cereal\include;..\3rdparty\ffmpeg\Windows\x86_64\Include;$(VC_IncludePath);$(WindowsSDK_IncludePath);$(UniversalCRT_IncludePath);..\3rdparty\minidx12\Include;..\3rdparty\GSL\include;..\3rdparty\libpng;..\3rdparty\GL;..\3rdparty\stblib;..\3rdparty\OpenAL\include;..\3rdparty\pugixml\src;..\3rdparty\Optional;..\3rdparty\discord-rpc\include + ..\3rdparty\hidapi\hidapi;.\;..\;..\asmjit\src;..\Utilities\yaml-cpp\include;..\3rdparty\ffmpeg\WindowsInclude;..\3rdparty\cereal\include;..\3rdparty\ffmpeg\Windows\x86_64\Include;$(VC_IncludePath);$(WindowsSDK_IncludePath);$(UniversalCRT_IncludePath);..\3rdparty\minidx12\Include;..\3rdparty\GSL\include;..\3rdparty\libpng;..\3rdparty\GL;..\3rdparty\stblib;..\3rdparty\OpenAL\include;..\3rdparty\pugixml\src;..\3rdparty\Optional;..\3rdparty\discord-rpc\include $(SolutionDir)lib\Debug-x64;$(SolutionDir)lib\$(Configuration)-$(Platform)\;$(UniversalCRT_LibraryPath_x64);$(LibraryPath) $(SolutionDir)lib\$(Configuration)-$(Platform)\;$(UniversalCRT_LibraryPath_x64);$(LibraryPath) - ..\3rdparty\hidapi\hidapi;.\;..\;..\asmjit\src\asmjit;..\Utilities\yaml-cpp\include;..\3rdparty\ffmpeg\WindowsInclude;..\3rdparty\cereal\include;..\3rdparty\ffmpeg\Windows\x86_64\Include;$(VC_IncludePath);$(WindowsSDK_IncludePath);$(UniversalCRT_IncludePath);..\3rdparty\minidx12\Include;..\3rdparty\GSL\include;..\3rdparty\libpng;..\3rdparty\GL;..\3rdparty\stblib;..\3rdparty\OpenAL\include;..\3rdparty\pugixml\src;..\3rdparty\Optional;..\3rdparty\discord-rpc\include + ..\3rdparty\hidapi\hidapi;.\;..\;..\asmjit\src;..\Utilities\yaml-cpp\include;..\3rdparty\ffmpeg\WindowsInclude;..\3rdparty\cereal\include;..\3rdparty\ffmpeg\Windows\x86_64\Include;$(VC_IncludePath);$(WindowsSDK_IncludePath);$(UniversalCRT_IncludePath);..\3rdparty\minidx12\Include;..\3rdparty\GSL\include;..\3rdparty\libpng;..\3rdparty\GL;..\3rdparty\stblib;..\3rdparty\OpenAL\include;..\3rdparty\pugixml\src;..\3rdparty\Optional;..\3rdparty\discord-rpc\include $(SolutionDir)lib\Release-x64;$(SolutionDir)lib\$(Configuration)-$(Platform)\;$(UniversalCRT_LibraryPath_x64);$(LibraryPath) - ..\3rdparty\hidapi\hidapi;.\;..\;..\asmjit\src\asmjit;..\Utilities\yaml-cpp\include;..\3rdparty\ffmpeg\WindowsInclude;..\3rdparty\cereal\include;..\3rdparty\ffmpeg\Windows\x86_64\Include;$(VC_IncludePath);$(WindowsSDK_IncludePath);$(UniversalCRT_IncludePath);..\3rdparty\minidx12\Include;..\3rdparty\GSL\include;..\3rdparty\libpng;..\3rdparty\GL;..\3rdparty\stblib;..\3rdparty\OpenAL\include;..\3rdparty\pugixml\src;..\3rdparty\Optional;..\3rdparty\discord-rpc\include + ..\3rdparty\hidapi\hidapi;.\;..\;..\asmjit\src;..\Utilities\yaml-cpp\include;..\3rdparty\ffmpeg\WindowsInclude;..\3rdparty\cereal\include;..\3rdparty\ffmpeg\Windows\x86_64\Include;$(VC_IncludePath);$(WindowsSDK_IncludePath);$(UniversalCRT_IncludePath);..\3rdparty\minidx12\Include;..\3rdparty\GSL\include;..\3rdparty\libpng;..\3rdparty\GL;..\3rdparty\stblib;..\3rdparty\OpenAL\include;..\3rdparty\pugixml\src;..\3rdparty\Optional;..\3rdparty\discord-rpc\include diff --git a/rpcs3_default.props b/rpcs3_default.props index 3dbcf77a13..2e0c6d3253 100644 --- a/rpcs3_default.props +++ b/rpcs3_default.props @@ -3,7 +3,7 @@ - .\;..\;..\asmjit\src\asmjit;..\Utilities\yaml-cpp\include;..\3rdparty\ffmpeg\WindowsInclude;..\3rdparty\cereal\include;..\3rdparty\ffmpeg\Windows\x86_64\Include;$(VC_IncludePath);$(WindowsSDK_IncludePath);$(UniversalCRT_IncludePath);..\3rdparty\minidx12\Include;..\3rdparty\GSL\include;..\3rdparty\libpng;..\3rdparty\GL;..\3rdparty\stblib;..\3rdparty\OpenAL\include;..\3rdparty\pugixml\src;..\3rdparty\hidapi\hidapi;..\3rdparty\Optional;..\3rdparty\xxhash + .\;..\;..\asmjit\src;..\Utilities\yaml-cpp\include;..\3rdparty\ffmpeg\WindowsInclude;..\3rdparty\cereal\include;..\3rdparty\ffmpeg\Windows\x86_64\Include;$(VC_IncludePath);$(WindowsSDK_IncludePath);$(UniversalCRT_IncludePath);..\3rdparty\minidx12\Include;..\3rdparty\GSL\include;..\3rdparty\libpng;..\3rdparty\GL;..\3rdparty\stblib;..\3rdparty\OpenAL\include;..\3rdparty\pugixml\src;..\3rdparty\hidapi\hidapi;..\3rdparty\Optional;..\3rdparty\xxhash $(SolutionDir)lib\$(Configuration)-$(Platform)\ $(SolutionDir)lib\$(Configuration)-$(Platform)\;$(UniversalCRT_LibraryPath_x64);$(LibraryPath) $(SolutionDir)tmp\$(ProjectName)-$(Configuration)-$(Platform)\ From ea8397fbabc058405247f12329feb1420ead29e3 Mon Sep 17 00:00:00 2001 From: scribam Date: Tue, 12 Jun 2018 22:19:10 +0200 Subject: [PATCH 2/3] cmake: don't use hardcoded lib names when using system ffmpeg and remove unneeded line --- rpcs3/CMakeLists.txt | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/rpcs3/CMakeLists.txt b/rpcs3/CMakeLists.txt index 72f61529d1..35e1b9112d 100644 --- a/rpcs3/CMakeLists.txt +++ b/rpcs3/CMakeLists.txt @@ -425,8 +425,7 @@ else() endif() target_link_libraries(rpcs3 ${CMAKE_DL_LIBS} ZLIB::ZLIB ${ADDITIONAL_LIBS}) if(USE_SYSTEM_FFMPEG) - link_libraries(${FFMPEG_LIBRARY_DIR}) - target_link_libraries(rpcs3 libavformat.so libavcodec.so libavutil.so libswscale.so) + target_link_libraries(rpcs3 ${FFMPEG_LIBRARIES}) else() target_link_libraries(rpcs3 libavformat.a libavcodec.a libavutil.a libswscale.a) endif() From 6f3a63df944b4d92418ba18bd307cf074b4375a5 Mon Sep 17 00:00:00 2001 From: scribam Date: Wed, 13 Jun 2018 18:41:28 +0200 Subject: [PATCH 3/3] fix compiler warning "-Winconsistent-missing-override" --- rpcs3/Emu/RSX/VK/VKHelpers.h | 10 +++++----- rpcs3/Emu/RSX/VK/VKOverlays.h | 2 +- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/rpcs3/Emu/RSX/VK/VKHelpers.h b/rpcs3/Emu/RSX/VK/VKHelpers.h index 10dbe23bee..8619477f4b 100644 --- a/rpcs3/Emu/RSX/VK/VKHelpers.h +++ b/rpcs3/Emu/RSX/VK/VKHelpers.h @@ -247,7 +247,7 @@ namespace vk vmaUnmapMemory(m_allocator, static_cast(mem_handle)); } - VkDeviceMemory get_vk_device_memory(mem_handle_t mem_handle) + VkDeviceMemory get_vk_device_memory(mem_handle_t mem_handle) override { VmaAllocationInfo alloc_info; @@ -255,7 +255,7 @@ namespace vk return alloc_info.deviceMemory; } - u64 get_vk_device_memory_offset(mem_handle_t mem_handle) + u64 get_vk_device_memory_offset(mem_handle_t mem_handle) override { VmaAllocationInfo alloc_info; @@ -311,7 +311,7 @@ namespace vk return (VkDeviceMemory)mem_handle; } - u64 get_vk_device_memory_offset(mem_handle_t /*mem_handle*/) + u64 get_vk_device_memory_offset(mem_handle_t /*mem_handle*/) override { return 0; } @@ -1476,7 +1476,7 @@ public: swapchain_images[index].second->do_dma_transfer(cmd); } - VkImage& get_image(u32 index) + VkImage& get_image(u32 index) override { return (VkImage&)(*swapchain_images[index].second.get()); } @@ -1720,7 +1720,7 @@ public: return queuePresentKHR(vk_present_queue, &present); } - VkImage& get_image(u32 index) + VkImage& get_image(u32 index) override { return (VkImage&)swapchain_images[index]; } diff --git a/rpcs3/Emu/RSX/VK/VKOverlays.h b/rpcs3/Emu/RSX/VK/VKOverlays.h index 5f32519be8..3c05fa3501 100644 --- a/rpcs3/Emu/RSX/VK/VKOverlays.h +++ b/rpcs3/Emu/RSX/VK/VKOverlays.h @@ -677,7 +677,7 @@ namespace vk m_ubo.unmap(); } - void emit_geometry(vk::command_buffer &cmd) + void emit_geometry(vk::command_buffer &cmd) override { //Split into groups of 4 u32 first = 0;