From 0f678e631e24a3aeb58213ee8cbc3d9e189f9d91 Mon Sep 17 00:00:00 2001 From: Zopolis4 Date: Tue, 30 Aug 2022 09:30:53 +1000 Subject: [PATCH] Refactor CMake files --- CMakeLists.txt | 101 +++--- src/CMakeLists.txt | 98 ++---- src/Cafe/CMakeLists.txt | 540 ++++++++++++++++++++++++++++++--- src/Cemu/CMakeLists.txt | 77 +++-- src/Cemu/Logging/CemuLogging.h | 6 +- src/Common/CMakeLists.txt | 77 ++--- src/asm/CMakeLists.txt | 51 ++-- src/audio/CMakeLists.txt | 53 ++-- src/config/CMakeLists.txt | 44 +-- src/gui/CMakeLists.txt | 180 ++++++++--- src/imgui/CMakeLists.txt | 25 +- src/input/CMakeLists.txt | 187 +++++------- src/resource/CMakeLists.txt | 22 +- src/util/CMakeLists.txt | 99 ++++-- src/util/helpers/StringBuf.h | 4 +- vcpkg.json | 9 +- 16 files changed, 1063 insertions(+), 510 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 82599f2a..e26ce364 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,71 +1,67 @@ -cmake_minimum_required(VERSION 3.21.1) +cmake_minimum_required(VERSION 3.24) option(PUBLIC_RELEASE "Compile with debug asserts disabled and no console" OFF) option(ENABLE_VCPKG "Enable the vcpkg package manager" ON) +# This needs to come before the project declaration for some reason +if (ENABLE_VCPKG) + set(CMAKE_TOOLCHAIN_FILE "${CMAKE_CURRENT_SOURCE_DIR}/dependencies/vcpkg/scripts/buildsystems/vcpkg.cmake") +endif() + +project(Cemu VERSION 0.1) +set(CMAKE_CXX_STANDARD 20) +set(CMAKE_CXX_STANDARD_REQUIRED ON) + if (PUBLIC_RELEASE) add_definitions(-DPUBLIC_RELEASE) set(CMAKE_INTERPROCEDURAL_OPTIMIZATION TRUE) # enable LTO endif() if (ENABLE_VCPKG) - set(VCPKG_OVERLAY_PORTS "${CMAKE_CURRENT_LIST_DIR}/dependencies/vcpkg_overlay_ports") - set(CMAKE_TOOLCHAIN_FILE "${CMAKE_CURRENT_SOURCE_DIR}/dependencies/vcpkg/scripts/buildsystems/vcpkg.cmake" - CACHE STRING "Vcpkg toolchain file") - # Set this so that all the various find_package() calls don't need an explicit - # CONFIG option - set(CMAKE_FIND_PACKAGE_PREFER_CONFIG TRUE) - if (WIN32) - set(VCPKG_TARGET_TRIPLET "x64-windows-static" CACHE STRING "") - endif() + set(VCPKG_LIBRARY_LINKAGE "static") + # Set this so that all the various find_package() calls don't need an explicit + # CONFIG option + set(CMAKE_FIND_PACKAGE_PREFER_CONFIG TRUE) endif() - -project(Cemu VERSION 0.1) - list(APPEND CMAKE_MODULE_PATH "${PROJECT_SOURCE_DIR}/cmake") -set(CMAKE_CXX_STANDARD 20) -set(CMAKE_CXX_STANDARD_REQUIRED ON) - -set(CMAKE_EXPORT_COMPILE_COMMANDS ON) +include_directories(src) set_property(GLOBAL PROPERTY USE_FOLDERS ON) if (MSVC) - set_property(DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR} PROPERTY VS_STARTUP_PROJECT CemuBin) + set_property(DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR} PROPERTY VS_STARTUP_PROJECT Cemu) endif() if (MSVC) - set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /EHsc") - set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /fp:precise") # floating point model: precise - set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /GT") # fiber safe optimizations + add_compile_options(/EHsc) + add_compile_options(/fp:precise) # floating point model: precise + add_compile_options(/GT) # fiber safe optimizations + add_compile_options(/MDd) if (PUBLIC_RELEASE) message(STATUS "Using additional optimization flags for MSVC") - set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /Oi /Ot") # enable intrinsic functions, favor speed + add_compile_options(/Oi /Ot) # enable intrinsic functions, favor speed endif() endif() -option(ENABLE_OPENGL "Enables the OpenGL backend" ON) -option(ENABLE_VULKAN "Enables the Vulkan backend" ON) +option(ENABLE_OPENGL "Enables the OpenGL video backend" ON) +option(ENABLE_VULKAN "Enables the Vulkan video backend" ON) option(ENABLE_DISCORD_RPC "Enables the Discord Rich Presence feature" ON) +option(ENABLE_SDL "Enables the SDL input backend" ON) +option(ENABLE_CUBEB "Enabled cubeb audio backend" ON) +option(ENABLE_WXWIDGETS "Build with wxWidgets UI (Currently required)" ON) -# input backends if (WIN32) - option(ENABLE_XINPUT "Enables the usage of XInput" ON) - option(ENABLE_DIRECTINPUT "Enables the usage of DirectInput" ON) + option(ENABLE_XINPUT "Enables the XInput input backend" ON) + option(ENABLE_DIRECTINPUT "Enables the DirectInput input backend" ON) + option(ENABLE_DIRECTAUDIO "Enables the DirectAudio audio backend" ON) + option(ENABLE_XAUDIO "Enables the Xaudio audio backend" ON) +endif() + +if (ENABLE_DIRECTINPUT) add_definitions(-DHAS_DIRECTINPUT) endif() -option(ENABLE_SDL "Enables the SDLController backend" ON) - -# audio backends -if (WIN32) - option(ENABLE_DIRECTAUDIO "Enables the directaudio backend" ON) - option(ENABLE_XAUDIO "Enables the xaudio backend" ON) -endif() -option(ENABLE_CUBEB "Enabled cubeb backend" ON) - -option(ENABLE_WXWIDGETS "Build with wxWidgets UI (Currently required)" ON) set(THREADS_PREFER_PTHREAD_FLAG true) find_package(Threads REQUIRED) @@ -81,23 +77,23 @@ find_package(ZLIB REQUIRED) find_package(zstd MODULE REQUIRED) # MODULE so that zstd::zstd is available find_package(OpenSSL COMPONENTS Crypto SSL REQUIRED) find_package(glm REQUIRED) -find_package(fmt 7.0.0 REQUIRED) +find_package(fmt 7.0.2 EXACT REQUIRED) find_package(PNG REQUIRED) # glslang versions older than 11.11.0 define targets without a namespace if (NOT TARGET glslang::SPIRV AND TARGET SPIRV) - add_library(glslang::SPIRV ALIAS SPIRV) + add_library(glslang::SPIRV ALIAS SPIRV) endif() if (UNIX) - find_package(X11 REQUIRED) + find_package(X11 REQUIRED) endif() if (ENABLE_VULKAN) include_directories("dependencies/Vulkan-Headers/include") endif() -if (ENABLE_OPENGL) +if (ENABLE_OPENGL) find_package(OpenGL REQUIRED) endif() @@ -108,28 +104,25 @@ if (ENABLE_DISCORD_RPC) endif() if (ENABLE_WXWIDGETS) - find_package(wxWidgets 3.2 REQUIRED COMPONENTS base core gl propgrid xrc) + find_package(wxWidgets 3.2.0 REQUIRED COMPONENTS base core gl propgrid xrc) endif() if (ENABLE_CUBEB) - find_package(cubeb) - if (NOT cubeb_FOUND) - option(BUILD_TESTS "" OFF) - option(BUILD_TOOLS "" OFF) - option(BUNDLE_SPEEX "" OFF) - set(USE_WINMM OFF CACHE BOOL "") - add_subdirectory("dependencies/cubeb") - set_property(TARGET cubeb PROPERTY MSVC_RUNTIME_LIBRARY "MultiThreaded$<$:Debug>") - add_library(cubeb::cubeb ALIAS cubeb) - endif() - add_compile_definitions("HAS_CUBEB=1") + find_package(cubeb) + if (NOT cubeb_FOUND) + option(BUILD_TESTS "" OFF) + option(BUILD_TOOLS "" OFF) + option(BUNDLE_SPEEX "" OFF) + set(USE_WINMM OFF CACHE BOOL "") + add_subdirectory("dependencies/cubeb") + endif() endif() add_subdirectory("dependencies/ih264d") find_package(ZArchive) if (NOT ZArchive_FOUND) - add_subdirectory("dependencies/ZArchive") + add_subdirectory("dependencies/ZArchive") endif() add_subdirectory(src) diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index e903db4c..a98ef271 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -1,44 +1,29 @@ -project(cemuMain) - -option(CEMU_CXX_FLAGS "Additional flags used for compiling Cemu source code") -if(CEMU_CXX_FLAGS) - set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${CEMU_CXX_FLAGS}") +if (NOT CMAKE_SIZEOF_VOID_P EQUAL 8) + message(FATAL_ERROR "Pointers are not 64bit" ) endif() -if(CMAKE_SIZEOF_VOID_P EQUAL 8) - # all ok -else() - message( FATAL_ERROR "Pointers are not 64bit" ) -endif() +add_executable(Cemu main.cpp mainLLE.cpp) -if(MSVC) +target_precompile_headers(Cemu PRIVATE Common/precompiled.h) + +if (MSVC) add_definitions(-DWIN32_LEAN_AND_MEAN) add_definitions(-DCURL_STATICLIB) #add_definitions(-DVK_USE_PLATFORM_WIN32_KHR) - # _CRT_SECURE_NO_WARNINGS - # _WINSOCK_DEPRECATED_NO_WARNINGS - # _SILENCE_CXX17_CODECVT_HEADER_DEPRECATION_WARNING - # _SILENCE_ALL_CXX17_DEPRECATION_WARNINGS -elseif(UNIX) - if(NOT APPLE) - add_definitions(-DVK_USE_PLATFORM_XLIB_KHR) # legacy. Do we need to support XLIB surfaces? - add_definitions(-DVK_USE_PLATFORM_XCB_KHR) +elseif (UNIX) + if (CMAKE_CXX_COMPILER_ID STREQUAL "Clang" OR CMAKE_CXX_COMPILER_ID STREQUAL "GNU") + add_definitions(-fms-extensions) + add_definitions(-fpermissive) + add_definitions(-maes) endif() - add_definitions(-fms-extensions) - add_definitions(-fpermissive) - add_definitions(-maes) - # warnings - if(CMAKE_C_COMPILER_ID MATCHES "Clang") - add_compile_options(-Wno-ambiguous-reversed-operator) + if (NOT APPLE) + add_definitions(-DVK_USE_PLATFORM_XLIB_KHR) # legacy. Do we need to support XLIB surfaces? + add_definitions(-DVK_USE_PLATFORM_XCB_KHR) endif() - - add_compile_options(-Wno-switch -Wno-ignored-attributes -Wno-deprecated-enum-enum-conversion) endif() add_definitions(-DVK_NO_PROTOTYPES) -set(CMAKE_INCLUDE_CURRENT_DIR ON) - add_subdirectory(Common) add_subdirectory(gui) add_subdirectory(Cafe) @@ -51,49 +36,26 @@ add_subdirectory(imgui) add_subdirectory(resource) add_subdirectory(asm) -if(PUBLIC_RELEASE) -add_executable(CemuBin WIN32 -main.cpp -mainLLE.cpp -) -else() -add_executable(CemuBin -main.cpp -mainLLE.cpp -) +if (WIN32) + target_sources(Cemu PRIVATE resource/cemu.rc) + set_target_properties(Cemu PROPERTIES WIN32_EXECUTABLE TRUE) endif() -target_precompile_headers(CemuBin PRIVATE Common/precompiled.h) - -if(WIN32) - target_sources(CemuBin PRIVATE - resource/cemu.rc - ) -endif() - -set_property(TARGET CemuBin PROPERTY MSVC_RUNTIME_LIBRARY "MultiThreaded$<$:Debug>") - -set_target_properties(CemuBin PROPERTIES - RUNTIME_OUTPUT_DIRECTORY_DEBUG ${CMAKE_CURRENT_SOURCE_DIR}/../bin/ - RUNTIME_OUTPUT_DIRECTORY_RELEASE ${CMAKE_CURRENT_SOURCE_DIR}/../bin/ - OUTPUT_NAME "Cemu" - ) - -target_link_libraries(CemuBin PRIVATE - CemuAudio - CemuCafe - CemuCommon - CemuComponents - CemuConfig - CemuGui - CemuInput - CemuUtil +target_link_libraries(Cemu PRIVATE + Audio + Cafe + Common + Components + Config + Gui + Input + Util ) -target_link_libraries(CemuBin PRIVATE CemuAsm) -target_link_libraries(CemuBin PRIVATE SDL2::SDL2 SDL2::SDL2main) # is SDL2main needed? -target_link_libraries(CemuBin PRIVATE imguiImpl OpenGL::GL) +target_link_libraries(Cemu PRIVATE Assembly) +target_link_libraries(Cemu PRIVATE SDL2::SDL2) #SDL2::SDL2main) # is SDL2main needed? +target_link_libraries(Cemu PRIVATE imguiImpl OpenGL::GL) if (ENABLE_WXWIDGETS) - target_link_libraries(CemuBin PRIVATE wx::base wx::core) + target_link_libraries(Cemu PRIVATE wx::base wx::core) endif() diff --git a/src/Cafe/CMakeLists.txt b/src/Cafe/CMakeLists.txt index a4a60d0d..c5a6a500 100644 --- a/src/Cafe/CMakeLists.txt +++ b/src/Cafe/CMakeLists.txt @@ -1,50 +1,510 @@ -project(CemuCafe) +add_library(Cafe + Account/Account.cpp + Account/AccountError.h + Account/Account.h + CafeSystem.cpp + CafeSystem.h + Filesystem/fsc.cpp + Filesystem/fscDeviceHostFS.cpp + Filesystem/fscDeviceHostFS.h + Filesystem/fscDeviceRedirect.cpp + Filesystem/fscDeviceWua.cpp + Filesystem/fscDeviceWud.cpp + Filesystem/fsc.h + Filesystem/FST/FST.cpp + Filesystem/FST/FST.h + Filesystem/FST/fstUtil.h + Filesystem/FST/KeyCache.cpp + Filesystem/FST/KeyCache.h + Filesystem/WUD/wud.cpp + Filesystem/WUD/wud.h + GamePatch.cpp + GamePatch.h + GameProfile/GameProfile.cpp + GameProfile/GameProfile.h + GraphicPack/GraphicPack2.cpp + GraphicPack/GraphicPack2.h + GraphicPack/GraphicPack2PatchesApply.cpp + GraphicPack/GraphicPack2Patches.cpp + GraphicPack/GraphicPack2Patches.h + GraphicPack/GraphicPack2PatchesParser.cpp + GraphicPack/GraphicPack.cpp + GraphicPack/GraphicPackError.h + GraphicPack/GraphicPack.h + HW/ACR/ACR.cpp + HW/AI/AI.cpp + HW/AI/AI.h + HW/Common/HwReg.h + HW/Espresso/Const.h + HW/Espresso/Debugger/Debugger.cpp + HW/Espresso/Debugger/Debugger.h + HW/Espresso/Debugger/DebugSymbolStorage.cpp + HW/Espresso/Debugger/DebugSymbolStorage.h + HW/Espresso/EspressoISA.h + HW/Espresso/Interpreter/PPCInterpreterALU.hpp + HW/Espresso/Interpreter/PPCInterpreterFPU.cpp + HW/Espresso/Interpreter/PPCInterpreterHelper.h + HW/Espresso/Interpreter/PPCInterpreterHLE.cpp + HW/Espresso/Interpreter/PPCInterpreterImpl.cpp + HW/Espresso/Interpreter/PPCInterpreterInternal.h + HW/Espresso/Interpreter/PPCInterpreterLoadStore.hpp + HW/Espresso/Interpreter/PPCInterpreterMain.cpp + HW/Espresso/Interpreter/PPCInterpreterOPC.cpp + HW/Espresso/Interpreter/PPCInterpreterOPC.hpp + HW/Espresso/Interpreter/PPCInterpreterPS.cpp + HW/Espresso/Interpreter/PPCInterpreterSPR.hpp + HW/Espresso/PPCCallback.h + HW/Espresso/PPCScheduler.cpp + HW/Espresso/PPCSchedulerLLE.cpp + HW/Espresso/PPCState.h + HW/Espresso/PPCTimer.cpp + HW/Espresso/Recompiler/PPCFunctionBoundaryTracker.h + HW/Espresso/Recompiler/PPCRecompiler.cpp + HW/Espresso/Recompiler/PPCRecompiler.h + HW/Espresso/Recompiler/PPCRecompilerImlAnalyzer.cpp + HW/Espresso/Recompiler/PPCRecompilerImlGen.cpp + HW/Espresso/Recompiler/PPCRecompilerImlGenFPU.cpp + HW/Espresso/Recompiler/PPCRecompilerIml.h + HW/Espresso/Recompiler/PPCRecompilerImlOptimizer.cpp + HW/Espresso/Recompiler/PPCRecompilerImlRanges.cpp + HW/Espresso/Recompiler/PPCRecompilerImlRanges.h + HW/Espresso/Recompiler/PPCRecompilerImlRegisterAllocator2.cpp + HW/Espresso/Recompiler/PPCRecompilerImlRegisterAllocator.cpp + HW/Espresso/Recompiler/PPCRecompilerIntermediate.cpp + HW/Espresso/Recompiler/PPCRecompilerX64AVX.cpp + HW/Espresso/Recompiler/PPCRecompilerX64BMI.cpp + HW/Espresso/Recompiler/PPCRecompilerX64.cpp + HW/Espresso/Recompiler/PPCRecompilerX64FPU.cpp + HW/Espresso/Recompiler/PPCRecompilerX64Gen.cpp + HW/Espresso/Recompiler/PPCRecompilerX64GenFPU.cpp + HW/Espresso/Recompiler/PPCRecompilerX64.h + HW/Espresso/Recompiler/x64Emit.hpp + HW/Latte/Common/RegisterSerializer.cpp + HW/Latte/Common/RegisterSerializer.h + HW/Latte/Common/ShaderSerializer.cpp + HW/Latte/Common/ShaderSerializer.h + HW/Latte/Core/FetchShader.cpp + HW/Latte/Core/FetchShader.h + HW/Latte/Core/LatteAsyncCommands.cpp + HW/Latte/Core/LatteAsyncCommands.h + HW/Latte/Core/LatteBufferCache.cpp + HW/Latte/Core/LatteBufferCache.h + HW/Latte/Core/LatteBufferData.cpp + HW/Latte/Core/LatteCachedFBO.h + HW/Latte/Core/LatteCommandProcessor.cpp + HW/Latte/Core/LatteConst.h + HW/Latte/Core/LatteDefaultShaders.cpp + HW/Latte/Core/LatteDefaultShaders.h + HW/Latte/Core/LatteDraw.h + HW/Latte/Core/LatteGSCopyShaderParser.cpp + HW/Latte/Core/Latte.h + HW/Latte/Core/LatteIndices.cpp + HW/Latte/Core/LatteIndices.h + HW/Latte/Core/LatteOverlay.cpp + HW/Latte/Core/LatteOverlay.h + HW/Latte/Core/LattePerformanceMonitor.cpp + HW/Latte/Core/LattePerformanceMonitor.h + HW/Latte/Core/LattePM4.h + HW/Latte/Core/LatteQuery.cpp + HW/Latte/Core/LatteQueryObject.h + HW/Latte/Core/LatteRenderTarget.cpp + HW/Latte/Core/LatteRingBuffer.cpp + HW/Latte/Core/LatteRingBuffer.h + HW/Latte/Core/LatteShaderAssembly.h + HW/Latte/Core/LatteShaderCache.cpp + HW/Latte/Core/LatteShaderCache.h + HW/Latte/Core/LatteShader.cpp + HW/Latte/Core/LatteShaderGL.cpp + HW/Latte/Core/LatteShader.h + HW/Latte/Core/LatteSoftware.cpp + HW/Latte/Core/LatteSoftware.h + HW/Latte/Core/LatteStreamoutGPU.cpp + HW/Latte/Core/LatteSurfaceCopy.cpp + HW/Latte/Core/LatteTextureCache.cpp + HW/Latte/Core/LatteTexture.cpp + HW/Latte/Core/LatteTexture.h + HW/Latte/Core/LatteTextureLegacy.cpp + HW/Latte/Core/LatteTextureLoader.cpp + HW/Latte/Core/LatteTextureLoader.h + HW/Latte/Core/LatteTextureReadback.cpp + HW/Latte/Core/LatteTextureReadbackInfo.h + HW/Latte/Core/LatteTextureView.cpp + HW/Latte/Core/LatteTextureView.h + HW/Latte/Core/LatteThread.cpp + HW/Latte/Core/LatteTiming.cpp + HW/Latte/Core/LatteTiming.h + HW/Latte/ISA/LatteInstructions.h + HW/Latte/ISA/LatteReg.h + HW/Latte/ISA/RegDefines.h + HW/Latte/LatteAddrLib/AddrLibFastDecode.h + HW/Latte/LatteAddrLib/LatteAddrLib_Coord.cpp + HW/Latte/LatteAddrLib/LatteAddrLib.cpp + HW/Latte/LatteAddrLib/LatteAddrLib.h + HW/Latte/LegacyShaderDecompiler/LatteDecompilerAnalyzer.cpp + HW/Latte/LegacyShaderDecompiler/LatteDecompiler.cpp + HW/Latte/LegacyShaderDecompiler/LatteDecompilerEmitGLSLAttrDecoder.cpp + HW/Latte/LegacyShaderDecompiler/LatteDecompilerEmitGLSL.cpp + HW/Latte/LegacyShaderDecompiler/LatteDecompilerEmitGLSLHeader.hpp + HW/Latte/LegacyShaderDecompiler/LatteDecompiler.h + HW/Latte/LegacyShaderDecompiler/LatteDecompilerInstructions.h + HW/Latte/LegacyShaderDecompiler/LatteDecompilerInternal.h + HW/Latte/LegacyShaderDecompiler/LatteDecompilerRegisterDataTypeTracker.cpp + HW/Latte/Renderer/OpenGL/CachedFBOGL.h + HW/Latte/Renderer/OpenGL/LatteTextureGL.cpp + HW/Latte/Renderer/OpenGL/LatteTextureGL.h + HW/Latte/Renderer/OpenGL/LatteTextureViewGL.cpp + HW/Latte/Renderer/OpenGL/LatteTextureViewGL.h + HW/Latte/Renderer/OpenGL/OpenGLQuery.cpp + HW/Latte/Renderer/OpenGL/OpenGLRendererCore.cpp + HW/Latte/Renderer/OpenGL/OpenGLRenderer.cpp + HW/Latte/Renderer/OpenGL/OpenGLRenderer.h + HW/Latte/Renderer/OpenGL/OpenGLRendererStreamout.cpp + HW/Latte/Renderer/OpenGL/OpenGLRendererUniformData.cpp + HW/Latte/Renderer/OpenGL/OpenGLSurfaceCopy.cpp + HW/Latte/Renderer/OpenGL/OpenGLTextureReadback.h + HW/Latte/Renderer/OpenGL/RendererShaderGL.cpp + HW/Latte/Renderer/OpenGL/RendererShaderGL.h + HW/Latte/Renderer/OpenGL/TextureReadbackGL.cpp + HW/Latte/Renderer/Renderer.cpp + HW/Latte/Renderer/Renderer.h + HW/Latte/Renderer/RendererOuputShader.cpp + HW/Latte/Renderer/RendererOuputShader.h + HW/Latte/Renderer/RendererShader.cpp + HW/Latte/Renderer/RendererShader.h + HW/Latte/Renderer/Vulkan/CachedFBOVk.cpp + HW/Latte/Renderer/Vulkan/CachedFBOVk.h + HW/Latte/Renderer/Vulkan/LatteTextureViewVk.cpp + HW/Latte/Renderer/Vulkan/LatteTextureViewVk.h + HW/Latte/Renderer/Vulkan/LatteTextureVk.cpp + HW/Latte/Renderer/Vulkan/LatteTextureVk.h + HW/Latte/Renderer/Vulkan/RendererShaderVk.cpp + HW/Latte/Renderer/Vulkan/RendererShaderVk.h + HW/Latte/Renderer/Vulkan/TextureReadbackVk.cpp + HW/Latte/Renderer/Vulkan/VKRBase.h + HW/Latte/Renderer/Vulkan/VKRMemoryManager.cpp + HW/Latte/Renderer/Vulkan/VKRMemoryManager.h + HW/Latte/Renderer/Vulkan/VKRPipelineInfo.cpp + HW/Latte/Renderer/Vulkan/VsyncDriver.cpp + HW/Latte/Renderer/Vulkan/VsyncDriver.h + HW/Latte/Renderer/Vulkan/VulkanAPI.cpp + HW/Latte/Renderer/Vulkan/VulkanAPI.h + HW/Latte/Renderer/Vulkan/VulkanPipelineCompiler.cpp + HW/Latte/Renderer/Vulkan/VulkanPipelineCompiler.h + HW/Latte/Renderer/Vulkan/VulkanPipelineStableCache.cpp + HW/Latte/Renderer/Vulkan/VulkanPipelineStableCache.h + HW/Latte/Renderer/Vulkan/VulkanQuery.cpp + HW/Latte/Renderer/Vulkan/VulkanRendererCore.cpp + HW/Latte/Renderer/Vulkan/VulkanRenderer.cpp + HW/Latte/Renderer/Vulkan/VulkanRenderer.h + HW/Latte/Renderer/Vulkan/VulkanSurfaceCopy.cpp + HW/Latte/Renderer/Vulkan/VulkanTextureReadback.h + HW/Latte/ShaderInfo/ShaderDescription.cpp + HW/Latte/ShaderInfo/ShaderInfo.h + HW/Latte/ShaderInfo/ShaderInstanceInfo.cpp + HW/Latte/Transcompiler/LatteTC.cpp + HW/Latte/Transcompiler/LatteTCGenIR.cpp + HW/Latte/Transcompiler/LatteTC.h + HW/MMU/MMU.cpp + HW/MMU/MMU.h + HW/SI/SI.cpp + HW/SI/si.h + HW/VI/VI.cpp + IOSU/fsa/fsa_types.h + IOSU/fsa/iosu_fsa.cpp + IOSU/fsa/iosu_fsa.h + IOSU/iosu_ipc_common.h + IOSU/iosu_types_common.h + IOSU/kernel/iosu_kernel.cpp + IOSU/kernel/iosu_kernel.h + IOSU/legacy/iosu_acp.cpp + IOSU/legacy/iosu_acp.h + IOSU/legacy/iosu_act.cpp + IOSU/legacy/iosu_act.h + IOSU/legacy/iosu_boss.cpp + IOSU/legacy/iosu_boss.h + IOSU/legacy/iosu_crypto.cpp + IOSU/legacy/iosu_crypto.h + IOSU/legacy/iosu_fpd.cpp + IOSU/legacy/iosu_fpd.h + IOSU/legacy/iosu_ioctl.cpp + IOSU/legacy/iosu_ioctl.h + IOSU/legacy/iosu_mcp.cpp + IOSU/legacy/iosu_mcp.h + IOSU/legacy/iosu_nim.cpp + IOSU/legacy/iosu_nim.h + IOSU/nn/iosu_nn_service.cpp + IOSU/nn/iosu_nn_service.h + IOSU/PDM/iosu_pdm.cpp + IOSU/PDM/iosu_pdm.h + OS/common/OSCommon.cpp + OS/common/OSCommon.h + OS/common/OSUtil.h + OS/common/PPCConcurrentQueue.h + OS/libs/avm/avm.cpp + OS/libs/avm/avm.h + OS/libs/camera/camera.cpp + OS/libs/camera/camera.h + OS/libs/coreinit/coreinit_Alarm.cpp + OS/libs/coreinit/coreinit_Alarm.h + OS/libs/coreinit/coreinit_Atomic.cpp + OS/libs/coreinit/coreinit_Atomic.h + OS/libs/coreinit/coreinit_BSP.cpp + OS/libs/coreinit/coreinit_BSP.h + OS/libs/coreinit/coreinit_Callbacks.cpp + OS/libs/coreinit/coreinit_CodeGen.cpp + OS/libs/coreinit/coreinit_CodeGen.h + OS/libs/coreinit/coreinit_Coroutine.cpp + OS/libs/coreinit/coreinit_Coroutine.h + OS/libs/coreinit/coreinit.cpp + OS/libs/coreinit/coreinit_DynLoad.cpp + OS/libs/coreinit/coreinit_DynLoad.h + OS/libs/coreinit/coreinit_FG.cpp + OS/libs/coreinit/coreinit_FG.h + OS/libs/coreinit/coreinit_FS.cpp + OS/libs/coreinit/coreinit_FS.h + OS/libs/coreinit/coreinit_GHS.cpp + OS/libs/coreinit/coreinit_GHS.h + OS/libs/coreinit/coreinit.h + OS/libs/coreinit/coreinit_HWInterface.cpp + OS/libs/coreinit/coreinit_HWInterface.h + OS/libs/coreinit/coreinit_IM.cpp + OS/libs/coreinit/coreinit_IM.h + OS/libs/coreinit/coreinit_Init.cpp + OS/libs/coreinit/coreinit_IOS.cpp + OS/libs/coreinit/coreinit_IOS.h + OS/libs/coreinit/coreinit_IPCBuf.cpp + OS/libs/coreinit/coreinit_IPCBuf.h + OS/libs/coreinit/coreinit_IPC.cpp + OS/libs/coreinit/coreinit_IPC.h + OS/libs/coreinit/coreinit_LockedCache.cpp + OS/libs/coreinit/coreinit_LockedCache.h + OS/libs/coreinit/coreinit_MCP.cpp + OS/libs/coreinit/coreinit_MCP.h + OS/libs/coreinit/coreinit_MEM_BlockHeap.cpp + OS/libs/coreinit/coreinit_MEM_BlockHeap.h + OS/libs/coreinit/coreinit_MEM.cpp + OS/libs/coreinit/coreinit_MEM_ExpHeap.cpp + OS/libs/coreinit/coreinit_MEM_ExpHeap.h + OS/libs/coreinit/coreinit_MEM_FrmHeap.cpp + OS/libs/coreinit/coreinit_MEM_FrmHeap.h + OS/libs/coreinit/coreinit_MEM.h + OS/libs/coreinit/coreinit_Memory.cpp + OS/libs/coreinit/coreinit_Memory.h + OS/libs/coreinit/coreinit_MemoryMapping.cpp + OS/libs/coreinit/coreinit_MemoryMapping.h + OS/libs/coreinit/coreinit_MEM_UnitHeap.cpp + OS/libs/coreinit/coreinit_MEM_UnitHeap.h + OS/libs/coreinit/coreinit_MessageQueue.cpp + OS/libs/coreinit/coreinit_MessageQueue.h + OS/libs/coreinit/coreinit_Misc.cpp + OS/libs/coreinit/coreinit_Misc.h + OS/libs/coreinit/coreinit_MPQueue.cpp + OS/libs/coreinit/coreinit_MPQueue.h + OS/libs/coreinit/coreinit_OSScreen.cpp + OS/libs/coreinit/coreinit_OSScreen_font.h + OS/libs/coreinit/coreinit_OSScreen.h + OS/libs/coreinit/coreinit_OverlayArena.cpp + OS/libs/coreinit/coreinit_OverlayArena.h + OS/libs/coreinit/coreinit_Scheduler.cpp + OS/libs/coreinit/coreinit_Scheduler.h + OS/libs/coreinit/coreinit_Spinlock.cpp + OS/libs/coreinit/coreinit_Spinlock.h + OS/libs/coreinit/coreinit_Synchronization.cpp + OS/libs/coreinit/coreinit_SysHeap.cpp + OS/libs/coreinit/coreinit_SysHeap.h + OS/libs/coreinit/coreinit_SystemInfo.cpp + OS/libs/coreinit/coreinit_SystemInfo.h + OS/libs/coreinit/coreinit_Thread.cpp + OS/libs/coreinit/coreinit_Thread.h + OS/libs/coreinit/coreinit_ThreadQueue.cpp + OS/libs/coreinit/coreinit_Time.cpp + OS/libs/coreinit/coreinit_Time.h + OS/libs/dmae/dmae.cpp + OS/libs/dmae/dmae.h + OS/libs/drmapp/drmapp.cpp + OS/libs/drmapp/drmapp.h + OS/libs/erreula/erreula.cpp + OS/libs/erreula/erreula.h + OS/libs/gx2/GX2_AddrTest.cpp + OS/libs/gx2/GX2_Blit.cpp + OS/libs/gx2/GX2_Blit.h + OS/libs/gx2/GX2_Command.cpp + OS/libs/gx2/GX2_Command.h + OS/libs/gx2/GX2_ContextState.cpp + OS/libs/gx2/GX2.cpp + OS/libs/gx2/GX2_Draw.cpp + OS/libs/gx2/GX2_Draw.h + OS/libs/gx2/GX2_Event.cpp + OS/libs/gx2/GX2_Event.h + OS/libs/gx2/GX2.h + OS/libs/gx2/GX2_Memory.cpp + OS/libs/gx2/GX2_Memory.h + OS/libs/gx2/GX2_Misc.cpp + OS/libs/gx2/GX2_Misc.h + OS/libs/gx2/GX2_Query.cpp + OS/libs/gx2/GX2_Query.h + OS/libs/gx2/GX2_RenderTarget.cpp + OS/libs/gx2/GX2_Resource.cpp + OS/libs/gx2/GX2_Resource.h + OS/libs/gx2/GX2_Shader.cpp + OS/libs/gx2/GX2_Shader.h + OS/libs/gx2/GX2_shader_legacy.cpp + OS/libs/gx2/GX2_State.cpp + OS/libs/gx2/GX2_State.h + OS/libs/gx2/GX2_Streamout.cpp + OS/libs/gx2/GX2_Streamout.h + OS/libs/gx2/GX2_Surface_Copy.cpp + OS/libs/gx2/GX2_Surface_Copy.h + OS/libs/gx2/GX2_Surface.cpp + OS/libs/gx2/GX2_Surface.h + OS/libs/gx2/GX2_Texture.cpp + OS/libs/gx2/GX2_Texture.h + OS/libs/gx2/GX2_TilingAperture.cpp + OS/libs/h264_avc/H264Dec.cpp + OS/libs/h264_avc/h264dec.h + OS/libs/h264_avc/parser/H264Parser.cpp + OS/libs/h264_avc/parser/H264Parser.h + OS/libs/mic/mic.cpp + OS/libs/mic/mic.h + OS/libs/nlibcurl/nlibcurl.cpp + OS/libs/nlibcurl/nlibcurlDebug.hpp + OS/libs/nlibcurl/nlibcurl.h + OS/libs/nlibnss/nlibnss.cpp + OS/libs/nlibnss/nlibnss.h + OS/libs/nn_ac/nn_ac.cpp + OS/libs/nn_ac/nn_ac.h + OS/libs/nn_acp/nn_acp.cpp + OS/libs/nn_acp/nn_acp.h + OS/libs/nn_act/nn_act.cpp + OS/libs/nn_act/nn_act.h + OS/libs/nn_aoc/nn_aoc.cpp + OS/libs/nn_aoc/nn_aoc.h + OS/libs/nn_boss/nn_boss.cpp + OS/libs/nn_boss/nn_boss.h + OS/libs/nn_ccr/nn_ccr.cpp + OS/libs/nn_ccr/nn_ccr.h + OS/libs/nn_cmpt/nn_cmpt.cpp + OS/libs/nn_cmpt/nn_cmpt.h + OS/libs/nn_common.h + OS/libs/nn_ec/nn_ec.cpp + OS/libs/nn_ec/nn_ec.h + OS/libs/nn_fp/nn_fp.cpp + OS/libs/nn_fp/nn_fp.h + OS/libs/nn_idbe/nn_idbe.cpp + OS/libs/nn_idbe/nn_idbe.h + OS/libs/nn_ndm/nn_ndm.cpp + OS/libs/nn_ndm/nn_ndm.h + OS/libs/nn_nfp/AmiiboCrypto.h + OS/libs/nn_nfp/nn_nfp.cpp + OS/libs/nn_nfp/nn_nfp.h + OS/libs/nn_nim/nn_nim.cpp + OS/libs/nn_nim/nn_nim.h + OS/libs/nn_olv/nn_olv.cpp + OS/libs/nn_olv/nn_olv.h + OS/libs/nn_pdm/nn_pdm.cpp + OS/libs/nn_pdm/nn_pdm.h + OS/libs/nn_save/nn_save.cpp + OS/libs/nn_save/nn_save.h + OS/libs/nn_temp/nn_temp.cpp + OS/libs/nn_temp/nn_temp.h + OS/libs/nn_uds/nn_uds.cpp + OS/libs/nn_uds/nn_uds.h + OS/libs/nsyshid/nsyshid.cpp + OS/libs/nsyshid/nsyshid.h + OS/libs/nsyskbd/nsyskbd.cpp + OS/libs/nsyskbd/nsyskbd.h + OS/libs/nsysnet/nsysnet.cpp + OS/libs/nsysnet/nsysnet.h + OS/libs/padscore/padscore.cpp + OS/libs/padscore/padscore.h + OS/libs/proc_ui/proc_ui.cpp + OS/libs/proc_ui/proc_ui.h + OS/libs/snd_core/ax_aux.cpp + OS/libs/snd_core/ax_exports.cpp + OS/libs/snd_core/ax.h + OS/libs/snd_core/ax_internal.h + OS/libs/snd_core/ax_ist.cpp + OS/libs/snd_core/ax_mix.cpp + OS/libs/snd_core/ax_multivoice.cpp + OS/libs/snd_core/ax_out.cpp + OS/libs/snd_core/ax_voice.cpp + OS/libs/snd_user/snd_user.cpp + OS/libs/snd_user/snd_user.h + OS/libs/swkbd/swkbd.cpp + OS/libs/swkbd/swkbd.h + OS/libs/sysapp/sysapp.cpp + OS/libs/sysapp/sysapp.h + OS/libs/TCL/TCL.cpp + OS/libs/TCL/TCL.h + OS/libs/vpad/vpad.cpp + OS/libs/vpad/vpad.h + OS/libs/zlib125/zlib125.cpp + OS/libs/zlib125/zlib125.h + OS/RPL/elf.cpp + OS/RPL/rpl.cpp + OS/RPL/rpl_debug_symbols.cpp + OS/RPL/rpl_debug_symbols.h + OS/RPL/rpl.h + OS/RPL/rpl_structs.h + OS/RPL/rpl_symbol_storage.cpp + OS/RPL/rpl_symbol_storage.h + TitleList/BaseInfo.cpp + TitleList/BaseInfo.h + TitleList/GameInfo.h + TitleList/MetaInfo.cpp + TitleList/MetaInfo.h + TitleList/ParsedMetaXml.h + TitleList/SaveInfo.cpp + TitleList/SaveInfo.h + TitleList/SaveList.cpp + TitleList/SaveList.h + TitleList/TitleId.h + TitleList/TitleInfo.cpp + TitleList/TitleInfo.h + TitleList/TitleList.cpp + TitleList/TitleList.h +) -if((CMAKE_C_COMPILER_ID STREQUAL "GNU") OR (CMAKE_C_COMPILER_ID STREQUAL "Clang")) - add_compile_options(-mssse3 -mavx2) +target_precompile_headers(Cafe PRIVATE ../Common/precompiled.h) + +if (CMAKE_CXX_COMPILER_ID STREQUAL "GNU" OR CMAKE_C_COMPILER_ID STREQUAL "Clang") + add_compile_options(-mssse3 -mavx2) endif() -file(GLOB_RECURSE CPP_FILES *.cpp) -file(GLOB_RECURSE H_FILES *.h) -add_library(CemuCafe ${CPP_FILES} ${H_FILES}) +target_link_libraries(Cafe PRIVATE + Assembly + Audio + Common + Components + Config + Gui + Input + Resource + Util +) -set_property(TARGET CemuCafe PROPERTY MSVC_RUNTIME_LIBRARY "MultiThreaded$<$:Debug>") - -target_precompile_headers(CemuCafe PRIVATE ../Common/precompiled.h) - -target_include_directories(CemuCafe PUBLIC "../") - -target_link_libraries(CemuCafe PRIVATE - CemuAsm - CemuAudio - CemuCommon - CemuComponents - CemuConfig - CemuGui - CemuInput - CemuResource - CemuUtil - imguiImpl - Boost::headers - Boost::nowide - CURL::libcurl - fmt::fmt - glslang::SPIRV - ih264d - imgui::imgui - OpenSSL::Crypto - OpenSSL::SSL - PNG::PNG - pugixml::pugixml - ZArchive::zarchive - ZLIB::ZLIB - zstd::zstd +target_link_libraries(Cafe PRIVATE + imguiImpl + Boost::headers + Boost::nowide + CURL::libcurl + fmt::fmt + glslang::SPIRV + ih264d + imgui::imgui + OpenSSL::Crypto + OpenSSL::SSL + PNG::PNG + pugixml::pugixml + ZArchive::zarchive + ZLIB::ZLIB + zstd::zstd ) if (ENABLE_WXWIDGETS) - target_link_libraries(CemuCafe PRIVATE wx::base wx::core) + target_link_libraries(Cafe PRIVATE wx::base wx::core) endif() -if(WIN32) - target_link_libraries(CemuCafe PRIVATE iphlpapi) +if (WIN32) + target_link_libraries(Cafe PRIVATE iphlpapi) endif() diff --git a/src/Cemu/CMakeLists.txt b/src/Cemu/CMakeLists.txt index b8ceb1d1..7fe0c824 100644 --- a/src/Cemu/CMakeLists.txt +++ b/src/Cemu/CMakeLists.txt @@ -1,32 +1,61 @@ -project(CemuComponents) +add_library(Components + ExpressionParser/ExpressionParser.cpp + ExpressionParser/ExpressionParser.h + FileCache/FileCache.cpp + FileCache/FileCache.h + Logging/CemuDebugLogging.h + Logging/CemuLogging.cpp + Logging/CemuLogging.h + napi/napi.h + napi/napi_act.cpp + napi/napi_ec.cpp + napi/napi_helper.cpp + napi/napi_helper.h + napi/napi_idbe.cpp + napi/napi_version.cpp + ncrypto/ncrypto.cpp + ncrypto/ncrypto.h + nex/nex.cpp + nex/nex.h + nex/nexFriends.cpp + nex/nexFriends.h + nex/nexThread.cpp + nex/nexThread.h + nex/nexTypes.h + nex/prudp.cpp + nex/prudp.h + PPCAssembler/ppcAssembler.cpp + PPCAssembler/ppcAssembler.h + Tools/DownloadManager/DownloadManager.cpp + Tools/DownloadManager/DownloadManager.h +) -file(GLOB_RECURSE CPP_FILES *.cpp) -file(GLOB_RECURSE H_FILES *.h) -add_library(CemuComponents ${CPP_FILES} ${H_FILES}) +target_precompile_headers(Components PRIVATE ../Common/precompiled.h) -set_property(TARGET CemuComponents PROPERTY MSVC_RUNTIME_LIBRARY "MultiThreaded$<$:Debug>") +target_link_libraries(Components PRIVATE + Cafe + Common + Config + Gui + Util +) -target_precompile_headers(CemuComponents PRIVATE ../Common/precompiled.h) - -target_include_directories(CemuComponents PUBLIC "../") - -target_link_libraries(CemuComponents PRIVATE - CemuCafe - CemuCommon - CemuConfig - CemuGui - CemuUtil - Boost::headers - CURL::libcurl - OpenSSL::Crypto - OpenSSL::SSL - pugixml::pugixml - ZLIB::ZLIB +target_link_libraries(Components PRIVATE + Boost::headers + CURL::libcurl + OpenSSL::Crypto + OpenSSL::SSL + pugixml::pugixml + ZLIB::ZLIB ) # PUBLIC because fmt/format.h is included in ExpressionParser/ExpressionParser.h -target_link_libraries(CemuComponents PUBLIC fmt::fmt) +target_link_libraries(Components PUBLIC fmt::fmt) -if(ENABLE_DISCORD_RPC) -target_link_libraries(CemuComponents PRIVATE discord-rpc) +if (ENABLE_DISCORD_RPC) + target_sources(Components PRIVATE + DiscordPresence/DiscordPresence.cpp + DiscordPresence/DiscordPresence.h + ) + target_link_libraries(Components PRIVATE discord-rpc) endif() diff --git a/src/Cemu/Logging/CemuLogging.h b/src/Cemu/Logging/CemuLogging.h index 021055d4..efc6e10d 100644 --- a/src/Cemu/Logging/CemuLogging.h +++ b/src/Cemu/Logging/CemuLogging.h @@ -1,3 +1,5 @@ +#include + #pragma once enum class LogType : sint32 @@ -58,8 +60,8 @@ bool cemuLog_log(LogType type, TFmt format, TArgs&&... args) if (!cemuLog_isLoggingEnabled(type)) return false; - const auto format_view = fmt::to_string_view(format); - const auto text = fmt::vformat(format_view, fmt::make_args_checked(format_view, args...)); + const auto format_view = to_string_view(format); + const auto text = fmt::vformat(format_view, make_args_checked(format_view, args...)); cemuLog_log(type, std::basic_string_view(text.data(), text.size())); return true; } diff --git a/src/Common/CMakeLists.txt b/src/Common/CMakeLists.txt index dd7b8f21..8e54a9b9 100644 --- a/src/Common/CMakeLists.txt +++ b/src/Common/CMakeLists.txt @@ -1,48 +1,51 @@ -project(CemuCommon) - -file(GLOB CPP_FILES *.cpp) -file(GLOB H_FILES *.h) -add_library(CemuCommon ${CPP_FILES} ${H_FILES}) - -set_property(TARGET CemuCommon PROPERTY MSVC_RUNTIME_LIBRARY "MultiThreaded$<$:Debug>") - -if(WIN32) -target_sources(CemuCommon -PRIVATE - windows/platform.cpp - windows/platform.h +add_library(Common + betype.h + enumFlags.h + ExceptionHandler/ExceptionHandler.cpp + ExceptionHandler/ExceptionHandler.h + filestream.h + GLInclude/glext.h + GLInclude/glFunctions.h + GLInclude/GLInclude.h + GLInclude/glxext.h + GLInclude/khrplatform.h + GLInclude/wglext.h + unix/date.h + unix/fast_float.h + MemPtr.h + platform.h + precompiled.cpp + precompiled.h + socket.h + StackAllocator.h + SysAllocator.cpp + SysAllocator.h + version.h + zstring_view.h ) + +target_precompile_headers(Common PUBLIC precompiled.h) + +if (WIN32) + target_sources(Common PRIVATE windows/platform.cpp windows/platform.h) else() -target_sources(CemuCommon -PRIVATE - unix/platform.cpp - unix/platform.h -) + target_sources(Common PRIVATE unix/platform.cpp unix/platform.h) endif() -target_sources(CemuCommon - PRIVATE - ExceptionHandler/ExceptionHandler.cpp - ExceptionHandler/ExceptionHandler.h - ) -target_precompile_headers(CemuCommon PUBLIC precompiled.h) -target_include_directories(CemuCommon PUBLIC "../") +target_link_libraries(Common PRIVATE Cafe Config Components) -target_link_libraries(CemuCommon PRIVATE - CemuCafe - CemuConfig - CemuComponents - Boost::nowide - Boost::filesystem - glm::glm +target_link_libraries(Common PRIVATE + Boost::nowide + Boost::filesystem + glm::glm ) -if (UNIX) - target_link_libraries(CemuCommon PRIVATE X11::X11 X11::Xrender X11::Xutil) -endif() - # PUBLIC because: # - boost/predef/os.h is included in platform.h # - fmt/core.h is included in precompiled.h -target_link_libraries(CemuCommon PUBLIC Boost::headers fmt::fmt) +target_link_libraries(Common PUBLIC Boost::headers fmt::fmt) + +if (UNIX) + target_link_libraries(Common PRIVATE X11::X11 X11::Xrender X11::Xutil) +endif() diff --git a/src/asm/CMakeLists.txt b/src/asm/CMakeLists.txt index 527fb1fe..59cf4176 100644 --- a/src/asm/CMakeLists.txt +++ b/src/asm/CMakeLists.txt @@ -1,38 +1,23 @@ -project(CemuAsm C) +if (WIN32) + enable_language(C ASM_MASM) -IF (WIN32) + add_library(Assembly x64util_masm.asm) + set_source_files_properties(x64util_masm.asm PROPERTIES LANGUAGE ASM_MASM) -enable_language(C ASM_MASM) +else() + enable_language(C ASM_NASM) -add_library(CemuAsm -x64util_masm.asm -) -set_source_files_properties(x64util_masm.asm PROPERTIES LANGUAGE ASM_MASM) + add_library(Assembly x64util_nasm.asm) + set_target_properties(Assembly PROPERTIES LINKER_LANGUAGE C) + set_source_files_properties(x64util_nasm.asm PROPERTIES LANGUAGE ASM_NASM) -ELSE() + set(CMAKE_ASM_NASM_LINK_EXECUTABLE "ld -fPIC -o ") -# NASM -IF (APPLE) -set(CMAKE_ASM_NASM_COMPILE_OBJECT " -g -Fdwarf -f macho64 --prefix _ -o ") -ELSE() -set(CMAKE_ASM_NASM_COMPILE_OBJECT " -g -Fdwarf -f elf64 -o ") -ENDIF() -set(CMAKE_ASM_NASM_LINK_EXECUTABLE "ld -fPIC -o ") - -enable_language(C ASM_NASM) - -add_library(CemuAsm -x64util_nasm.asm -) -set_source_files_properties(x64util_nasm.asm PROPERTIES LANGUAGE ASM_NASM) - -IF (APPLE) -set_target_properties(CemuAsm PROPERTIES NASM_OBJ_FORMAT macho64) -ELSE() -set_target_properties(CemuAsm PROPERTIES NASM_OBJ_FORMAT elf64) -ENDIF() -set_target_properties(CemuAsm PROPERTIES LINKER_LANGUAGE C) - -ENDIF() - -set_property(TARGET CemuAsm PROPERTY MSVC_RUNTIME_LIBRARY "MultiThreaded$<$:Debug>") \ No newline at end of file + if (APPLE) + set_target_properties(Assembly PROPERTIES NASM_OBJ_FORMAT macho64) + set(CMAKE_ASM_NASM_COMPILE_OBJECT " -g -Fdwarf -f macho64 --prefix _ -o ") + else() + set_target_properties(Assembly PROPERTIES NASM_OBJ_FORMAT elf64) + set(CMAKE_ASM_NASM_COMPILE_OBJECT " -g -Fdwarf -f elf64 -o ") + endif() +endif() diff --git a/src/audio/CMakeLists.txt b/src/audio/CMakeLists.txt index 9217349d..5e2cbf86 100644 --- a/src/audio/CMakeLists.txt +++ b/src/audio/CMakeLists.txt @@ -1,49 +1,30 @@ -project(CemuAudio) +add_library(Audio IAudioAPI.cpp IAudioAPI.h) -add_library(CemuAudio -IAudioAPI.cpp -IAudioAPI.h -) - -set_property(TARGET CemuAudio PROPERTY MSVC_RUNTIME_LIBRARY "MultiThreaded$<$:Debug>") +target_precompile_headers(Audio PRIVATE ../Common/precompiled.h) # move these to UI folder -target_sources(CemuAudio PRIVATE - audioDebuggerWindow.cpp - audioDebuggerWindow.h -) +target_sources(Audio PRIVATE audioDebuggerWindow.cpp audioDebuggerWindow.h) -if(WIN32) - target_sources(CemuAudio PRIVATE - DirectSoundAPI.cpp - DirectSoundAPI.h - XAudio2API.cpp - XAudio2API.h - XAudio27API.cpp - XAudio27API.h +if (WIN32) + target_sources(Audio PRIVATE + DirectSoundAPI.cpp + DirectSoundAPI.h + XAudio2API.cpp + XAudio2API.h + XAudio27API.cpp + XAudio27API.h ) endif() -if(ENABLE_CUBEB) - target_sources(CemuAudio PRIVATE - CubebAPI.cpp - CubebAPI.h - ) - #add_definitions(HAS_CUBEB) -endif() +target_link_libraries(Audio PRIVATE Cafe Config Gui Util) -target_precompile_headers(CemuAudio PRIVATE ../Common/precompiled.h) - -target_include_directories(CemuAudio PUBLIC "../") - -target_link_libraries(CemuAudio PRIVATE CemuCafe CemuConfig CemuGui CemuUtil) - -if(ENABLE_CUBEB) - # PUBLIC because cubeb.h/cubeb.h is included in CubebAPI.h - target_link_libraries(CemuAudio PUBLIC cubeb::cubeb) +if (ENABLE_CUBEB) + target_sources(Audio PRIVATE CubebAPI.cpp CubebAPI.h) + # PUBLIC because cubeb.h/cubeb.h is included in CubebAPI.h + target_link_libraries(Audio PUBLIC cubeb::cubeb) endif() if (ENABLE_WXWIDGETS) # PUBLIC because wx/wx.h is included in audioDebuggerWindow.h - target_link_libraries(CemuAudio PUBLIC wx::base wx::core) + target_link_libraries(Audio PUBLIC wx::base wx::core) endif() diff --git a/src/config/CMakeLists.txt b/src/config/CMakeLists.txt index 4aafdc04..705070b1 100644 --- a/src/config/CMakeLists.txt +++ b/src/config/CMakeLists.txt @@ -1,26 +1,26 @@ -project(CemuConfig) - -file(GLOB CPP_FILES *.cpp) -file(GLOB H_FILES *.h) -add_library(CemuConfig ${CPP_FILES} ${H_FILES}) - -set_property(TARGET CemuConfig PROPERTY MSVC_RUNTIME_LIBRARY "MultiThreaded$<$:Debug>") - -target_precompile_headers(CemuConfig PRIVATE ../Common/precompiled.h) - -target_include_directories(CemuConfig PUBLIC "../") - -target_link_libraries(CemuConfig PRIVATE - CemuCafe - CemuCommon - CemuUtil - Boost::headers - Boost::program_options - pugixml::pugixml +add_library(Config + ActiveSettings.cpp + ActiveSettings.h + CemuConfig.cpp + CemuConfig.h + ConfigValue.h + LaunchSettings.cpp + LaunchSettings.h + PermanentConfig.cpp + PermanentConfig.h + PermanentStorage.cpp + PermanentStorage.cpp + XMLConfig.h ) +target_precompile_headers(Config PRIVATE ../Common/precompiled.h) + +target_link_libraries(Config PRIVATE Cafe Common Util) + +target_link_libraries(Config PRIVATE Boost::headers Boost::program_options pugixml::pugixml) + if (ENABLE_WXWIDGETS) - # PUBLIC because wx/language.h is included in CemuConfig.h - # Could be made PRIVATE by using 0 instead of wxLANGUAGE_DEFAULT - target_link_libraries(CemuConfig PUBLIC wx::base wx::core) + # PUBLIC because wx/language.h is included in CemuConfig.h + # Could be made PRIVATE by using 0 instead of wxLANGUAGE_DEFAULT + target_link_libraries(Config PUBLIC wx::base wx::core) endif() diff --git a/src/gui/CMakeLists.txt b/src/gui/CMakeLists.txt index f1bcad4f..bd258b9a 100644 --- a/src/gui/CMakeLists.txt +++ b/src/gui/CMakeLists.txt @@ -1,46 +1,156 @@ -project(CemuGui) - -file(GLOB_RECURSE CPP_FILES *.cpp) -file(GLOB_RECURSE H_FILES *.h) -add_library(CemuGui ${CPP_FILES} ${H_FILES}) - -set_property(TARGET CemuGui PROPERTY MSVC_RUNTIME_LIBRARY "MultiThreaded$<$:Debug>") - -target_sources(CemuGui PRIVATE -wxcomponents/checkedlistctrl.cpp -wxcomponents/checkedlistctrl.h -wxcomponents/checktree.cpp -wxcomponents/checktree.h +add_library(Gui + canvas/IRenderCanvas.h + canvas/OpenGLCanvas.cpp + canvas/OpenGLCanvas.h + canvas/VulkanCanvas.cpp + canvas/VulkanCanvas.h + CemuApp.cpp + CemuApp.h + CemuUpdateWindow.cpp + CemuUpdateWindow.h + ChecksumTool.cpp + ChecksumTool.h + components/TextList.cpp + components/TextList.h + components/wxDownloadManagerList.cpp + components/wxDownloadManagerList.h + components/wxGameList.cpp + components/wxGameList.h + components/wxInputDraw.cpp + components/wxInputDraw.h + components/wxLogCtrl.cpp + components/wxLogCtrl.h + components/wxTitleManagerList.cpp + components/wxTitleManagerList.h + debugger/BreakpointWindow.cpp + debugger/BreakpointWindow.h + debugger/DebuggerWindow2.cpp + debugger/DebuggerWindow2.h + debugger/DisasmCtrl.cpp + debugger/DisasmCtrl.h + debugger/DumpCtrl.cpp + debugger/DumpCtrl.h + debugger/DumpWindow.cpp + debugger/DumpWindow.h + debugger/ModuleWindow.cpp + debugger/ModuleWindow.h + debugger/RegisterCtrl.cpp + debugger/RegisterCtrl.h + debugger/RegisterWindow.cpp + debugger/RegisterWindow.h + debugger/SymbolCtrl.cpp + debugger/SymbolCtrl.h + debugger/SymbolWindow.cpp + debugger/SymbolWindow.h + dialogs/CreateAccount/wxCreateAccountDialog.cpp + dialogs/CreateAccount/wxCreateAccountDialog.h + dialogs/SaveImport/SaveImportWindow.cpp + dialogs/SaveImport/SaveImportWindow.h + dialogs/SaveImport/SaveTransfer.cpp + dialogs/SaveImport/SaveTransfer.h + DownloadGraphicPacksWindow.cpp + DownloadGraphicPacksWindow.h + GameProfileWindow.cpp + GameProfileWindow.h + GameUpdateWindow.cpp + GameUpdateWindow.h + GeneralSettings2.cpp + GeneralSettings2.h + GettingStartedDialog.cpp + GettingStartedDialog.h + GraphicPacksWindow2.cpp + GraphicPacksWindow2.h + guiWrapper.cpp + guiWrapper.h + helpers/wxControlObject.h + helpers/wxCustomData.h + helpers/wxCustomEvents.cpp + helpers/wxCustomEvents.h + helpers/wxHelpers.cpp + helpers/wxHelpers.h + helpers/wxLogEvent.h + input/InputAPIAddWindow.cpp + input/InputAPIAddWindow.h + input/InputSettings2.cpp + input/InputSettings2.h + input/panels/ClassicControllerInputPanel.cpp + input/panels/ClassicControllerInputPanel.h + input/panels/InputPanel.cpp + input/panels/InputPanel.h + input/panels/ProControllerInputPanel.cpp + input/panels/ProControllerInputPanel.h + input/panels/VPADInputPanel.cpp + input/panels/VPADInputPanel.h + input/panels/WiimoteInputPanel.cpp + input/panels/WiimoteInputPanel.h + input/settings/DefaultControllerSettings.cpp + input/settings/DefaultControllerSettings.h + input/settings/WiimoteControllerSettings.cpp + input/settings/WiimoteControllerSettings.h + LoggingWindow.cpp + LoggingWindow.h + MainWindow.cpp + MainWindow.h + MemorySearcherTool.cpp + MemorySearcherTool.h + PadViewFrame.cpp + PadViewFrame.h + TitleManager.cpp + TitleManager.h + windows/PPCThreadsViewer/DebugPPCThreadsWindow.cpp + windows/PPCThreadsViewer/DebugPPCThreadsWindow.h + windows/TextureRelationViewer/TextureRelationWindow.cpp + windows/TextureRelationViewer/TextureRelationWindow.h + wxcomponents/checked2.xpm + wxcomponents/checked_dis.xpm + wxcomponents/checked_d.xpm + wxcomponents/checked_ld.xpm + wxcomponents/checkedlistctrl.cpp + wxcomponents/checkedlistctrl.h + wxcomponents/checked_mo.xpm + wxcomponents/checked.xpm + wxcomponents/checktree.cpp + wxcomponents/checktree.h + wxcomponents/unchecked2.xpm + wxcomponents/unchecked_dis.xpm + wxcomponents/unchecked_d.xpm + wxcomponents/unchecked_ld.xpm + wxcomponents/unchecked_mo.xpm + wxcomponents/unchecked.xpm + wxgui.h + wxHelper.h ) -target_precompile_headers(CemuGui PRIVATE ../Common/precompiled.h) +target_precompile_headers(Gui PRIVATE ../Common/precompiled.h) -target_include_directories(CemuGui PUBLIC "../") # PUBLIC because rapidjson/document.h is included in ChecksumTool.h -target_include_directories(CemuGui PUBLIC ${RAPIDJSON_INCLUDE_DIRS}) +target_include_directories(Gui PUBLIC ${RAPIDJSON_INCLUDE_DIRS}) -target_link_libraries(CemuGui PRIVATE - CemuAudio - CemuCafe - CemuCommon - CemuComponents - CemuConfig - CemuInput - CemuResource - CemuUtil - Boost::headers - CURL::libcurl - libzip::zip - OpenSSL::Crypto - pugixml::pugixml - ZArchive::zarchive +target_link_libraries(Gui PRIVATE + Audio + Cafe + Common + Components + Config + Input + Resource + Util ) -if(ENABLE_CUBEB) - target_link_libraries(CemuGui PRIVATE cubeb::cubeb) +target_link_libraries(Gui PRIVATE + Boost::headers + CURL::libcurl + libzip::zip + OpenSSL::Crypto + pugixml::pugixml + ZArchive::zarchive +) + +if (ENABLE_CUBEB) + target_link_libraries(Gui PRIVATE cubeb::cubeb) endif() if (ENABLE_WXWIDGETS) - # PUBLIC because wx/app.h is included in CemuApp.h - target_link_libraries(CemuGui PUBLIC wx::base wx::core wx::gl wx::propgrid wx::xrc) + # PUBLIC because wx/app.h is included in CemuApp.h + target_link_libraries(Gui PUBLIC wx::base wx::core wx::gl wx::propgrid wx::xrc) endif() diff --git a/src/imgui/CMakeLists.txt b/src/imgui/CMakeLists.txt index 8f0e6792..e2739a30 100644 --- a/src/imgui/CMakeLists.txt +++ b/src/imgui/CMakeLists.txt @@ -1,10 +1,4 @@ -project(imguiImpl) - -add_library(imguiImpl) - -set_property(TARGET imguiImpl PROPERTY MSVC_RUNTIME_LIBRARY "MultiThreaded$<$:Debug>") - -target_sources(imguiImpl PRIVATE +add_library(imguiImpl imgui_impl_opengl3.cpp imgui_impl_opengl3.h imgui_impl_vulkan.cpp @@ -15,14 +9,13 @@ target_sources(imguiImpl PRIVATE target_precompile_headers(imguiImpl PRIVATE ../Common/precompiled.h) -target_include_directories(imguiImpl PUBLIC "../") - target_link_libraries(imguiImpl PRIVATE - CemuCafe - CemuCommon - CemuGui - CemuInput - CemuResource - CemuUtil - imgui::imgui + Cafe + Common + Gui + Input + Resource + Util ) + +target_link_libraries(imguiImpl PRIVATE imgui::imgui) diff --git a/src/input/CMakeLists.txt b/src/input/CMakeLists.txt index de79cd8b..6eeaa3bc 100644 --- a/src/input/CMakeLists.txt +++ b/src/input/CMakeLists.txt @@ -1,113 +1,94 @@ -project(CemuInput) - -add_library(CemuInput -InputManager.cpp -InputManager.h -ControllerFactory.cpp -ControllerFactory.h -api/ControllerState.h -api/Controller.cpp -api/Controller.h -api/ControllerState.cpp -api/InputAPI.h -api/ControllerProvider.h -emulated/ProController.cpp -emulated/EmulatedController.h -emulated/EmulatedController.cpp -emulated/ProController.h -emulated/WPADController.cpp -emulated/WPADController.h -emulated/WiimoteController.h -emulated/VPADController.cpp -emulated/WiimoteController.cpp -emulated/VPADController.h -emulated/ClassicController.cpp -emulated/ClassicController.h +add_library(Input + api/Controller.cpp + api/Controller.h + api/ControllerProvider.h + api/ControllerState.cpp + api/ControllerState.h + api/DirectInput + api/DirectInput/DirectInputController.cpp + api/DirectInput/DirectInputController.h + api/DirectInput/DirectInputControllerProvider.cpp + api/DirectInput/DirectInputControllerProvider.h + api/DSU/DSUController.cpp + api/DSU/DSUController.h + api/DSU/DSUControllerProvider.cpp + api/DSU/DSUControllerProvider.h + api/DSU/DSUMessages.cpp + api/DSU/DSUMessages.h + api/GameCube/GameCubeController.cpp + api/GameCube/GameCubeController.h + api/GameCube/GameCubeControllerProvider.cpp + api/GameCube/GameCubeControllerProvider.h + api/InputAPI.h + api/Keyboard/KeyboardController.cpp + api/Keyboard/KeyboardController.h + api/Keyboard/KeyboardControllerProvider.cpp + api/Keyboard/KeyboardControllerProvider.h + api/SDL/SDLController.cpp + api/SDL/SDLController.h + api/SDL/SDLControllerProvider.cpp + api/SDL/SDLControllerProvider.h + ControllerFactory.cpp + ControllerFactory.h + emulated/ClassicController.cpp + emulated/ClassicController.h + emulated/EmulatedController.cpp + emulated/EmulatedController.h + emulated/ProController.cpp + emulated/ProController.h + emulated/VPADController.cpp + emulated/VPADController.h + emulated/WiimoteController.cpp + emulated/WiimoteController.h + emulated/WPADController.cpp + emulated/WPADController.h + InputManager.cpp + InputManager.h + motion/Mahony.h + motion/MotionHandler.h + motion/MotionSample.h ) -set_property(TARGET CemuInput PROPERTY MSVC_RUNTIME_LIBRARY "MultiThreaded$<$:Debug>") - -# SDL -target_sources(CemuInput PRIVATE -api/SDL/SDLController.cpp -api/SDL/SDLControllerProvider.cpp -api/SDL/SDLController.h -api/SDL/SDLControllerProvider.h -) - -# DSU -target_sources(CemuInput PRIVATE -api/DSU/DSUController.h -api/DSU/DSUControllerProvider.cpp -api/DSU/DSUController.cpp -api/DSU/DSUControllerProvider.h -api/DSU/DSUMessages.h -api/DSU/DSUMessages.cpp -) - -# Keyboard controller -target_sources(CemuInput PRIVATE -api/Keyboard/KeyboardControllerProvider.h -api/Keyboard/KeyboardControllerProvider.cpp -api/Keyboard/KeyboardController.cpp -api/Keyboard/KeyboardController.h -) - -# Native gamecube -target_sources(CemuInput PRIVATE -api/GameCube/GameCubeController.cpp -api/GameCube/GameCubeControllerProvider.h -api/GameCube/GameCubeControllerProvider.cpp -api/GameCube/GameCubeController.h -) - -if(WIN32) -# Native wiimote (Win32 only for now) -target_sources(CemuInput PRIVATE -api/Wiimote/WiimoteControllerProvider.h -api/Wiimote/windows/WinWiimoteDevice.cpp -api/Wiimote/windows/WinWiimoteDevice.h -api/Wiimote/WiimoteControllerProvider.cpp -api/Wiimote/WiimoteMessages.h -api/Wiimote/NativeWiimoteController.h -api/Wiimote/NativeWiimoteController.cpp -api/Wiimote/WiimoteDevice.h -) - -# XInput -target_sources(CemuInput PRIVATE -api/XInput/XInputControllerProvider.cpp -api/XInput/XInputControllerProvider.h -api/XInput/XInputController.cpp -api/XInput/XInputController.h -) - -# DirectInput -target_sources(CemuInput PRIVATE -api/DirectInput/DirectInputControllerProvider.cpp -api/DirectInput/DirectInputController.h -api/DirectInput/DirectInputControllerProvider.h -api/DirectInput/DirectInputController.cpp -) +if (WIN32) + target_sources(Input PRIVATE + api/DirectInput/DirectInputControllerProvider.cpp + api/DirectInput/DirectInputController.h + api/DirectInput/DirectInputControllerProvider.h + api/DirectInput/DirectInputController.cpp + api/XInput/XInputControllerProvider.cpp + api/XInput/XInputControllerProvider.h + api/XInput/XInputController.cpp + api/XInput/XInputController.h + # Native wiimote is Win32 only for now + api/Wiimote/WiimoteControllerProvider.h + api/Wiimote/windows/WinWiimoteDevice.cpp + api/Wiimote/windows/WinWiimoteDevice.h + api/Wiimote/WiimoteControllerProvider.cpp + api/Wiimote/WiimoteMessages.h + api/Wiimote/NativeWiimoteController.h + api/Wiimote/NativeWiimoteController.cpp + api/Wiimote/WiimoteDevice.h + ) endif() -target_precompile_headers(CemuInput PRIVATE ../Common/precompiled.h) +target_precompile_headers(Input PRIVATE ../Common/precompiled.h) -target_include_directories(CemuInput PUBLIC "../") +target_link_libraries(Input PRIVATE + Cafe + Common + Config + Gui + Util +) -target_link_libraries(CemuInput PRIVATE - CemuCafe - CemuCommon - CemuConfig - CemuGui - CemuUtil - Boost::headers - Boost::program_options - glm::glm - pugixml::pugixml - SDL2::SDL2 +target_link_libraries(Input PRIVATE + Boost::headers + Boost::program_options + glm::glm + pugixml::pugixml + SDL2::SDL2 ) if (ENABLE_WXWIDGETS) - target_link_libraries(CemuInput PRIVATE wx::base wx::core) + target_link_libraries(Input PRIVATE wx::base wx::core) endif() diff --git a/src/resource/CMakeLists.txt b/src/resource/CMakeLists.txt index ec445061..dd958090 100644 --- a/src/resource/CMakeLists.txt +++ b/src/resource/CMakeLists.txt @@ -1,21 +1,7 @@ -add_library(CemuResource) +add_library(Resource CafeDefaultFont.cpp) -set_property(TARGET CemuResource PROPERTY MSVC_RUNTIME_LIBRARY "MultiThreaded$<$:Debug>") - -target_precompile_headers(CemuResource PRIVATE ../Common/precompiled.h) - -# icon resources -if(UNIX) - target_sources(CemuResource PRIVATE - embedded/resources.cpp - embedded/resources.h - ) +if (UNIX) + target_sources(Resource PRIVATE embedded/resources.cpp embedded/resources.h) endif() -target_sources(CemuResource PRIVATE - CafeDefaultFont.cpp - ) - -target_include_directories(CemuResource PUBLIC "../") - -target_link_libraries(CemuResource PRIVATE CemuComponents) +target_precompile_headers(Resource PRIVATE ../Common/precompiled.h) diff --git a/src/util/CMakeLists.txt b/src/util/CMakeLists.txt index 69887fa7..18ed2b32 100644 --- a/src/util/CMakeLists.txt +++ b/src/util/CMakeLists.txt @@ -1,24 +1,83 @@ -project(CemuUtil) - -file(GLOB_RECURSE CPP_FILES *.cpp) -file(GLOB_RECURSE H_FILES *.h) - -add_library(CemuUtil ${CPP_FILES} ${H_FILES}) - -set_property(TARGET CemuUtil PROPERTY MSVC_RUNTIME_LIBRARY "MultiThreaded$<$:Debug>") - -target_precompile_headers(CemuUtil PRIVATE ../Common/precompiled.h) - -target_include_directories(CemuUtil PUBLIC "../") - -target_link_libraries(CemuUtil PRIVATE - CemuCommon - CemuConfig - Boost::headers - Boost::nowide - OpenSSL::Crypto +add_library(Util + boost/bluetooth.h + ChunkedHeap/ChunkedHeap.h + containers/flat_hash_map.hpp + containers/IntervalBucketContainer.h + containers/LookupTableL3.h + containers/RangeStore.h + containers/robin_hood.h + containers/SmallBitset.h + crypto/aes128.cpp + crypto/aes128.h + crypto/crc32.cpp + crypto/crc32.h + crypto/md5.cpp + crypto/md5.h + DXGIWrapper/DXGIWrapper.h + EventService.h + Fiber/Fiber.h + Fiber/FiberUnix.cpp + Fiber/FiberWin.cpp + helpers/ClassWrapper.h + helpers/ConcurrentQueue.h + helpers/enum_array.hpp + helpers/fixedSizeList.h + helpers/fspinlock.h + helpers/helpers.cpp + helpers/helpers.h + helpers/MapAdaptor.h + helpers/MemoryPool.h + helpers/ringbuffer.h + helpers/Semaphore.h + helpers/Serializer.h + helpers/Singleton.h + helpers/StringBuf.h + helpers/StringHelpers.h + helpers/StringParser.h + helpers/SystemException.h + helpers/TempState.h + highresolutiontimer/HighResolutionTimer.cpp + highresolutiontimer/HighResolutionTimer.h + ImageWriter/bmp.h + ImageWriter/tga.h + IniParser/IniParser.cpp + IniParser/IniParser.h + libusbWrapper/libusbWrapper.cpp + libusbWrapper/libusbWrapper.h + math/glm.h + math/quaternion.h + math/vector2.h + math/vector3.h + MemMapper/MemMapper.h + MemMapper/MemMapperUnix.cpp + MemMapper/MemMapperWin.cpp + ThreadPool/ThreadPool.cpp + ThreadPool/ThreadPool.h + tinyxml2/tinyxml2.cpp + tinyxml2/tinyxml2.h + VirtualHeap/VirtualHeap.cpp + VirtualHeap/VirtualHeap.h + Zir/Core/IR.cpp + Zir/Core/IR.h + Zir/Core/ZirUtility.h + Zir/Core/ZpIRBuilder.h + Zir/Core/ZpIRDebug.h + Zir/Core/ZpIRPasses.h + Zir/Core/ZpIRScheduler.h + Zir/EmitterGLSL/ZpIREmitGLSL.cpp + Zir/EmitterGLSL/ZpIREmitGLSL.h + Zir/Passes/RegisterAllocatorForGLSL.cpp + Zir/Passes/ZpIRRegisterAllocator.cpp ) +target_precompile_headers(Util PRIVATE ../Common/precompiled.h) + +target_link_libraries(Util PRIVATE Common Config) + +target_link_libraries(Util PRIVATE Boost::headers Boost::nowide OpenSSL::Crypto fmt::fmt) + +target_include_directories(Common PRIVATE ${fmt_INCLUDE_DIRS}) + if (ENABLE_WXWIDGETS) - target_link_libraries(CemuUtil PRIVATE wx::base wx::core) + target_link_libraries(Util PRIVATE wx::base wx::core) endif() diff --git a/src/util/helpers/StringBuf.h b/src/util/helpers/StringBuf.h index 3744caa4..8c655ebd 100644 --- a/src/util/helpers/StringBuf.h +++ b/src/util/helpers/StringBuf.h @@ -1,3 +1,5 @@ +#include + #pragma once class StringBuf @@ -20,7 +22,7 @@ public: template void addFmt(const TFmt& format, TArgs&&... args) { - auto r = fmt::vformat_to_n((char*)(this->str + this->length), (size_t)(this->limit - this->length), fmt::to_string_view(format), fmt::make_args_checked(format, args...)); + auto r = fmt::vformat_to_n((char*)(this->str + this->length), (size_t)(this->limit - this->length), to_string_view(format), make_args_checked(format, args...)); this->length += (uint32)r.size; } diff --git a/vcpkg.json b/vcpkg.json index 519a5618..37b3f013 100644 --- a/vcpkg.json +++ b/vcpkg.json @@ -2,6 +2,9 @@ "name": "cemu", "version-string": "1.0", "builtin-baseline": "1b0252ca70ca2244a711535462c7f981eb439e83", + "overrides": [ + { "name": "fmt", "version": "7.0.2" } + ], "dependencies": [ "imgui", "pugixml", @@ -30,7 +33,11 @@ "boost-property-tree", "boost-static-string", "boost-random", - "fmt", + "fmt", + { + "name": "fmt", + "version>=": "7.0.2" + }, "glm", "glslang", "zstd",