From b2d375f2e58866414bc5128f8aea9a45129f02b0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Henrik=20Rydg=C3=A5rd?= Date: Fri, 24 Jul 2026 16:02:38 +0200 Subject: [PATCH 01/10] Extract Common into its own CMakeLists.txt First step of breaking up the monolithic root CMakeLists.txt: move the add_library(Common STATIC ...) target definition, and every scattered target_link_libraries/target_compile_definitions/target_include_directories call touching it, into Common/CMakeLists.txt, pulled in via add_subdirectory(Common). Source paths are now relative to Common/ instead of prefixed with "Common/". The two files living outside that directory (ext/jpge/*) use ${CMAKE_SOURCE_DIR}/... instead. include_directories(Common) stays in the root file rather than moving into Common/CMakeLists.txt: it's a directory-scope command that needs to affect targets defined *later* in the root file, and add_subdirectory scope doesn't propagate upward or sideways, so moving it would have silently broken unprefixed #includes elsewhere in the project. add_subdirectory(Common) is placed at the point where the *last* prerequisite variable it needs (PNG_LIBRARIES, RT_LIB, ATOMIC_LIB, etc.) is guaranteed already set, not where the old add_library(Common ...) used to start - some of those are resolved later in the file than Common's original position was. Verified with a clean ./b.sh --debug rebuild and a HEADLESS=ON UNITTEST=ON reconfigure/build. Co-Authored-By: Claude Sonnet 5 Claude-Session: https://claude.ai/code/session_01PSNaZnHCjmryS3ziVN9gZU --- CMakeLists.txt | 383 +----------------------------------------- Common/CMakeLists.txt | 383 ++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 384 insertions(+), 382 deletions(-) create mode 100644 Common/CMakeLists.txt diff --git a/CMakeLists.txt b/CMakeLists.txt index 9cd41d18fe..045fe0fc7b 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -561,389 +561,12 @@ endmacro() add_subdirectory(ext) -if(WIN32) - set(CommonD3D - Common/GPU/D3D11/thin3d_d3d11.cpp - Common/GPU/D3D11/D3D11Loader.cpp - Common/GPU/D3D11/D3D11Loader.h - ) -endif() - -set(CommonVR - Common/VR/OpenXRLoader.cpp - Common/VR/OpenXRLoader.h - Common/VR/PPSSPPVR.cpp - Common/VR/PPSSPPVR.h - Common/VR/VRBase.cpp - Common/VR/VRBase.h - Common/VR/VRFramebuffer.cpp - Common/VR/VRFramebuffer.h - Common/VR/VRInput.cpp - Common/VR/VRInput.h - Common/VR/VRMath.cpp - Common/VR/VRMath.h - Common/VR/VRRenderer.cpp - Common/VR/VRRenderer.h -) include_directories(ext/OpenXR-SDK/include) # For ext/sol includes, that are usually included as sol/*.hpp include_directories(ext) -add_library(Common STATIC - Common/ABI.cpp - Common/ABI.h - Common/CPUDetect.cpp - Common/CPUDetect.h - Common/Thunk.cpp - Common/Thunk.h - Common/x64Analyzer.cpp - Common/x64Analyzer.h - Common/x64Emitter.cpp - Common/x64Emitter.h - Common/ArmCPUDetect.cpp - Common/ArmEmitter.h - Common/ArmEmitter.cpp - Common/Arm64Emitter.h - Common/Arm64Emitter.cpp - Common/ArmEmitter.h - Common/ArmEmitter.cpp - Common/RiscVCPUDetect.cpp - Common/RiscVEmitter.cpp - Common/RiscVEmitter.h - Common/LoongArchCPUDetect.cpp - Common/LoongArch64Emitter.cpp - Common/LoongArch64Emitter.h - ${CommonD3D} - ${CommonVR} - Common/Serialize/Serializer.cpp - Common/Serialize/Serializer.h - Common/Serialize/SerializeDeque.h - Common/Serialize/SerializeFuncs.h - Common/Serialize/SerializeList.h - Common/Serialize/SerializeMap.h - Common/Serialize/SerializeSet.h - Common/Crypto/md5.cpp - Common/Crypto/md5.h - Common/Crypto/sha1.cpp - Common/Crypto/sha1.h - Common/Crypto/sha256.cpp - Common/Crypto/sha256.h - Common/Data/Collections/ConstMap.h - Common/Data/Collections/FixedSizeQueue.h - Common/Data/Collections/Hashmaps.h - Common/Data/Collections/TinySet.h - Common/Data/Collections/FastVec.h - Common/Data/Collections/CharQueue.h - Common/Data/Collections/CyclicBuffer.h - Common/Data/Collections/ThreadSafeList.h - Common/Data/Color/RGBAUtil.cpp - Common/Data/Color/RGBAUtil.h - Common/Data/Convert/ColorConv.cpp - Common/Data/Convert/ColorConv.h - Common/Data/Convert/SmallDataConvert.cpp - Common/Data/Convert/SmallDataConvert.h - Common/Data/Encoding/Base64.cpp - Common/Data/Encoding/Base64.h - Common/Data/Encoding/Compression.cpp - Common/Data/Encoding/Compression.h - Common/Data/Encoding/Shiftjis.h - Common/Data/Encoding/Utf8.cpp - Common/Data/Encoding/Utf8.h - Common/Data/Encoding/Utf16.h - Common/Data/Format/RIFF.cpp - Common/Data/Format/RIFF.h - Common/Data/Format/IniFile.cpp - Common/Data/Format/IniFile.h - Common/Data/Format/JSONReader.h - Common/Data/Format/JSONReader.cpp - Common/Data/Format/JSONWriter.h - Common/Data/Format/JSONWriter.cpp - Common/Data/Format/DDSLoad.cpp - Common/Data/Format/DDSLoad.h - Common/Data/Format/PNGLoad.cpp - Common/Data/Format/PNGLoad.h - Common/Data/Format/ZIMLoad.cpp - Common/Data/Format/ZIMLoad.h - Common/Data/Format/ZIMSave.cpp - Common/Data/Format/ZIMSave.h - Common/Data/Hash/Hash.cpp - Common/Data/Hash/Hash.h - Common/Data/Text/I18n.cpp - Common/Data/Text/I18n.h - Common/Data/Text/Parsers.cpp - Common/Data/Text/Parsers.h - Common/Data/Text/StringWriter.h - Common/Data/Text/WrapText.cpp - Common/Data/Text/WrapText.h - Common/Data/Random/Rng.h - Common/File/VFS/VFS.h - Common/File/VFS/VFS.cpp - Common/File/VFS/ZipFileReader.cpp - Common/File/VFS/ZipFileReader.h - Common/File/VFS/SevenZipFileReader.cpp - Common/File/VFS/SevenZipFileReader.h - Common/File/VFS/DirectoryReader.cpp - Common/File/VFS/DirectoryReader.h - Common/File/AndroidStorage.h - Common/File/AndroidStorage.cpp - Common/File/AndroidContentURI.h - Common/File/AndroidContentURI.cpp - Common/File/DiskFree.h - Common/File/DiskFree.cpp - Common/File/Path.h - Common/File/Path.cpp - Common/File/PathBrowser.h - Common/File/PathBrowser.cpp - Common/File/FileUtil.cpp - Common/File/FileUtil.h - Common/File/DirListing.cpp - Common/File/DirListing.h - Common/File/FileDescriptor.cpp - Common/File/FileDescriptor.h - Common/GPU/DataFormat.h - Common/GPU/MiscTypes.h - Common/GPU/GPUBackendCommon.cpp - Common/GPU/GPUBackendCommon.h - Common/GPU/thin3d.cpp - Common/GPU/thin3d.h - Common/GPU/thin3d_create.h - Common/GPU/Shader.cpp - Common/GPU/Shader.h - Common/GPU/ShaderWriter.cpp - Common/GPU/ShaderWriter.h - Common/GPU/ShaderTranslation.h - Common/GPU/ShaderTranslation.cpp - Common/GPU/OpenGL/GLCommon.h - Common/GPU/OpenGL/GLDebugLog.cpp - Common/GPU/OpenGL/GLDebugLog.h - Common/GPU/OpenGL/GLSLProgram.cpp - Common/GPU/OpenGL/GLSLProgram.h - Common/GPU/OpenGL/gl3stub.c - Common/GPU/OpenGL/gl3stub.h - Common/GPU/OpenGL/GLFeatures.cpp - Common/GPU/OpenGL/GLFeatures.h - Common/GPU/OpenGL/GLFrameData.cpp - Common/GPU/OpenGL/GLFrameData.h - Common/GPU/OpenGL/thin3d_gl.cpp - Common/GPU/OpenGL/GLMemory.cpp - Common/GPU/OpenGL/GLMemory.h - Common/GPU/OpenGL/GLRenderManager.cpp - Common/GPU/OpenGL/GLRenderManager.h - Common/GPU/OpenGL/GLQueueRunner.cpp - Common/GPU/OpenGL/GLQueueRunner.h - Common/GPU/OpenGL/GLProfiler.cpp - Common/GPU/OpenGL/GLProfiler.h - Common/GPU/OpenGL/DataFormatGL.cpp - Common/GPU/OpenGL/DataFormatGL.h - Common/GPU/Vulkan/VulkanBarrier.cpp - Common/GPU/Vulkan/VulkanBarrier.h - Common/GPU/Vulkan/VulkanDebug.cpp - Common/GPU/Vulkan/VulkanDebug.h - Common/GPU/Vulkan/VulkanContext.cpp - Common/GPU/Vulkan/VulkanContext.h - Common/GPU/Vulkan/VulkanDescSet.cpp - Common/GPU/Vulkan/VulkanDescSet.h - Common/GPU/Vulkan/VulkanFramebuffer.cpp - Common/GPU/Vulkan/VulkanFramebuffer.h - Common/GPU/Vulkan/VulkanImage.cpp - Common/GPU/Vulkan/VulkanImage.h - Common/GPU/Vulkan/VulkanLoader.cpp - Common/GPU/Vulkan/VulkanLoader.h - Common/GPU/Vulkan/VulkanMemory.cpp - Common/GPU/Vulkan/VulkanMemory.h - Common/GPU/Vulkan/VulkanProfiler.cpp - Common/GPU/Vulkan/VulkanProfiler.h - Common/GPU/Vulkan/thin3d_vulkan.cpp - Common/GPU/Vulkan/VulkanRenderManager.cpp - Common/GPU/Vulkan/VulkanRenderManager.h - Common/GPU/Vulkan/VulkanQueueRunner.cpp - Common/GPU/Vulkan/VulkanQueueRunner.h - Common/GPU/Vulkan/VulkanFrameData.cpp - Common/GPU/Vulkan/VulkanFrameData.h - Common/Input/GestureDetector.cpp - Common/Input/GestureDetector.h - Common/Input/KeyCodes.h - Common/Input/InputState.cpp - Common/Input/InputState.h - Common/Math/SIMDHeaders.h - Common/Math/SIMDHeaders.h - Common/Math/curves.cpp - Common/Math/curves.h - Common/Math/expression_parser.cpp - Common/Math/expression_parser.h - Common/Math/lin/matrix4x4.cpp - Common/Math/lin/matrix4x4.h - Common/Math/lin/vec3.cpp - Common/Math/lin/vec3.h - Common/Math/math_util.cpp - Common/Math/math_util.h - Common/Math/Statistics.h - Common/Math/Statistics.cpp - Common/Net/HTTPClient.cpp - Common/Net/HTTPClient.h - Common/Net/HTTPHeaders.cpp - Common/Net/HTTPHeaders.h - Common/Net/HTTPNaettRequest.cpp - Common/Net/HTTPNaettRequest.h - Common/Net/HTTPRequest.cpp - Common/Net/HTTPRequest.h - Common/Net/HTTPServer.cpp - Common/Net/HTTPServer.h - Common/Net/NetBuffer.cpp - Common/Net/NetBuffer.h - Common/Net/Resolve.cpp - Common/Net/Resolve.h - Common/Net/Sinks.cpp - Common/Net/Sinks.h - Common/Net/SocketCompat.h - Common/Net/URL.cpp - Common/Net/URL.h - Common/Net/WebsocketServer.cpp - Common/Net/WebsocketServer.h - Common/Profiler/Profiler.cpp - Common/Profiler/Profiler.h - Common/Render/AtlasGen.cpp - Common/Render/AtlasGen.h - Common/Render/TextureAtlas.cpp - Common/Render/TextureAtlas.h - Common/Render/DrawBuffer.cpp - Common/Render/DrawBuffer.h - Common/Render/ManagedTexture.cpp - Common/Render/ManagedTexture.h - Common/Render/Text/draw_text.cpp - Common/Render/Text/draw_text.h - Common/Render/Text/draw_text_android.cpp - Common/Render/Text/draw_text_android.h - Common/Render/Text/draw_text_win.cpp - Common/Render/Text/draw_text_win.h - Common/Render/Text/draw_text_uwp.cpp - Common/Render/Text/draw_text_uwp.h - Common/Audio/AudioBackend.h - Common/System/Display.cpp - Common/System/Display.h - Common/System/Application.h - Common/System/System.h - Common/System/NativeApp.h - Common/System/Request.cpp - Common/System/Request.h - Common/System/OSD.cpp - Common/System/OSD.h - Common/Thread/Channel.h - Common/Thread/ParallelLoop.cpp - Common/Thread/ParallelLoop.h - Common/Thread/Promise.h - Common/Thread/ThreadUtil.cpp - Common/Thread/ThreadUtil.h - Common/Thread/ThreadManager.cpp - Common/Thread/ThreadManager.h - Common/UI/AsyncImageFileView.cpp - Common/UI/AsyncImageFileView.h - Common/UI/Root.cpp - Common/UI/Root.h - Common/UI/Screen.cpp - Common/UI/Screen.h - Common/UI/UI.cpp - Common/UI/UI.h - Common/UI/Context.cpp - Common/UI/Context.h - Common/UI/IconCache.cpp - Common/UI/IconCache.h - Common/UI/UIScreen.cpp - Common/UI/UIScreen.h - Common/UI/Notice.cpp - Common/UI/Notice.h - Common/UI/Tween.cpp - Common/UI/Tween.h - Common/UI/View.cpp - Common/UI/View.h - Common/UI/ViewGroup.cpp - Common/UI/ViewGroup.h - Common/UI/ScrollView.cpp - Common/UI/ScrollView.h - Common/UI/TabHolder.cpp - Common/UI/TabHolder.h - Common/UI/PopupScreens.cpp - Common/UI/PopupScreens.h - Common/BitScan.h - Common/BitSet.h - Common/Buffer.h - Common/Buffer.cpp - Common/CodeBlock.h - Common/Common.h - Common/CommonFuncs.h - Common/CommonTypes.h - Common/DbgNew.h - Common/FakeEmitter.h - Common/FakeCPUDetect.cpp - Common/ExceptionHandlerSetup.cpp - Common/ExceptionHandlerSetup.h - Common/GhidraClient.h - Common/GhidraClient.cpp - Common/Log.h - Common/Log.cpp - Common/Log/ConsoleListener.cpp - Common/Log/ConsoleListener.h - Common/Log/LogManager.cpp - Common/Log/LogManager.h - Common/LogReporting.cpp - Common/LogReporting.h - Common/MemArenaAndroid.cpp - Common/MemArenaDarwin.cpp - Common/MemArenaPosix.cpp - Common/MemArenaWin32.cpp - Common/MemArenaHorizon.cpp - Common/MemArena.h - Common/MemoryUtil.cpp - Common/MemoryUtilHorizon.cpp - Common/MemoryUtil.h - Common/OSVersion.cpp - Common/OSVersion.h - Common/StringUtils.cpp - Common/StringUtils.h - Common/SysError.h - Common/SysError.cpp - Common/TimeUtil.cpp - Common/TimeUtil.h - ext/jpge/jpgd.cpp - ext/jpge/jpgd.h - ext/jpge/jpge.cpp - ext/jpge/jpge.h -) - -if(LIBRETRO) - target_include_directories(Common PRIVATE libretro/libretro-common/include) -endif() - include_directories(Common) -setup_target_project(Common Common) - -if(IOS) - target_compile_definitions(Common PUBLIC GLES_SILENCE_DEPRECATION) -endif() - -target_link_libraries(Common Ext::Snappy cpu_features) - -if(SDL_LIB_TARGET AND TARGET SDL3::Headers) - target_link_libraries(Common SDL3::Headers) -endif() - -if(NOT LIBRETRO) - target_link_libraries(Common imgui) -endif() - -if(ARM64) - if(ANDROID) - target_link_libraries(Common adrenotools) - endif() -endif() - -target_compile_definitions(Common PRIVATE Z7_CRC_NUM_TABLES=1) - -if(TARGET Ext::GLEW) - target_link_libraries(Common Ext::GLEW) -endif() - if(USING_GLES2 OR (USING_EGL AND NOT USING_FBDEV)) find_package(X11) endif() @@ -1542,10 +1165,6 @@ else() endif() endif() -if(WIN32) - target_link_libraries(Common winmm dsound dxguid d2d1 dwrite d3d11 Version) -endif() - set(UISource) if(NOT LIBRETRO) list(APPEND UISource @@ -1732,7 +1351,7 @@ add_library(xxhash STATIC ) target_include_directories(xxhash PRIVATE ext/xxhash) -target_link_libraries(Common ${LIBZIP_LIBRARY} ${LIB7ZIP_LIBRARY} ${PNG_LIBRARIES} ${BASISU_LIBRARIES} ${ZLIB_LIBRARY} pugixml vma gason udis86 ${RT_LIB} ${ATOMIC_LIB}) +add_subdirectory(Common) set(CoreExtra) set(CoreExtraLibs) diff --git a/Common/CMakeLists.txt b/Common/CMakeLists.txt new file mode 100644 index 0000000000..359d36c288 --- /dev/null +++ b/Common/CMakeLists.txt @@ -0,0 +1,383 @@ +if(WIN32) + set(CommonD3D + GPU/D3D11/thin3d_d3d11.cpp + GPU/D3D11/D3D11Loader.cpp + GPU/D3D11/D3D11Loader.h + ) +endif() + +set(CommonVR + VR/OpenXRLoader.cpp + VR/OpenXRLoader.h + VR/PPSSPPVR.cpp + VR/PPSSPPVR.h + VR/VRBase.cpp + VR/VRBase.h + VR/VRFramebuffer.cpp + VR/VRFramebuffer.h + VR/VRInput.cpp + VR/VRInput.h + VR/VRMath.cpp + VR/VRMath.h + VR/VRRenderer.cpp + VR/VRRenderer.h +) + +add_library(Common STATIC + ABI.cpp + ABI.h + CPUDetect.cpp + CPUDetect.h + Thunk.cpp + Thunk.h + x64Analyzer.cpp + x64Analyzer.h + x64Emitter.cpp + x64Emitter.h + ArmCPUDetect.cpp + ArmEmitter.h + ArmEmitter.cpp + Arm64Emitter.h + Arm64Emitter.cpp + ArmEmitter.h + ArmEmitter.cpp + RiscVCPUDetect.cpp + RiscVEmitter.cpp + RiscVEmitter.h + LoongArchCPUDetect.cpp + LoongArch64Emitter.cpp + LoongArch64Emitter.h + ${CommonD3D} + ${CommonVR} + Serialize/Serializer.cpp + Serialize/Serializer.h + Serialize/SerializeDeque.h + Serialize/SerializeFuncs.h + Serialize/SerializeList.h + Serialize/SerializeMap.h + Serialize/SerializeSet.h + Crypto/md5.cpp + Crypto/md5.h + Crypto/sha1.cpp + Crypto/sha1.h + Crypto/sha256.cpp + Crypto/sha256.h + Data/Collections/ConstMap.h + Data/Collections/FixedSizeQueue.h + Data/Collections/Hashmaps.h + Data/Collections/TinySet.h + Data/Collections/FastVec.h + Data/Collections/CharQueue.h + Data/Collections/CyclicBuffer.h + Data/Collections/ThreadSafeList.h + Data/Color/RGBAUtil.cpp + Data/Color/RGBAUtil.h + Data/Convert/ColorConv.cpp + Data/Convert/ColorConv.h + Data/Convert/SmallDataConvert.cpp + Data/Convert/SmallDataConvert.h + Data/Encoding/Base64.cpp + Data/Encoding/Base64.h + Data/Encoding/Compression.cpp + Data/Encoding/Compression.h + Data/Encoding/Shiftjis.h + Data/Encoding/Utf8.cpp + Data/Encoding/Utf8.h + Data/Encoding/Utf16.h + Data/Format/RIFF.cpp + Data/Format/RIFF.h + Data/Format/IniFile.cpp + Data/Format/IniFile.h + Data/Format/JSONReader.h + Data/Format/JSONReader.cpp + Data/Format/JSONWriter.h + Data/Format/JSONWriter.cpp + Data/Format/DDSLoad.cpp + Data/Format/DDSLoad.h + Data/Format/PNGLoad.cpp + Data/Format/PNGLoad.h + Data/Format/ZIMLoad.cpp + Data/Format/ZIMLoad.h + Data/Format/ZIMSave.cpp + Data/Format/ZIMSave.h + Data/Hash/Hash.cpp + Data/Hash/Hash.h + Data/Text/I18n.cpp + Data/Text/I18n.h + Data/Text/Parsers.cpp + Data/Text/Parsers.h + Data/Text/StringWriter.h + Data/Text/WrapText.cpp + Data/Text/WrapText.h + Data/Random/Rng.h + File/VFS/VFS.h + File/VFS/VFS.cpp + File/VFS/ZipFileReader.cpp + File/VFS/ZipFileReader.h + File/VFS/SevenZipFileReader.cpp + File/VFS/SevenZipFileReader.h + File/VFS/DirectoryReader.cpp + File/VFS/DirectoryReader.h + File/AndroidStorage.h + File/AndroidStorage.cpp + File/AndroidContentURI.h + File/AndroidContentURI.cpp + File/DiskFree.h + File/DiskFree.cpp + File/Path.h + File/Path.cpp + File/PathBrowser.h + File/PathBrowser.cpp + File/FileUtil.cpp + File/FileUtil.h + File/DirListing.cpp + File/DirListing.h + File/FileDescriptor.cpp + File/FileDescriptor.h + GPU/DataFormat.h + GPU/MiscTypes.h + GPU/GPUBackendCommon.cpp + GPU/GPUBackendCommon.h + GPU/thin3d.cpp + GPU/thin3d.h + GPU/thin3d_create.h + GPU/Shader.cpp + GPU/Shader.h + GPU/ShaderWriter.cpp + GPU/ShaderWriter.h + GPU/ShaderTranslation.h + GPU/ShaderTranslation.cpp + GPU/OpenGL/GLCommon.h + GPU/OpenGL/GLDebugLog.cpp + GPU/OpenGL/GLDebugLog.h + GPU/OpenGL/GLSLProgram.cpp + GPU/OpenGL/GLSLProgram.h + GPU/OpenGL/gl3stub.c + GPU/OpenGL/gl3stub.h + GPU/OpenGL/GLFeatures.cpp + GPU/OpenGL/GLFeatures.h + GPU/OpenGL/GLFrameData.cpp + GPU/OpenGL/GLFrameData.h + GPU/OpenGL/thin3d_gl.cpp + GPU/OpenGL/GLMemory.cpp + GPU/OpenGL/GLMemory.h + GPU/OpenGL/GLRenderManager.cpp + GPU/OpenGL/GLRenderManager.h + GPU/OpenGL/GLQueueRunner.cpp + GPU/OpenGL/GLQueueRunner.h + GPU/OpenGL/GLProfiler.cpp + GPU/OpenGL/GLProfiler.h + GPU/OpenGL/DataFormatGL.cpp + GPU/OpenGL/DataFormatGL.h + GPU/Vulkan/VulkanBarrier.cpp + GPU/Vulkan/VulkanBarrier.h + GPU/Vulkan/VulkanDebug.cpp + GPU/Vulkan/VulkanDebug.h + GPU/Vulkan/VulkanContext.cpp + GPU/Vulkan/VulkanContext.h + GPU/Vulkan/VulkanDescSet.cpp + GPU/Vulkan/VulkanDescSet.h + GPU/Vulkan/VulkanFramebuffer.cpp + GPU/Vulkan/VulkanFramebuffer.h + GPU/Vulkan/VulkanImage.cpp + GPU/Vulkan/VulkanImage.h + GPU/Vulkan/VulkanLoader.cpp + GPU/Vulkan/VulkanLoader.h + GPU/Vulkan/VulkanMemory.cpp + GPU/Vulkan/VulkanMemory.h + GPU/Vulkan/VulkanProfiler.cpp + GPU/Vulkan/VulkanProfiler.h + GPU/Vulkan/thin3d_vulkan.cpp + GPU/Vulkan/VulkanRenderManager.cpp + GPU/Vulkan/VulkanRenderManager.h + GPU/Vulkan/VulkanQueueRunner.cpp + GPU/Vulkan/VulkanQueueRunner.h + GPU/Vulkan/VulkanFrameData.cpp + GPU/Vulkan/VulkanFrameData.h + Input/GestureDetector.cpp + Input/GestureDetector.h + Input/KeyCodes.h + Input/InputState.cpp + Input/InputState.h + Math/SIMDHeaders.h + Math/SIMDHeaders.h + Math/curves.cpp + Math/curves.h + Math/expression_parser.cpp + Math/expression_parser.h + Math/lin/matrix4x4.cpp + Math/lin/matrix4x4.h + Math/lin/vec3.cpp + Math/lin/vec3.h + Math/math_util.cpp + Math/math_util.h + Math/Statistics.h + Math/Statistics.cpp + Net/HTTPClient.cpp + Net/HTTPClient.h + Net/HTTPHeaders.cpp + Net/HTTPHeaders.h + Net/HTTPNaettRequest.cpp + Net/HTTPNaettRequest.h + Net/HTTPRequest.cpp + Net/HTTPRequest.h + Net/HTTPServer.cpp + Net/HTTPServer.h + Net/NetBuffer.cpp + Net/NetBuffer.h + Net/Resolve.cpp + Net/Resolve.h + Net/Sinks.cpp + Net/Sinks.h + Net/SocketCompat.h + Net/URL.cpp + Net/URL.h + Net/WebsocketServer.cpp + Net/WebsocketServer.h + Profiler/Profiler.cpp + Profiler/Profiler.h + Render/AtlasGen.cpp + Render/AtlasGen.h + Render/TextureAtlas.cpp + Render/TextureAtlas.h + Render/DrawBuffer.cpp + Render/DrawBuffer.h + Render/ManagedTexture.cpp + Render/ManagedTexture.h + Render/Text/draw_text.cpp + Render/Text/draw_text.h + Render/Text/draw_text_android.cpp + Render/Text/draw_text_android.h + Render/Text/draw_text_win.cpp + Render/Text/draw_text_win.h + Render/Text/draw_text_uwp.cpp + Render/Text/draw_text_uwp.h + Audio/AudioBackend.h + System/Display.cpp + System/Display.h + System/Application.h + System/System.h + System/NativeApp.h + System/Request.cpp + System/Request.h + System/OSD.cpp + System/OSD.h + Thread/Channel.h + Thread/ParallelLoop.cpp + Thread/ParallelLoop.h + Thread/Promise.h + Thread/ThreadUtil.cpp + Thread/ThreadUtil.h + Thread/ThreadManager.cpp + Thread/ThreadManager.h + UI/AsyncImageFileView.cpp + UI/AsyncImageFileView.h + UI/Root.cpp + UI/Root.h + UI/Screen.cpp + UI/Screen.h + UI/UI.cpp + UI/UI.h + UI/Context.cpp + UI/Context.h + UI/IconCache.cpp + UI/IconCache.h + UI/UIScreen.cpp + UI/UIScreen.h + UI/Notice.cpp + UI/Notice.h + UI/Tween.cpp + UI/Tween.h + UI/View.cpp + UI/View.h + UI/ViewGroup.cpp + UI/ViewGroup.h + UI/ScrollView.cpp + UI/ScrollView.h + UI/TabHolder.cpp + UI/TabHolder.h + UI/PopupScreens.cpp + UI/PopupScreens.h + BitScan.h + BitSet.h + Buffer.h + Buffer.cpp + CodeBlock.h + Common.h + CommonFuncs.h + CommonTypes.h + DbgNew.h + FakeEmitter.h + FakeCPUDetect.cpp + ExceptionHandlerSetup.cpp + ExceptionHandlerSetup.h + GhidraClient.h + GhidraClient.cpp + Log.h + Log.cpp + Log/ConsoleListener.cpp + Log/ConsoleListener.h + Log/LogManager.cpp + Log/LogManager.h + LogReporting.cpp + LogReporting.h + MemArenaAndroid.cpp + MemArenaDarwin.cpp + MemArenaPosix.cpp + MemArenaWin32.cpp + MemArenaHorizon.cpp + MemArena.h + MemoryUtil.cpp + MemoryUtilHorizon.cpp + MemoryUtil.h + OSVersion.cpp + OSVersion.h + StringUtils.cpp + StringUtils.h + SysError.h + SysError.cpp + TimeUtil.cpp + TimeUtil.h + ${CMAKE_SOURCE_DIR}/ext/jpge/jpgd.cpp + ${CMAKE_SOURCE_DIR}/ext/jpge/jpgd.h + ${CMAKE_SOURCE_DIR}/ext/jpge/jpge.cpp + ${CMAKE_SOURCE_DIR}/ext/jpge/jpge.h +) + +if(LIBRETRO) + target_include_directories(Common PRIVATE ${CMAKE_SOURCE_DIR}/libretro/libretro-common/include) +endif() + +setup_target_project(Common Common) + +if(IOS) + target_compile_definitions(Common PUBLIC GLES_SILENCE_DEPRECATION) +endif() + +target_link_libraries(Common Ext::Snappy cpu_features) + +if(SDL_LIB_TARGET AND TARGET SDL3::Headers) + target_link_libraries(Common SDL3::Headers) +endif() + +if(NOT LIBRETRO) + target_link_libraries(Common imgui) +endif() + +if(ARM64) + if(ANDROID) + target_link_libraries(Common adrenotools) + endif() +endif() + +target_compile_definitions(Common PRIVATE Z7_CRC_NUM_TABLES=1) + +if(TARGET Ext::GLEW) + target_link_libraries(Common Ext::GLEW) +endif() + +if(WIN32) + target_link_libraries(Common winmm dsound dxguid d2d1 dwrite d3d11 Version) +endif() + +target_link_libraries(Common ${LIBZIP_LIBRARY} ${LIB7ZIP_LIBRARY} ${PNG_LIBRARIES} ${BASISU_LIBRARIES} ${ZLIB_LIBRARY} pugixml vma gason udis86 ${RT_LIB} ${ATOMIC_LIB}) From abe6786ae14cee3cf1b24b7a9df9e2affc407931 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Henrik=20Rydg=C3=A5rd?= Date: Fri, 24 Jul 2026 18:26:09 +0200 Subject: [PATCH 02/10] Rename core to Core and extract it and GPU into their own CMakeLists.txt Mirrors the earlier Common extraction. The old "core" target folded in all of GPU/ (~200 files) plus a few ext/ files wholesale; Windows already treats GPU as its own project (GPU.vcxproj), so GPU/CMakeLists.txt splits that out too. GPU has a genuine two-way dependency with Core (Core/System.cpp calls GPU_Init(), GPU/* calls back into Core for Memory/Config/CoreTiming/etc), so GPU is a CMake OBJECT library: its object files are always included wherever consumed instead of being lazily pulled from an archive, avoiding the GNU ld single-pass archive-ordering problem a two-way STATIC dependency would hit. Also fixed a few library misattributions discovered while tracing what each file actually uses: - GlslangLibs (glslang/spirv-cross) moved from Core to Common, since it's Common/GPU/ShaderTranslation.cpp and VulkanContext.cpp that call into it directly. It only worked before because Core happened to always be linked after Common. - ZSTD and OPENGL_LIBRARIES/X11_LIBRARIES moved from Core to GPU, matching where they're actually called (GPU/Debugger/Record.cpp and Playback.cpp for ZSTD, GPU/GLES for raw gl*() calls). - GPU also needs Ext::Snappy directly (Playback.cpp calls snappy_uncompress) and the libretro-common include dir under LIBRETRO, both previously inherited for free by accident. Also fixed USE_DISCORD's add_compile_definitions ordering: it was being defined after ppsspp_ui's add_library call, so the UI target never actually saw it on non-MSVC platforms. Co-Authored-By: Claude Sonnet 5 Claude-Session: https://claude.ai/code/session_01PSNaZnHCjmryS3ziVN9gZU --- CMakeLists.txt | 1007 +-------------------------------------- Common/CMakeLists.txt | 7 + Core/CMakeLists.txt | 788 ++++++++++++++++++++++++++++++ GPU/CMakeLists.txt | 217 +++++++++ libretro/CMakeLists.txt | 2 +- 5 files changed, 1024 insertions(+), 997 deletions(-) create mode 100644 Core/CMakeLists.txt create mode 100644 GPU/CMakeLists.txt diff --git a/CMakeLists.txt b/CMakeLists.txt index 045fe0fc7b..fbd6abc7bd 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1285,8 +1285,11 @@ list(APPEND UISource ) if(NOT LIBRETRO) + if(USE_DISCORD AND NOT IOS) + add_compile_definitions(USE_DISCORD=1) + endif() add_library(ppsspp_ui STATIC ${UISource}) - target_link_libraries(ppsspp_ui Common core) + target_link_libraries(ppsspp_ui Common Core) endif() if(ANDROID) @@ -1351,840 +1354,6 @@ add_library(xxhash STATIC ) target_include_directories(xxhash PRIVATE ext/xxhash) -add_subdirectory(Common) - -set(CoreExtra) -set(CoreExtraLibs) - -list(APPEND CoreExtra - Core/MIPS/IR/IRAnalysis.cpp - Core/MIPS/IR/IRAnalysis.h - Core/MIPS/IR/IRCompALU.cpp - Core/MIPS/IR/IRCompBranch.cpp - Core/MIPS/IR/IRCompFPU.cpp - Core/MIPS/IR/IRCompLoadStore.cpp - Core/MIPS/IR/IRCompVFPU.cpp - Core/MIPS/IR/IRFrontend.cpp - Core/MIPS/IR/IRFrontend.h - Core/MIPS/IR/IRInst.cpp - Core/MIPS/IR/IRInst.h - Core/MIPS/IR/IRInterpreter.cpp - Core/MIPS/IR/IRInterpreter.h - Core/MIPS/IR/IRJit.cpp - Core/MIPS/IR/IRJit.h - Core/MIPS/IR/IRNativeCommon.cpp - Core/MIPS/IR/IRNativeCommon.h - Core/MIPS/IR/IRPassSimplify.cpp - Core/MIPS/IR/IRPassSimplify.h - Core/MIPS/IR/IRRegCache.cpp - Core/MIPS/IR/IRRegCache.h -) - -list(APPEND CoreExtra - Core/MIPS/ARM/ArmAsm.cpp - Core/MIPS/ARM/ArmCompALU.cpp - Core/MIPS/ARM/ArmCompBranch.cpp - Core/MIPS/ARM/ArmCompFPU.cpp - Core/MIPS/ARM/ArmCompLoadStore.cpp - Core/MIPS/ARM/ArmCompVFPU.cpp - Core/MIPS/ARM/ArmCompReplace.cpp - Core/MIPS/ARM/ArmJit.cpp - Core/MIPS/ARM/ArmJit.h - Core/MIPS/ARM/ArmRegCache.cpp - Core/MIPS/ARM/ArmRegCache.h - Core/MIPS/ARM/ArmRegCacheFPU.cpp - Core/MIPS/ARM/ArmRegCacheFPU.h - GPU/Common/VertexDecoderArm.cpp -) - -list(APPEND CoreExtra - Core/MIPS/ARM64/Arm64Asm.cpp - Core/MIPS/ARM64/Arm64CompALU.cpp - Core/MIPS/ARM64/Arm64CompBranch.cpp - Core/MIPS/ARM64/Arm64CompFPU.cpp - Core/MIPS/ARM64/Arm64CompLoadStore.cpp - Core/MIPS/ARM64/Arm64CompVFPU.cpp - Core/MIPS/ARM64/Arm64CompReplace.cpp - Core/MIPS/ARM64/Arm64Jit.cpp - Core/MIPS/ARM64/Arm64Jit.h - Core/MIPS/ARM64/Arm64RegCache.cpp - Core/MIPS/ARM64/Arm64RegCache.h - Core/MIPS/ARM64/Arm64RegCacheFPU.cpp - Core/MIPS/ARM64/Arm64RegCacheFPU.h - Core/MIPS/ARM64/Arm64IRAsm.cpp - Core/MIPS/ARM64/Arm64IRCompALU.cpp - Core/MIPS/ARM64/Arm64IRCompBranch.cpp - Core/MIPS/ARM64/Arm64IRCompFPU.cpp - Core/MIPS/ARM64/Arm64IRCompLoadStore.cpp - Core/MIPS/ARM64/Arm64IRCompSystem.cpp - Core/MIPS/ARM64/Arm64IRCompVec.cpp - Core/MIPS/ARM64/Arm64IRJit.cpp - Core/MIPS/ARM64/Arm64IRJit.h - Core/MIPS/ARM64/Arm64IRRegCache.cpp - Core/MIPS/ARM64/Arm64IRRegCache.h - GPU/Common/VertexDecoderArm64.cpp - Core/Util/DisArm64.cpp -) - -list(APPEND CoreExtra - Core/MIPS/x86/Asm.cpp - Core/MIPS/x86/CompALU.cpp - Core/MIPS/x86/CompBranch.cpp - Core/MIPS/x86/CompFPU.cpp - Core/MIPS/x86/CompLoadStore.cpp - Core/MIPS/x86/CompVFPU.cpp - Core/MIPS/x86/CompReplace.cpp - Core/MIPS/x86/Jit.cpp - Core/MIPS/x86/Jit.h - Core/MIPS/x86/JitSafeMem.cpp - Core/MIPS/x86/JitSafeMem.h - Core/MIPS/x86/RegCache.cpp - Core/MIPS/x86/RegCache.h - Core/MIPS/x86/RegCacheFPU.cpp - Core/MIPS/x86/RegCacheFPU.h - Core/MIPS/x86/X64IRAsm.cpp - Core/MIPS/x86/X64IRCompALU.cpp - Core/MIPS/x86/X64IRCompBranch.cpp - Core/MIPS/x86/X64IRCompFPU.cpp - Core/MIPS/x86/X64IRCompLoadStore.cpp - Core/MIPS/x86/X64IRCompSystem.cpp - Core/MIPS/x86/X64IRCompVec.cpp - Core/MIPS/x86/X64IRJit.cpp - Core/MIPS/x86/X64IRJit.h - Core/MIPS/x86/X64IRRegCache.cpp - Core/MIPS/x86/X64IRRegCache.h - GPU/Common/VertexDecoderX86.cpp - GPU/Software/DrawPixelX86.cpp - GPU/Software/SamplerX86.cpp -) - -list(APPEND CoreExtra - Core/MIPS/RiscV/RiscVAsm.cpp - Core/MIPS/RiscV/RiscVCompALU.cpp - Core/MIPS/RiscV/RiscVCompBranch.cpp - Core/MIPS/RiscV/RiscVCompFPU.cpp - Core/MIPS/RiscV/RiscVCompLoadStore.cpp - Core/MIPS/RiscV/RiscVCompSystem.cpp - Core/MIPS/RiscV/RiscVCompVec.cpp - Core/MIPS/RiscV/RiscVJit.cpp - Core/MIPS/RiscV/RiscVJit.h - Core/MIPS/RiscV/RiscVRegCache.cpp - Core/MIPS/RiscV/RiscVRegCache.h - GPU/Common/VertexDecoderRiscV.cpp -) - -list(APPEND CoreExtra - Core/MIPS/LoongArch64/LoongArch64Asm.cpp - Core/MIPS/LoongArch64/LoongArch64CompALU.cpp - Core/MIPS/LoongArch64/LoongArch64CompBranch.cpp - Core/MIPS/LoongArch64/LoongArch64CompFPU.cpp - Core/MIPS/LoongArch64/LoongArch64CompLoadStore.cpp - Core/MIPS/LoongArch64/LoongArch64CompSystem.cpp - Core/MIPS/LoongArch64/LoongArch64CompVec.cpp - Core/MIPS/LoongArch64/LoongArch64Jit.cpp - Core/MIPS/LoongArch64/LoongArch64Jit.h - Core/MIPS/LoongArch64/LoongArch64RegCache.cpp - Core/MIPS/LoongArch64/LoongArch64RegCache.h - GPU/Common/VertexDecoderLoongArch64.cpp -) - -if(NOT MOBILE_DEVICE) - list(APPEND CoreExtra - Core/AVIDump.cpp - Core/AVIDump.h - Core/WaveFile.cpp - Core/WaveFile.h - ) -endif() - -set(GPU_GLES - GPU/GLES/StencilBufferGLES.cpp - GPU/GLES/GPU_GLES.cpp - GPU/GLES/GPU_GLES.h - GPU/GLES/FragmentTestCacheGLES.cpp - GPU/GLES/FragmentTestCacheGLES.h - GPU/GLES/FramebufferManagerGLES.cpp - GPU/GLES/FramebufferManagerGLES.h - GPU/GLES/ShaderManagerGLES.cpp - GPU/GLES/ShaderManagerGLES.h - GPU/GLES/StateMappingGLES.cpp - GPU/GLES/StateMappingGLES.h - GPU/GLES/TextureCacheGLES.cpp - GPU/GLES/TextureCacheGLES.h - GPU/GLES/DrawEngineGLES.cpp - GPU/GLES/DrawEngineGLES.h -) - -set(GPU_VULKAN - GPU/Vulkan/DebugVisVulkan.cpp - GPU/Vulkan/DebugVisVulkan.h - GPU/Vulkan/DrawEngineVulkan.cpp - GPU/Vulkan/DrawEngineVulkan.h - GPU/Vulkan/FramebufferManagerVulkan.cpp - GPU/Vulkan/FramebufferManagerVulkan.h - GPU/Vulkan/GPU_Vulkan.cpp - GPU/Vulkan/GPU_Vulkan.h - GPU/Vulkan/PipelineManagerVulkan.cpp - GPU/Vulkan/PipelineManagerVulkan.h - GPU/Vulkan/ShaderManagerVulkan.cpp - GPU/Vulkan/ShaderManagerVulkan.h - GPU/Vulkan/StateMappingVulkan.cpp - GPU/Vulkan/StateMappingVulkan.h - GPU/Vulkan/TextureCacheVulkan.cpp - GPU/Vulkan/TextureCacheVulkan.h - GPU/Vulkan/VulkanUtil.cpp - GPU/Vulkan/VulkanUtil.h -) - -set(GPU_D3D11 - GPU/D3D11/DrawEngineD3D11.cpp - GPU/D3D11/DrawEngineD3D11.h - GPU/D3D11/FramebufferManagerD3D11.cpp - GPU/D3D11/FramebufferManagerD3D11.h - GPU/D3D11/GPU_D3D11.cpp - GPU/D3D11/GPU_D3D11.h - GPU/D3D11/D3D11Util.cpp - GPU/D3D11/D3D11Util.h - GPU/D3D11/ShaderManagerD3D11.cpp - GPU/D3D11/ShaderManagerD3D11.h - GPU/D3D11/StateMappingD3D11.cpp - GPU/D3D11/StateMappingD3D11.h - GPU/D3D11/TextureCacheD3D11.cpp - GPU/D3D11/TextureCacheD3D11.h -) - -# We build Vulkan even on Apple to avoid annoying build differences. -set(GPU_IMPLS ${GPU_GLES} ${GPU_VULKAN}) -if(WIN32) - list(APPEND GPU_IMPLS ${GPU_D3D11}) -endif() - -set(GPU_SOURCES - ${GPU_IMPLS} - ${GPU_NEON} - GPU/Common/Draw2D.cpp - GPU/Common/Draw2D.h - GPU/Common/DepthBufferCommon.cpp - GPU/Common/DepthRaster.cpp - GPU/Common/DepthRaster.h - GPU/Common/TextureShaderCommon.cpp - GPU/Common/TextureShaderCommon.h - GPU/Common/DepalettizeShaderCommon.cpp - GPU/Common/DepalettizeShaderCommon.h - GPU/Common/FragmentShaderGenerator.cpp - GPU/Common/FragmentShaderGenerator.h - GPU/Common/VertexShaderGenerator.cpp - GPU/Common/VertexShaderGenerator.h - GPU/Common/FramebufferManagerCommon.cpp - GPU/Common/FramebufferManagerCommon.h - GPU/Common/GPUDebugInterface.cpp - GPU/Common/GPUDebugInterface.h - GPU/Common/GPUStateUtils.cpp - GPU/Common/GPUStateUtils.h - GPU/Common/DrawEngineCommon.cpp - GPU/Common/DrawEngineCommon.h - GPU/Common/PresentationCommon.cpp - GPU/Common/PresentationCommon.h - GPU/Common/ReinterpretFramebuffer.cpp - GPU/Common/ReinterpretFramebuffer.h - GPU/Common/ShaderId.cpp - GPU/Common/ShaderId.h - GPU/Common/ShaderUniforms.cpp - GPU/Common/ShaderUniforms.h - GPU/Common/ShaderCommon.cpp - GPU/Common/ShaderCommon.h - GPU/Common/SplineCommon.cpp - GPU/Common/SplineCommon.h - GPU/Common/StencilCommon.cpp - GPU/Common/StencilCommon.h - GPU/Common/SoftwareTransformCommon.cpp - GPU/Common/SoftwareTransformCommon.h - GPU/Common/VertexDecoderCommon.cpp - GPU/Common/VertexDecoderCommon.h - GPU/Common/VertexDecoderHandwritten.cpp - GPU/Common/VertexDecoderHandwritten.h - GPU/Common/VertexReader.h - GPU/Common/TransformCommon.cpp - GPU/Common/TransformCommon.h - GPU/Common/IndexGenerator.cpp - GPU/Common/IndexGenerator.h - GPU/Common/ImageCommon.h - GPU/Common/TextureDecoder.cpp - GPU/Common/TextureDecoder.h - GPU/Common/TextureCacheCommon.cpp - GPU/Common/TextureCacheCommon.h - GPU/Common/TextureScalerCommon.cpp - GPU/Common/TextureScalerCommon.h - GPU/Common/PostShader.cpp - GPU/Common/PostShader.h - GPU/Common/TextureReplacer.cpp - GPU/Common/TextureReplacer.h - GPU/Common/ReplacedTexture.cpp - GPU/Common/ReplacedTexture.h - GPU/Debugger/Breakpoints.cpp - GPU/Debugger/Breakpoints.h - GPU/Debugger/Debugger.cpp - GPU/Debugger/Debugger.h - GPU/Debugger/GECommandTable.cpp - GPU/Debugger/GECommandTable.h - GPU/Debugger/Playback.cpp - GPU/Debugger/Playback.h - GPU/Debugger/Record.cpp - GPU/Debugger/Record.h - GPU/Debugger/RecordFormat.h - GPU/Debugger/State.cpp - GPU/Debugger/State.h - GPU/Debugger/Stepping.cpp - GPU/Debugger/Stepping.h - GPU/ge_constants.h - GPU/GeConstants.cpp - GPU/GPUDefinitions.h - GPU/GeDisasm.cpp - GPU/GeDisasm.h - GPU/GPU.cpp - GPU/GPU.h - GPU/GPUCommon.cpp - GPU/GPUCommon.h - GPU/GPUCommonHW.cpp - GPU/GPUCommonHW.h - GPU/GPUState.cpp - GPU/GPUState.h - GPU/GPUStateSIMDUtil.h - GPU/Math3D.cpp - GPU/Math3D.h - GPU/Software/BinManager.cpp - GPU/Software/BinManager.h - GPU/Software/Clipper.cpp - GPU/Software/Clipper.h - GPU/Software/DrawPixel.cpp - GPU/Software/DrawPixel.h - GPU/Software/FuncId.cpp - GPU/Software/FuncId.h - GPU/Software/Lighting.cpp - GPU/Software/Lighting.h - GPU/Software/Rasterizer.cpp - GPU/Software/Rasterizer.h - GPU/Software/RasterizerRectangle.cpp - GPU/Software/RasterizerRectangle.h - GPU/Software/RasterizerRegCache.cpp - GPU/Software/RasterizerRegCache.h - GPU/Software/Sampler.cpp - GPU/Software/Sampler.h - GPU/Software/SoftGpu.cpp - GPU/Software/SoftGpu.h - GPU/Software/TransformUnit.cpp - GPU/Software/TransformUnit.h -) - -set(aemu_postoffice - ext/aemu_postoffice/client/postoffice.c - ext/aemu_postoffice/client/postoffice_mem_stdc.c - ext/aemu_postoffice/client/mutex_impl_cpp.cpp - ext/aemu_postoffice/client/delay_impl_cpp.cpp - ext/aemu_postoffice/client/log_impl_ppsspp.cpp -) - -if(WIN32) - list(APPEND aemu_postoffice - ext/aemu_postoffice/client/sock_impl_windows.c - ) -endif() - -if(LINUX OR ANDROID OR MACOSX OR IOS OR BSD) - list(APPEND aemu_postoffice - ext/aemu_postoffice/client/sock_impl_linux.c - ) -endif() - -if((MACOSX OR IOS) AND NOT LIBRETRO) - list(APPEND CoreExtra - Core/Util/DarwinFileSystemServices.mm - Core/Util/DarwinFileSystemServices.h) -endif() - -set(CmdLine) - -if(NOT LIBRETRO) - list(APPEND CmdLine - Core/CmdLine.cpp - Core/CmdLine.h - ) -endif() - -add_library(core STATIC - ${CoreExtra} - ${CmdLine} - Core/Config.cpp - Core/Config.h - Core/ConfigSettings.cpp - Core/ConfigSettings.h - Core/ConfigValues.h - Core/ControlMapper.cpp - Core/ControlMapper.h - Core/Core.cpp - Core/Core.h - Core/Compatibility.cpp - Core/Compatibility.h - Core/CoreParameter.h - Core/CoreTiming.cpp - Core/CoreTiming.h - Core/CwCheat.cpp - Core/CwCheat.h - Core/FrameTiming.cpp - Core/FrameTiming.h - Core/HDRemaster.cpp - Core/HDRemaster.h - Core/Instance.cpp - Core/Instance.h - Core/KeyMap.cpp - Core/KeyMap.h - Core/KeyMapDefaults.cpp - Core/KeyMapDefaults.h - Core/LuaContext.cpp - Core/LuaContext.h - Core/RetroAchievements.h - Core/RetroAchievements.cpp - Core/TiltEventProcessor.h - Core/TiltEventProcessor.cpp - Core/WebServer.cpp - Core/WebServer.h - Core/Debugger/Breakpoints.cpp - Core/Debugger/Breakpoints.h - Core/Debugger/DebugInterface.h - Core/Debugger/MemBlockInfo.cpp - Core/Debugger/MemBlockInfo.h - Core/Debugger/SymbolMap.cpp - Core/Debugger/SymbolMap.h - Core/Debugger/Watch.h - Core/Debugger/DisassemblyManager.cpp - Core/Debugger/DisassemblyManager.h - Core/Debugger/WebSocket.cpp - Core/Debugger/WebSocket.h - Core/Debugger/WebSocket/BreakpointSubscriber.cpp - Core/Debugger/WebSocket/BreakpointSubscriber.h - Core/Debugger/WebSocket/CPUCoreSubscriber.cpp - Core/Debugger/WebSocket/CPUCoreSubscriber.h - Core/Debugger/WebSocket/DisasmSubscriber.cpp - Core/Debugger/WebSocket/DisasmSubscriber.h - Core/Debugger/WebSocket/GameBroadcaster.cpp - Core/Debugger/WebSocket/GameBroadcaster.h - Core/Debugger/WebSocket/GameSubscriber.cpp - Core/Debugger/WebSocket/GameSubscriber.h - Core/Debugger/WebSocket/ClientConfigSubscriber.cpp - Core/Debugger/WebSocket/ClientConfigSubscriber.h - Core/Debugger/WebSocket/GPUBufferSubscriber.cpp - Core/Debugger/WebSocket/GPUBufferSubscriber.h - Core/Debugger/WebSocket/GPURecordSubscriber.cpp - Core/Debugger/WebSocket/GPURecordSubscriber.h - Core/Debugger/WebSocket/GPUStatsSubscriber.cpp - Core/Debugger/WebSocket/GPUStatsSubscriber.h - Core/Debugger/WebSocket/HLESubscriber.cpp - Core/Debugger/WebSocket/HLESubscriber.h - Core/Debugger/WebSocket/InputBroadcaster.cpp - Core/Debugger/WebSocket/InputBroadcaster.h - Core/Debugger/WebSocket/InputSubscriber.cpp - Core/Debugger/WebSocket/InputSubscriber.h - Core/Debugger/WebSocket/LogBroadcaster.cpp - Core/Debugger/WebSocket/LogBroadcaster.h - Core/Debugger/WebSocket/MemoryInfoSubscriber.cpp - Core/Debugger/WebSocket/MemoryInfoSubscriber.h - Core/Debugger/WebSocket/MemorySubscriber.cpp - Core/Debugger/WebSocket/MemorySubscriber.h - Core/Debugger/WebSocket/ReplaySubscriber.cpp - Core/Debugger/WebSocket/ReplaySubscriber.h - Core/Debugger/WebSocket/SteppingBroadcaster.cpp - Core/Debugger/WebSocket/SteppingBroadcaster.h - Core/Debugger/WebSocket/SteppingSubscriber.cpp - Core/Debugger/WebSocket/SteppingSubscriber.h - Core/Debugger/WebSocket/WebSocketUtils.cpp - Core/Debugger/WebSocket/WebSocketUtils.h - Core/Dialog/PSPDialog.cpp - Core/Dialog/PSPDialog.h - Core/Dialog/PSPGamedataInstallDialog.cpp - Core/Dialog/PSPGamedataInstallDialog.h - Core/Dialog/PSPMsgDialog.cpp - Core/Dialog/PSPMsgDialog.h - Core/Dialog/PSPNetconfDialog.cpp - Core/Dialog/PSPNetconfDialog.h - Core/Dialog/PSPNpSigninDialog.cpp - Core/Dialog/PSPNpSigninDialog.h - Core/Dialog/PSPOskDialog.cpp - Core/Dialog/PSPOskDialog.h - Core/Dialog/PSPOskConstants.cpp - Core/Dialog/PSPOskConstants.h - Core/Dialog/PSPPlaceholderDialog.cpp - Core/Dialog/PSPPlaceholderDialog.h - Core/Dialog/PSPSaveDialog.cpp - Core/Dialog/PSPSaveDialog.h - Core/Dialog/PSPScreenshotDialog.cpp - Core/Dialog/PSPScreenshotDialog.h - Core/Dialog/SavedataParam.cpp - Core/Dialog/SavedataParam.h - Core/ELF/ElfReader.cpp - Core/ELF/ElfReader.h - Core/ELF/PSPElfTypes.h - Core/ELF/PBPReader.cpp - Core/ELF/PBPReader.h - Core/ELF/PrxDecrypter.cpp - Core/ELF/PrxDecrypter.h - Core/ELF/ParamSFO.cpp - Core/ELF/ParamSFO.h - Core/EmuThread.cpp - Core/EmuThread.h - Core/FFMPEGCompat.h - Core/FileSystems/tlzrc.cpp - Core/FileSystems/BlobFileSystem.cpp - Core/FileSystems/BlobFileSystem.h - Core/FileSystems/BlockDevices.cpp - Core/FileSystems/BlockDevices.h - Core/FileSystems/DirectoryFileSystem.cpp - Core/FileSystems/DirectoryFileSystem.h - Core/FileSystems/FileSystem.h - Core/FileSystems/FileSystem.cpp - Core/FileSystems/ISOFileSystem.cpp - Core/FileSystems/ISOFileSystem.h - Core/FileSystems/MetaFileSystem.cpp - Core/FileSystems/MetaFileSystem.h - Core/FileSystems/VirtualDiscFileSystem.cpp - Core/FileSystems/VirtualDiscFileSystem.h - Core/Font/PGF.cpp - Core/Font/PGF.h - Core/HLE/FunctionWrappers.h - Core/HLE/HLE.cpp - Core/HLE/HLE.h - Core/HLE/ReplaceTables.cpp - Core/HLE/ReplaceTables.h - Core/HLE/HLEHelperThread.cpp - Core/HLE/HLEHelperThread.h - Core/HLE/HLETables.cpp - Core/HLE/HLETables.h - Core/HLE/KernelWaitHelpers.h - Core/HLE/PSPThreadContext.h - Core/HLE/KUBridge.h - Core/HLE/KUBridge.cpp - Core/HLE/Plugins.h - Core/HLE/Plugins.cpp - Core/HLE/ThreadQueueList.h - Core/HLE/__sceAudio.cpp - Core/HLE/__sceAudio.h - Core/HLE/sceAdler.cpp - Core/HLE/sceAdler.h - Core/HLE/AtracBase.h - Core/HLE/AtracCtx.cpp - Core/HLE/AtracCtx.h - Core/HLE/AtracCtx2.cpp - Core/HLE/AtracCtx2.h - Core/HLE/NetInetConstants.cpp - Core/HLE/NetInetConstants.h - Core/HLE/SocketManager.cpp - Core/HLE/SocketManager.h - Core/HLE/sceAtrac.cpp - Core/HLE/sceAtrac.h - Core/HLE/sceAudio.cpp - Core/HLE/sceAudiocodec.cpp - Core/HLE/sceAudiocodec.h - Core/HLE/sceAudioRouting.cpp - Core/HLE/sceAudioRouting.h - Core/HLE/sceAudio.h - Core/HLE/sceCcc.h - Core/HLE/sceCcc.cpp - Core/HLE/sceChnnlsv.cpp - Core/HLE/sceChnnlsv.h - Core/HLE/sceCtrl.cpp - Core/HLE/sceCtrl.h - Core/HLE/sceDeflt.cpp - Core/HLE/sceDeflt.h - Core/HLE/sceDisplay.cpp - Core/HLE/sceDisplay.h - Core/HLE/sceDmac.cpp - Core/HLE/sceDmac.h - Core/HLE/sceG729.cpp - Core/HLE/sceG729.h - Core/HLE/sceGameUpdate.cpp - Core/HLE/sceGameUpdate.h - Core/HLE/sceGe.cpp - Core/HLE/sceGe.h - Core/HLE/sceFont.cpp - Core/HLE/sceFont.h - Core/HLE/sceHeap.cpp - Core/HLE/sceHeap.h - Core/HLE/sceHprm.cpp - Core/HLE/sceHprm.h - Core/HLE/sceHttp.cpp - Core/HLE/sceHttp.h - Core/HLE/sceImpose.cpp - Core/HLE/sceImpose.h - Core/HLE/sceIo.cpp - Core/HLE/sceIo.h - Core/HLE/sceJpeg.cpp - Core/HLE/sceJpeg.h - Core/HLE/sceKernel.cpp - Core/HLE/sceKernel.h - Core/HLE/sceKernelAlarm.cpp - Core/HLE/sceKernelAlarm.h - Core/HLE/sceKernelEventFlag.cpp - Core/HLE/sceKernelEventFlag.h - Core/HLE/sceKernelHeap.cpp - Core/HLE/sceKernelHeap.h - Core/HLE/sceKernelInterrupt.cpp - Core/HLE/sceKernelInterrupt.h - Core/HLE/sceKernelMbx.cpp - Core/HLE/sceKernelMbx.h - Core/HLE/sceKernelMemory.cpp - Core/HLE/sceKernelMemory.h - Core/HLE/sceKernelModule.cpp - Core/HLE/sceKernelModule.h - Core/HLE/sceKernelMsgPipe.cpp - Core/HLE/sceKernelMsgPipe.h - Core/HLE/sceKernelMutex.cpp - Core/HLE/sceKernelMutex.h - Core/HLE/sceKernelSemaphore.cpp - Core/HLE/sceKernelSemaphore.h - Core/HLE/sceKernelThread.cpp - Core/HLE/sceKernelThread.h - Core/HLE/sceKernelTime.cpp - Core/HLE/sceKernelTime.h - Core/HLE/sceKernelVTimer.cpp - Core/HLE/sceKernelVTimer.h - Core/HLE/sceMpeg.cpp - Core/HLE/sceMpeg.h - Core/HLE/sceNet.cpp - Core/HLE/sceNet.h - Core/HLE/sceNet_lib.cpp - Core/HLE/sceNet_lib.h - Core/HLE/NetAdhocCommon.cpp - Core/HLE/NetAdhocCommon.h - Core/HLE/sceNetAdhoc.cpp - Core/HLE/sceNetAdhoc.h - ${aemu_postoffice} - Core/HLE/sceNetAdhocMatching.cpp - Core/HLE/sceNetAdhocMatching.h - Core/HLE/sceNetInet.cpp - Core/HLE/sceNetInet.h - Core/HLE/sceNetApctl.cpp - Core/HLE/sceNetApctl.h - Core/HLE/sceNetResolver.cpp - Core/HLE/sceNetResolver.h - Core/HLE/proAdhoc.h - Core/HLE/proAdhoc.cpp - Core/HLE/proAdhocServer.h - Core/HLE/proAdhocServer.cpp - Core/HLE/sceOpenPSID.cpp - Core/HLE/sceOpenPSID.h - Core/HLE/sceP3da.cpp - Core/HLE/sceP3da.h - Core/HLE/sceMt19937.cpp - Core/HLE/sceMt19937.h - Core/HLE/sceMd5.cpp - Core/HLE/sceMd5.h - Core/HLE/sceAac.cpp - Core/HLE/sceAac.h - Core/HLE/sceMp4.cpp - Core/HLE/sceMp4.h - Core/HLE/sceMp3.cpp - Core/HLE/sceMp3.h - Core/HLE/sceParseHttp.cpp - Core/HLE/sceParseHttp.h - Core/HLE/sceParseUri.cpp - Core/HLE/sceParseUri.h - Core/HLE/scePower.cpp - Core/HLE/scePower.h - Core/HLE/scePsmf.cpp - Core/HLE/scePsmf.h - Core/HLE/sceReg.cpp - Core/HLE/sceReg.h - Core/HLE/sceRtc.cpp - Core/HLE/sceRtc.h - Core/HLE/sceSas.cpp - Core/HLE/sceSas.h - Core/HLE/sceSfmt19937.cpp - Core/HLE/sceSfmt19937.h - Core/HLE/sceSha256.cpp - Core/HLE/sceSha256.h - Core/HLE/sceSircs.cpp - Core/HLE/sceSircs.h - Core/HLE/sceSsl.cpp - Core/HLE/sceSsl.h - Core/HLE/sceUmd.cpp - Core/HLE/sceUmd.h - Core/HLE/sceUsb.cpp - Core/HLE/sceUsb.h - Core/HLE/sceUsbAcc.cpp - Core/HLE/sceUsbAcc.h - Core/HLE/sceUsbCam.cpp - Core/HLE/sceUsbCam.h - Core/HLE/sceUsbGps.cpp - Core/HLE/sceUsbGps.h - Core/HLE/sceUsbMic.cpp - Core/HLE/sceUsbMic.h - Core/HLE/sceUtility.cpp - Core/HLE/sceUtility.h - Core/HLE/sceVaudio.cpp - Core/HLE/sceVaudio.h - Core/HLE/scePspNpDrm_user.cpp - Core/HLE/scePspNpDrm_user.h - Core/HLE/sceNp.cpp - Core/HLE/sceNp.h - Core/HLE/sceNp2.cpp - Core/HLE/sceNp2.h - Core/HLE/scePauth.cpp - Core/HLE/scePauth.h - Core/HW/SimpleAudioDec.cpp - Core/HW/SimpleAudioDec.h - Core/HW/Atrac3Standalone.cpp - Core/HW/Atrac3Standalone.h - Core/HW/SimpleAudioDec.h - Core/HW/AsyncIOManager.cpp - Core/HW/AsyncIOManager.h - Core/HW/BufferQueue.cpp - Core/HW/BufferQueue.h - Core/HW/Camera.cpp - Core/HW/Camera.h - Core/HW/Display.cpp - Core/HW/Display.h - Core/HW/GranularMixer.cpp - Core/HW/GranularMixer.h - Core/HW/MediaEngine.cpp - Core/HW/MediaEngine.h - Core/HW/MpegDemux.cpp - Core/HW/MpegDemux.h - Core/HW/MemoryStick.cpp - Core/HW/MemoryStick.h - Core/HW/SasAudio.cpp - Core/HW/SasAudio.h - Core/HW/SasReverb.cpp - Core/HW/SasReverb.h - Core/HW/StereoResampler.cpp - Core/HW/StereoResampler.h - Core/Loaders.cpp - Core/Loaders.h - Core/FileLoaders/CachingFileLoader.cpp - Core/FileLoaders/CachingFileLoader.h - Core/FileLoaders/DiskCachingFileLoader.cpp - Core/FileLoaders/DiskCachingFileLoader.h - Core/FileLoaders/HTTPFileLoader.cpp - Core/FileLoaders/HTTPFileLoader.h - Core/FileLoaders/LocalFileLoader.cpp - Core/FileLoaders/LocalFileLoader.h - Core/FileLoaders/RamCachingFileLoader.cpp - Core/FileLoaders/RamCachingFileLoader.h - Core/FileLoaders/RetryingFileLoader.cpp - Core/FileLoaders/RetryingFileLoader.h - Core/FileLoaders/ZipFileLoader.cpp - Core/FileLoaders/ZipFileLoader.h - Core/MIPS/MIPS.cpp - Core/MIPS/MIPS.h - Core/MIPS/MIPSAnalyst.cpp - Core/MIPS/MIPSAnalyst.h - Core/MIPS/MIPSCodeUtils.cpp - Core/MIPS/MIPSCodeUtils.h - Core/MIPS/MIPSDebugInterface.cpp - Core/MIPS/MIPSDebugInterface.h - Core/MIPS/MIPSDis.cpp - Core/MIPS/MIPSDis.h - Core/MIPS/MIPSDisVFPU.cpp - Core/MIPS/MIPSDisVFPU.h - Core/MIPS/MIPSInt.cpp - Core/MIPS/MIPSInt.h - Core/MIPS/MIPSIntVFPU.cpp - Core/MIPS/MIPSIntVFPU.h - Core/MIPS/MIPSStackWalk.cpp - Core/MIPS/MIPSStackWalk.h - Core/MIPS/MIPSTables.cpp - Core/MIPS/MIPSTables.h - Core/MIPS/MIPSVFPUUtils.cpp - Core/MIPS/MIPSVFPUUtils.h - Core/MIPS/MIPSVFPUFallbacks.cpp - Core/MIPS/MIPSVFPUFallbacks.h - Core/MIPS/MIPSAsm.cpp - Core/MIPS/MIPSAsm.h - Core/MIPS/MIPSTracer.cpp - Core/MIPS/MIPSTracer.h - Core/MIPS/JitCommon/JitCommon.cpp - Core/MIPS/JitCommon/JitCommon.h - Core/MIPS/JitCommon/JitBlockCache.cpp - Core/MIPS/JitCommon/JitBlockCache.h - Core/MIPS/JitCommon/JitState.cpp - Core/MIPS/JitCommon/JitState.h - Core/Util/DisArm64.h - Core/Util/DisArm64.cpp - Core/MIPS/fake/FakeJit.cpp - Core/MIPS/fake/FakeJit.h - Core/MemFault.cpp - Core/MemFault.h - Core/MemMap.cpp - Core/MemMap.h - Core/MemMapFunctions.cpp - Core/MemMapHelpers.h - Core/PSPLoaders.cpp - Core/PSPLoaders.h - Core/Reporting.cpp - Core/Reporting.h - Core/Replay.cpp - Core/Replay.h - Core/SaveState.cpp - Core/SaveState.h - Core/SaveStateRewind.cpp - Core/SaveStateRewind.h - Core/Screenshot.cpp - Core/Screenshot.h - Core/System.cpp - Core/System.h - Core/Util/AtracTrack.cpp - Core/Util/AtracTrack.h - Core/Util/AudioFormat.cpp - Core/Util/AudioFormat.h - Core/Util/GameManager.cpp - Core/Util/GameManager.h - Core/Util/MemStick.cpp - Core/Util/MemStick.h - Core/Util/GameDB.cpp - Core/Util/GameDB.h - Core/Util/PathUtil.cpp - Core/Util/PathUtil.h - Core/Util/PortManager.cpp - Core/Util/PortManager.h - Core/Util/BlockAllocator.cpp - Core/Util/BlockAllocator.h - Core/Util/PPGeDraw.cpp - Core/Util/PPGeDraw.h - Core/Util/RecentFiles.cpp - Core/Util/RecentFiles.h - Core/Util/VideoPlayer.cpp - Core/Util/VideoPlayer.h - ${GPU_SOURCES} - ext/disarm.cpp - ext/disarm.h - ext/riscv-disas.cpp - ext/riscv-disas.h - ext/loongarch-disasm.cpp - ext/loongarch-disasm.h - ${CMAKE_CURRENT_BINARY_DIR}/git-version.cpp -) - -if((MACOSX OR IOS) AND NOT LIBRETRO) - set_source_files_properties(Core/Util/DarwinFileSystemServices.mm - PROPERTIES COMPILE_FLAGS -fobjc-arc) -endif() - -if(LIBRETRO) - target_include_directories(core PRIVATE libretro/libretro-common/include) -endif() - -if(ANDROID) - list(APPEND CoreExtraLibs android) - if(X86_64) - set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} -Wl,-Bsymbolic") - endif() -endif() - -list(APPEND CoreExtraLibs armips) - -# needed for VK_USE_PLATFORM_XCB_KHR only -#if(VULKAN AND NOT WIN32) -# target_link_libraries(native X11-xcb X11) -#endif() - set(GlslangLibs glslang OGLCompiler OSDependent SPIRV spirv-cross-glsl) if (ENABLE_SPVREMAPPER) @@ -2195,17 +1364,12 @@ if(WIN32) list(APPEND GlslangLibs spirv-cross-hlsl) endif() -if(OPENGL_opengl_LIBRARY AND OpenGL_GL_PREFERENCE STREQUAL GLVND AND NOT APPLE) - set(OPENGL_LIBRARIES OpenGL::OpenGL) -endif() +add_subdirectory(Common) if(USE_SYSTEM_ZSTD) find_package(ZSTD REQUIRED) - target_include_directories(core PRIVATE ${ZSTD_INCLUDE_DIR}) - list(APPEND CoreExtraLibs ${ZSTD_LIBRARY}) else() add_subdirectory(ext/zstd-build) - list(APPEND CoreExtraLibs libzstd_static) include_directories(ext/zstd/lib) endif() @@ -2218,161 +1382,12 @@ else() include_directories(ext/libchdr/include) endif() -target_link_libraries(core Common chdr kirk cityhash sfmt19937 xbrz xxhash rcheevos minimp3 at3_standalone lua ${GlslangLibs} - ${CoreExtraLibs} ${OPENGL_LIBRARIES} ${X11_LIBRARIES} ${CMAKE_DL_LIBS}) - -# Winsock -if(WIN32) - target_link_libraries(core ws2_32) -endif() - -if(NOT HTTPS_NOT_AVAILABLE) - target_link_libraries(core naett) -endif() - -target_compile_features(core PUBLIC cxx_std_17) - -if(FFmpeg_FOUND) - target_compile_definitions(core PRIVATE USE_FFMPEG=1) - if (HAVE_LIBAVCODEC_CONST_AVCODEC) - target_compile_definitions(core PRIVATE HAVE_LIBAVCODEC_CONST_AVCODEC=1) - endif() - set_target_properties(core PROPERTIES NO_SYSTEM_FROM_IMPORTED true) - target_include_directories(core BEFORE PUBLIC ${FFmpeg_INCLUDE_avcodec} ${FFmpeg_INCLUDE_avformat}) - target_link_libraries(core - FFmpeg::avcodec - FFmpeg::avformat - FFmpeg::avutil - FFmpeg::swresample - FFmpeg::swscale - ${ZLIB_LIBRARY} - ) -elseif(BUILD_BUNDLED_FFMPEG) - target_compile_definitions(core PRIVATE USE_FFMPEG=1) - set_target_properties(core PROPERTIES NO_SYSTEM_FROM_IMPORTED true) - target_link_libraries(core - avcodec - avformat - avutil - swresample - swscale - ${ZLIB_LIBRARY} - ) -endif() - -# Discord integration -if(USE_DISCORD AND NOT IOS AND NOT LIBRETRO) - add_compile_definitions(USE_DISCORD=1) - target_link_libraries(core discord-rpc) -endif() - -# miniUPnPc integration (MiniUPnPc supposed to works on any POSIX system, not sure if some of these are redundant/not needed tho) -if(USE_MINIUPNPC) - if(USE_SYSTEM_MINIUPNPC) - find_package(MINIUPNPC REQUIRED) - target_include_directories(core PRIVATE ${MINIUPNP_INCLUDE_DIR}) - target_link_libraries(core ${MINIUPNP_LIBRARY}) - add_compile_definitions(WITH_UPNP USE_SYSTEM_MINIUPNPC) - else() - set (MINIUPNPC_VERSION 2.2) # used by miniupnpcstrings.h.cmake - set (MINIUPNPC_API_VERSION 18) - option(UPNPC_BUILD_STATIC "Build static library" TRUE) - option(NO_GETADDRINFO "Define NO_GETADDRINFO" FALSE) - mark_as_advanced(NO_GETADDRINFO) - if (NO_GETADDRINFO) - add_compile_definitions(NO_GETADDRINFO) - endif() - - if (NOT WIN32) - add_compile_definitions (MINIUPNPC_SET_SOCKET_TIMEOUT) - add_compile_definitions (_BSD_SOURCE _DEFAULT_SOURCE _POSIX_C_SOURCE=200112L) - endif() - if (MACOSX) - add_compile_definitions (_DARWIN_C_SOURCE) - endif() - if(WIN32) - add_compile_definitions(WIN32 MINIUPNP_EXPORTS) - else() - add_compile_options(-fPIC) - endif() - - add_compile_definitions(WITH_UPNP MINIUPNP_STATICLIB) - set(MINIUPNP_DIR "ext/miniupnp/miniupnpc") - include_directories(${CMAKE_CURRENT_BINARY_DIR}) - include_directories(ext/miniupnp/miniupnpc/src) - include_directories(ext/miniupnp/miniupnpc/include) - configure_file(${MINIUPNP_DIR}/miniupnpcstrings.h.cmake ${CMAKE_CURRENT_BINARY_DIR}/miniupnpcstrings.h) # by default miniupnp repo doesn't contains miniupnpcstrings.h and need to be generated - set(MINIUPNPC_SOURCES - # the needed bits of miniupnpc (no python module, no tests, no cli) - ${MINIUPNP_DIR}/src/addr_is_reserved.c - ${MINIUPNP_DIR}/src/connecthostport.c - ${MINIUPNP_DIR}/src/igd_desc_parse.c - ${MINIUPNP_DIR}/src/minisoap.c - ${MINIUPNP_DIR}/src/minissdpc.c - ${MINIUPNP_DIR}/src/miniupnpc.c - #${MINIUPNP_DIR}/miniupnpcmodule.c - ${MINIUPNP_DIR}/src/miniwget.c - ${MINIUPNP_DIR}/src/minixml.c - ${MINIUPNP_DIR}/src/portlistingparse.c - ${MINIUPNP_DIR}/src/receivedata.c - #${MINIUPNP_DIR}/upnpc.c # causing an error due to already existing _main() - ${MINIUPNP_DIR}/src/upnpcommands.c - ${MINIUPNP_DIR}/src/upnpdev.c - ${MINIUPNP_DIR}/src/upnperrors.c - ${MINIUPNP_DIR}/src/upnpreplyparse.c - ${CMAKE_CURRENT_BINARY_DIR}/miniupnpcstrings.h - ) - if (NOT WIN32 AND NOT CMAKE_SYSTEM_NAME STREQUAL "AmigaOS") - #set(MINIUPNPC_SOURCES ${MINIUPNPC_SOURCES} minissdpc.c) # causing an error due to duplication in MINIUPNPC_SOURCES? - endif() - if (WIN32) - set_source_files_properties(${MINIUPNPC_SOURCES} PROPERTIES COMPILE_DEFINITIONS "MINIUPNP_STATICLIB;MINIUPNP_EXPORTS") - list(PREPEND LDLIBS ws2_32 iphlpapi) - #elseif (CMAKE_SYSTEM_NAME STREQUAL "Solaris") - # find_library (SOCKET_LIBRARY NAMES socket) - # find_library (NSL_LIBRARY NAMES nsl) - # find_library (RESOLV_LIBRARY NAMES resolv) - # set (LDLIBS ${SOCKET_LIBRARY} ${NSL_LIBRARY} ${RESOLV_LIBRARY} ${LDLIBS}) - endif() - if (UPNPC_BUILD_STATIC) - add_library(miniupnpc STATIC ${MINIUPNPC_SOURCES}) - target_link_libraries(core miniupnpc ${LDLIBS}) - set(UPNPC_LIBRARY miniupnpc) - if (MSVC) - # Suppress noise warnings - target_compile_definitions(miniupnpc PRIVATE _CRT_SECURE_NO_WARNINGS _WINSOCK_DEPRECATED_NO_WARNINGS) - endif() - if (WIN32) - target_link_libraries(miniupnpc ws2_32) - endif() - endif() - endif() -endif() - -setup_target_project(core Core) - -# Generate git-version at build time. -add_custom_target(GitVersion DEPENDS something_that_never_exists) - -set(WIN_VERSION_CMD "") -if (WIN32) - set(WIN_VERSION_CMD COMMAND ${CMAKE_SOURCE_DIR}/Windows/git-version-gen.cmd PPSSPPWindows) -endif() - -add_custom_command(OUTPUT something_that_never_exists - COMMAND ${CMAKE_COMMAND} -DSOURCE_DIR=${CMAKE_CURRENT_SOURCE_DIR} - -DOUTPUT_DIR=${CMAKE_CURRENT_BINARY_DIR} - -P ${CMAKE_CURRENT_SOURCE_DIR}/git-version.cmake - ${WIN_VERSION_CMD}) - -set_source_files_properties(${CMAKE_CURRENT_BINARY_DIR}/git-version.cpp - PROPERTIES GENERATED TRUE - SKIP_AUTOMOC ON) -add_dependencies(core GitVersion) +add_subdirectory(GPU) +add_subdirectory(Core) if(ANDROID AND NOT LIBRETRO) add_library(ppsspp_jni SHARED ${AndroidJniSource}) - target_link_libraries(ppsspp_jni core log EGL OpenSLES) + target_link_libraries(ppsspp_jni Core log EGL OpenSLES) if(TARGET ppsspp_ui) target_link_libraries(ppsspp_jni ppsspp_ui) endif() @@ -2573,7 +1588,7 @@ if(HEADLESS) ) endif() add_executable(PPSSPPHeadless ${HeadlessSource}) - target_link_libraries(PPSSPPHeadless ${COCOA_LIBRARY} ${QUARTZ_CORE_LIBRARY} ${IOKIT_LIBRARY} ${CMAKE_THREAD_LIBS_INIT} core) + target_link_libraries(PPSSPPHeadless ${COCOA_LIBRARY} ${QUARTZ_CORE_LIBRARY} ${IOKIT_LIBRARY} ${CMAKE_THREAD_LIBS_INIT} Core) if(SDL_LIB_TARGET) target_link_libraries(PPSSPPHeadless ${SDL_LIB_TARGET}) endif() @@ -2626,7 +1641,7 @@ if(UNITTEST) Windows/CaptureDevice.h ) endif() - target_link_libraries(PPSSPPUnitTest ${COCOA_LIBRARY} ${QUARTZ_CORE_LIBRARY} ${IOKIT_LIBRARY} ${CMAKE_THREAD_LIBS_INIT} Common core) + target_link_libraries(PPSSPPUnitTest ${COCOA_LIBRARY} ${QUARTZ_CORE_LIBRARY} ${IOKIT_LIBRARY} ${CMAKE_THREAD_LIBS_INIT} Common Core) if(SDL_LIB_TARGET) target_link_libraries(PPSSPPUnitTest ${SDL_LIB_TARGET}) endif() @@ -2751,7 +1766,7 @@ if(TargetBin) if(TARGET ppsspp_ui) target_link_libraries(${TargetBin} ${CMAKE_THREAD_LIBS_INIT} ${targetExtraLibs} ppsspp_ui) else() - target_link_libraries(${TargetBin} ${CMAKE_THREAD_LIBS_INIT} ${targetExtraLibs} core) + target_link_libraries(${TargetBin} ${CMAKE_THREAD_LIBS_INIT} ${targetExtraLibs} Core) endif() endif() diff --git a/Common/CMakeLists.txt b/Common/CMakeLists.txt index 359d36c288..e246a7e6d3 100644 --- a/Common/CMakeLists.txt +++ b/Common/CMakeLists.txt @@ -381,3 +381,10 @@ if(WIN32) endif() target_link_libraries(Common ${LIBZIP_LIBRARY} ${LIB7ZIP_LIBRARY} ${PNG_LIBRARIES} ${BASISU_LIBRARIES} ${ZLIB_LIBRARY} pugixml vma gason udis86 ${RT_LIB} ${ATOMIC_LIB}) + +# Common/GPU/ShaderTranslation.cpp and Common/GPU/Vulkan/VulkanContext.cpp call directly into +# glslang/spirv-cross, so Common needs to declare this dependency itself rather than relying on +# some downstream consumer happening to also link it (that was the previous, fragile setup: this +# was only linked to the old combined "core" target, which happened to always be linked after +# Common everywhere it mattered). +target_link_libraries(Common ${GlslangLibs}) diff --git a/Core/CMakeLists.txt b/Core/CMakeLists.txt new file mode 100644 index 0000000000..4eb63a94c1 --- /dev/null +++ b/Core/CMakeLists.txt @@ -0,0 +1,788 @@ +set(CoreExtra) +set(aemu_postoffice + ${CMAKE_SOURCE_DIR}/ext/aemu_postoffice/client/postoffice.c + ${CMAKE_SOURCE_DIR}/ext/aemu_postoffice/client/postoffice_mem_stdc.c + ${CMAKE_SOURCE_DIR}/ext/aemu_postoffice/client/mutex_impl_cpp.cpp + ${CMAKE_SOURCE_DIR}/ext/aemu_postoffice/client/delay_impl_cpp.cpp + ${CMAKE_SOURCE_DIR}/ext/aemu_postoffice/client/log_impl_ppsspp.cpp +) + +if(WIN32) + list(APPEND aemu_postoffice + ${CMAKE_SOURCE_DIR}/ext/aemu_postoffice/client/sock_impl_windows.c + ) +endif() + +if(LINUX OR ANDROID OR MACOSX OR IOS OR BSD) + list(APPEND aemu_postoffice + ${CMAKE_SOURCE_DIR}/ext/aemu_postoffice/client/sock_impl_linux.c + ) +endif() + +list(APPEND CoreExtra + MIPS/IR/IRAnalysis.cpp + MIPS/IR/IRAnalysis.h + MIPS/IR/IRCompALU.cpp + MIPS/IR/IRCompBranch.cpp + MIPS/IR/IRCompFPU.cpp + MIPS/IR/IRCompLoadStore.cpp + MIPS/IR/IRCompVFPU.cpp + MIPS/IR/IRFrontend.cpp + MIPS/IR/IRFrontend.h + MIPS/IR/IRInst.cpp + MIPS/IR/IRInst.h + MIPS/IR/IRInterpreter.cpp + MIPS/IR/IRInterpreter.h + MIPS/IR/IRJit.cpp + MIPS/IR/IRJit.h + MIPS/IR/IRNativeCommon.cpp + MIPS/IR/IRNativeCommon.h + MIPS/IR/IRPassSimplify.cpp + MIPS/IR/IRPassSimplify.h + MIPS/IR/IRRegCache.cpp + MIPS/IR/IRRegCache.h +) + +list(APPEND CoreExtra + MIPS/ARM/ArmAsm.cpp + MIPS/ARM/ArmCompALU.cpp + MIPS/ARM/ArmCompBranch.cpp + MIPS/ARM/ArmCompFPU.cpp + MIPS/ARM/ArmCompLoadStore.cpp + MIPS/ARM/ArmCompVFPU.cpp + MIPS/ARM/ArmCompReplace.cpp + MIPS/ARM/ArmJit.cpp + MIPS/ARM/ArmJit.h + MIPS/ARM/ArmRegCache.cpp + MIPS/ARM/ArmRegCache.h + MIPS/ARM/ArmRegCacheFPU.cpp + MIPS/ARM/ArmRegCacheFPU.h +) + +list(APPEND CoreExtra + MIPS/ARM64/Arm64Asm.cpp + MIPS/ARM64/Arm64CompALU.cpp + MIPS/ARM64/Arm64CompBranch.cpp + MIPS/ARM64/Arm64CompFPU.cpp + MIPS/ARM64/Arm64CompLoadStore.cpp + MIPS/ARM64/Arm64CompVFPU.cpp + MIPS/ARM64/Arm64CompReplace.cpp + MIPS/ARM64/Arm64Jit.cpp + MIPS/ARM64/Arm64Jit.h + MIPS/ARM64/Arm64RegCache.cpp + MIPS/ARM64/Arm64RegCache.h + MIPS/ARM64/Arm64RegCacheFPU.cpp + MIPS/ARM64/Arm64RegCacheFPU.h + MIPS/ARM64/Arm64IRAsm.cpp + MIPS/ARM64/Arm64IRCompALU.cpp + MIPS/ARM64/Arm64IRCompBranch.cpp + MIPS/ARM64/Arm64IRCompFPU.cpp + MIPS/ARM64/Arm64IRCompLoadStore.cpp + MIPS/ARM64/Arm64IRCompSystem.cpp + MIPS/ARM64/Arm64IRCompVec.cpp + MIPS/ARM64/Arm64IRJit.cpp + MIPS/ARM64/Arm64IRJit.h + MIPS/ARM64/Arm64IRRegCache.cpp + MIPS/ARM64/Arm64IRRegCache.h + Util/DisArm64.cpp +) + +list(APPEND CoreExtra + MIPS/x86/Asm.cpp + MIPS/x86/CompALU.cpp + MIPS/x86/CompBranch.cpp + MIPS/x86/CompFPU.cpp + MIPS/x86/CompLoadStore.cpp + MIPS/x86/CompVFPU.cpp + MIPS/x86/CompReplace.cpp + MIPS/x86/Jit.cpp + MIPS/x86/Jit.h + MIPS/x86/JitSafeMem.cpp + MIPS/x86/JitSafeMem.h + MIPS/x86/RegCache.cpp + MIPS/x86/RegCache.h + MIPS/x86/RegCacheFPU.cpp + MIPS/x86/RegCacheFPU.h + MIPS/x86/X64IRAsm.cpp + MIPS/x86/X64IRCompALU.cpp + MIPS/x86/X64IRCompBranch.cpp + MIPS/x86/X64IRCompFPU.cpp + MIPS/x86/X64IRCompLoadStore.cpp + MIPS/x86/X64IRCompSystem.cpp + MIPS/x86/X64IRCompVec.cpp + MIPS/x86/X64IRJit.cpp + MIPS/x86/X64IRJit.h + MIPS/x86/X64IRRegCache.cpp + MIPS/x86/X64IRRegCache.h +) + +list(APPEND CoreExtra + MIPS/RiscV/RiscVAsm.cpp + MIPS/RiscV/RiscVCompALU.cpp + MIPS/RiscV/RiscVCompBranch.cpp + MIPS/RiscV/RiscVCompFPU.cpp + MIPS/RiscV/RiscVCompLoadStore.cpp + MIPS/RiscV/RiscVCompSystem.cpp + MIPS/RiscV/RiscVCompVec.cpp + MIPS/RiscV/RiscVJit.cpp + MIPS/RiscV/RiscVJit.h + MIPS/RiscV/RiscVRegCache.cpp + MIPS/RiscV/RiscVRegCache.h +) + +list(APPEND CoreExtra + MIPS/LoongArch64/LoongArch64Asm.cpp + MIPS/LoongArch64/LoongArch64CompALU.cpp + MIPS/LoongArch64/LoongArch64CompBranch.cpp + MIPS/LoongArch64/LoongArch64CompFPU.cpp + MIPS/LoongArch64/LoongArch64CompLoadStore.cpp + MIPS/LoongArch64/LoongArch64CompSystem.cpp + MIPS/LoongArch64/LoongArch64CompVec.cpp + MIPS/LoongArch64/LoongArch64Jit.cpp + MIPS/LoongArch64/LoongArch64Jit.h + MIPS/LoongArch64/LoongArch64RegCache.cpp + MIPS/LoongArch64/LoongArch64RegCache.h +) + +if(NOT MOBILE_DEVICE) + list(APPEND CoreExtra + AVIDump.cpp + AVIDump.h + WaveFile.cpp + WaveFile.h + ) +endif() + +if((MACOSX OR IOS) AND NOT LIBRETRO) + list(APPEND CoreExtra + Util/DarwinFileSystemServices.mm + Util/DarwinFileSystemServices.h) +endif() + +set(CmdLine) +if(NOT LIBRETRO) + list(APPEND CmdLine + CmdLine.cpp + CmdLine.h + ) +endif() + +add_library(Core STATIC + ${CoreExtra} + ${CmdLine} + Config.cpp + Config.h + ConfigSettings.cpp + ConfigSettings.h + ConfigValues.h + ControlMapper.cpp + ControlMapper.h + Core.cpp + Core.h + Compatibility.cpp + Compatibility.h + CoreParameter.h + CoreTiming.cpp + CoreTiming.h + CwCheat.cpp + CwCheat.h + FrameTiming.cpp + FrameTiming.h + HDRemaster.cpp + HDRemaster.h + Instance.cpp + Instance.h + KeyMap.cpp + KeyMap.h + KeyMapDefaults.cpp + KeyMapDefaults.h + LuaContext.cpp + LuaContext.h + RetroAchievements.h + RetroAchievements.cpp + TiltEventProcessor.h + TiltEventProcessor.cpp + WebServer.cpp + WebServer.h + Debugger/Breakpoints.cpp + Debugger/Breakpoints.h + Debugger/DebugInterface.h + Debugger/MemBlockInfo.cpp + Debugger/MemBlockInfo.h + Debugger/SymbolMap.cpp + Debugger/SymbolMap.h + Debugger/Watch.h + Debugger/DisassemblyManager.cpp + Debugger/DisassemblyManager.h + Debugger/WebSocket.cpp + Debugger/WebSocket.h + Debugger/WebSocket/BreakpointSubscriber.cpp + Debugger/WebSocket/BreakpointSubscriber.h + Debugger/WebSocket/CPUCoreSubscriber.cpp + Debugger/WebSocket/CPUCoreSubscriber.h + Debugger/WebSocket/DisasmSubscriber.cpp + Debugger/WebSocket/DisasmSubscriber.h + Debugger/WebSocket/GameBroadcaster.cpp + Debugger/WebSocket/GameBroadcaster.h + Debugger/WebSocket/GameSubscriber.cpp + Debugger/WebSocket/GameSubscriber.h + Debugger/WebSocket/ClientConfigSubscriber.cpp + Debugger/WebSocket/ClientConfigSubscriber.h + Debugger/WebSocket/GPUBufferSubscriber.cpp + Debugger/WebSocket/GPUBufferSubscriber.h + Debugger/WebSocket/GPURecordSubscriber.cpp + Debugger/WebSocket/GPURecordSubscriber.h + Debugger/WebSocket/GPUStatsSubscriber.cpp + Debugger/WebSocket/GPUStatsSubscriber.h + Debugger/WebSocket/HLESubscriber.cpp + Debugger/WebSocket/HLESubscriber.h + Debugger/WebSocket/InputBroadcaster.cpp + Debugger/WebSocket/InputBroadcaster.h + Debugger/WebSocket/InputSubscriber.cpp + Debugger/WebSocket/InputSubscriber.h + Debugger/WebSocket/LogBroadcaster.cpp + Debugger/WebSocket/LogBroadcaster.h + Debugger/WebSocket/MemoryInfoSubscriber.cpp + Debugger/WebSocket/MemoryInfoSubscriber.h + Debugger/WebSocket/MemorySubscriber.cpp + Debugger/WebSocket/MemorySubscriber.h + Debugger/WebSocket/ReplaySubscriber.cpp + Debugger/WebSocket/ReplaySubscriber.h + Debugger/WebSocket/SteppingBroadcaster.cpp + Debugger/WebSocket/SteppingBroadcaster.h + Debugger/WebSocket/SteppingSubscriber.cpp + Debugger/WebSocket/SteppingSubscriber.h + Debugger/WebSocket/WebSocketUtils.cpp + Debugger/WebSocket/WebSocketUtils.h + Dialog/PSPDialog.cpp + Dialog/PSPDialog.h + Dialog/PSPGamedataInstallDialog.cpp + Dialog/PSPGamedataInstallDialog.h + Dialog/PSPMsgDialog.cpp + Dialog/PSPMsgDialog.h + Dialog/PSPNetconfDialog.cpp + Dialog/PSPNetconfDialog.h + Dialog/PSPNpSigninDialog.cpp + Dialog/PSPNpSigninDialog.h + Dialog/PSPOskDialog.cpp + Dialog/PSPOskDialog.h + Dialog/PSPOskConstants.cpp + Dialog/PSPOskConstants.h + Dialog/PSPPlaceholderDialog.cpp + Dialog/PSPPlaceholderDialog.h + Dialog/PSPSaveDialog.cpp + Dialog/PSPSaveDialog.h + Dialog/PSPScreenshotDialog.cpp + Dialog/PSPScreenshotDialog.h + Dialog/SavedataParam.cpp + Dialog/SavedataParam.h + ELF/ElfReader.cpp + ELF/ElfReader.h + ELF/PSPElfTypes.h + ELF/PBPReader.cpp + ELF/PBPReader.h + ELF/PrxDecrypter.cpp + ELF/PrxDecrypter.h + ELF/ParamSFO.cpp + ELF/ParamSFO.h + EmuThread.cpp + EmuThread.h + FFMPEGCompat.h + FileSystems/tlzrc.cpp + FileSystems/BlobFileSystem.cpp + FileSystems/BlobFileSystem.h + FileSystems/BlockDevices.cpp + FileSystems/BlockDevices.h + FileSystems/DirectoryFileSystem.cpp + FileSystems/DirectoryFileSystem.h + FileSystems/FileSystem.h + FileSystems/FileSystem.cpp + FileSystems/ISOFileSystem.cpp + FileSystems/ISOFileSystem.h + FileSystems/MetaFileSystem.cpp + FileSystems/MetaFileSystem.h + FileSystems/VirtualDiscFileSystem.cpp + FileSystems/VirtualDiscFileSystem.h + Font/PGF.cpp + Font/PGF.h + HLE/FunctionWrappers.h + HLE/HLE.cpp + HLE/HLE.h + HLE/ReplaceTables.cpp + HLE/ReplaceTables.h + HLE/HLEHelperThread.cpp + HLE/HLEHelperThread.h + HLE/HLETables.cpp + HLE/HLETables.h + HLE/KernelWaitHelpers.h + HLE/PSPThreadContext.h + HLE/KUBridge.h + HLE/KUBridge.cpp + HLE/Plugins.h + HLE/Plugins.cpp + HLE/ThreadQueueList.h + HLE/__sceAudio.cpp + HLE/__sceAudio.h + HLE/sceAdler.cpp + HLE/sceAdler.h + HLE/AtracBase.h + HLE/AtracCtx.cpp + HLE/AtracCtx.h + HLE/AtracCtx2.cpp + HLE/AtracCtx2.h + HLE/NetInetConstants.cpp + HLE/NetInetConstants.h + HLE/SocketManager.cpp + HLE/SocketManager.h + HLE/sceAtrac.cpp + HLE/sceAtrac.h + HLE/sceAudio.cpp + HLE/sceAudiocodec.cpp + HLE/sceAudiocodec.h + HLE/sceAudioRouting.cpp + HLE/sceAudioRouting.h + HLE/sceAudio.h + HLE/sceCcc.h + HLE/sceCcc.cpp + HLE/sceChnnlsv.cpp + HLE/sceChnnlsv.h + HLE/sceCtrl.cpp + HLE/sceCtrl.h + HLE/sceDeflt.cpp + HLE/sceDeflt.h + HLE/sceDisplay.cpp + HLE/sceDisplay.h + HLE/sceDmac.cpp + HLE/sceDmac.h + HLE/sceG729.cpp + HLE/sceG729.h + HLE/sceGameUpdate.cpp + HLE/sceGameUpdate.h + HLE/sceGe.cpp + HLE/sceGe.h + HLE/sceFont.cpp + HLE/sceFont.h + HLE/sceHeap.cpp + HLE/sceHeap.h + HLE/sceHprm.cpp + HLE/sceHprm.h + HLE/sceHttp.cpp + HLE/sceHttp.h + HLE/sceImpose.cpp + HLE/sceImpose.h + HLE/sceIo.cpp + HLE/sceIo.h + HLE/sceJpeg.cpp + HLE/sceJpeg.h + HLE/sceKernel.cpp + HLE/sceKernel.h + HLE/sceKernelAlarm.cpp + HLE/sceKernelAlarm.h + HLE/sceKernelEventFlag.cpp + HLE/sceKernelEventFlag.h + HLE/sceKernelHeap.cpp + HLE/sceKernelHeap.h + HLE/sceKernelInterrupt.cpp + HLE/sceKernelInterrupt.h + HLE/sceKernelMbx.cpp + HLE/sceKernelMbx.h + HLE/sceKernelMemory.cpp + HLE/sceKernelMemory.h + HLE/sceKernelModule.cpp + HLE/sceKernelModule.h + HLE/sceKernelMsgPipe.cpp + HLE/sceKernelMsgPipe.h + HLE/sceKernelMutex.cpp + HLE/sceKernelMutex.h + HLE/sceKernelSemaphore.cpp + HLE/sceKernelSemaphore.h + HLE/sceKernelThread.cpp + HLE/sceKernelThread.h + HLE/sceKernelTime.cpp + HLE/sceKernelTime.h + HLE/sceKernelVTimer.cpp + HLE/sceKernelVTimer.h + HLE/sceMpeg.cpp + HLE/sceMpeg.h + HLE/sceNet.cpp + HLE/sceNet.h + HLE/sceNet_lib.cpp + HLE/sceNet_lib.h + HLE/NetAdhocCommon.cpp + HLE/NetAdhocCommon.h + HLE/sceNetAdhoc.cpp + HLE/sceNetAdhoc.h + ${aemu_postoffice} + HLE/sceNetAdhocMatching.cpp + HLE/sceNetAdhocMatching.h + HLE/sceNetInet.cpp + HLE/sceNetInet.h + HLE/sceNetApctl.cpp + HLE/sceNetApctl.h + HLE/sceNetResolver.cpp + HLE/sceNetResolver.h + HLE/proAdhoc.h + HLE/proAdhoc.cpp + HLE/proAdhocServer.h + HLE/proAdhocServer.cpp + HLE/sceOpenPSID.cpp + HLE/sceOpenPSID.h + HLE/sceP3da.cpp + HLE/sceP3da.h + HLE/sceMt19937.cpp + HLE/sceMt19937.h + HLE/sceMd5.cpp + HLE/sceMd5.h + HLE/sceAac.cpp + HLE/sceAac.h + HLE/sceMp4.cpp + HLE/sceMp4.h + HLE/sceMp3.cpp + HLE/sceMp3.h + HLE/sceParseHttp.cpp + HLE/sceParseHttp.h + HLE/sceParseUri.cpp + HLE/sceParseUri.h + HLE/scePower.cpp + HLE/scePower.h + HLE/scePsmf.cpp + HLE/scePsmf.h + HLE/sceReg.cpp + HLE/sceReg.h + HLE/sceRtc.cpp + HLE/sceRtc.h + HLE/sceSas.cpp + HLE/sceSas.h + HLE/sceSfmt19937.cpp + HLE/sceSfmt19937.h + HLE/sceSha256.cpp + HLE/sceSha256.h + HLE/sceSircs.cpp + HLE/sceSircs.h + HLE/sceSsl.cpp + HLE/sceSsl.h + HLE/sceUmd.cpp + HLE/sceUmd.h + HLE/sceUsb.cpp + HLE/sceUsb.h + HLE/sceUsbAcc.cpp + HLE/sceUsbAcc.h + HLE/sceUsbCam.cpp + HLE/sceUsbCam.h + HLE/sceUsbGps.cpp + HLE/sceUsbGps.h + HLE/sceUsbMic.cpp + HLE/sceUsbMic.h + HLE/sceUtility.cpp + HLE/sceUtility.h + HLE/sceVaudio.cpp + HLE/sceVaudio.h + HLE/scePspNpDrm_user.cpp + HLE/scePspNpDrm_user.h + HLE/sceNp.cpp + HLE/sceNp.h + HLE/sceNp2.cpp + HLE/sceNp2.h + HLE/scePauth.cpp + HLE/scePauth.h + HW/SimpleAudioDec.cpp + HW/SimpleAudioDec.h + HW/Atrac3Standalone.cpp + HW/Atrac3Standalone.h + HW/SimpleAudioDec.h + HW/AsyncIOManager.cpp + HW/AsyncIOManager.h + HW/BufferQueue.cpp + HW/BufferQueue.h + HW/Camera.cpp + HW/Camera.h + HW/Display.cpp + HW/Display.h + HW/GranularMixer.cpp + HW/GranularMixer.h + HW/MediaEngine.cpp + HW/MediaEngine.h + HW/MpegDemux.cpp + HW/MpegDemux.h + HW/MemoryStick.cpp + HW/MemoryStick.h + HW/SasAudio.cpp + HW/SasAudio.h + HW/SasReverb.cpp + HW/SasReverb.h + HW/StereoResampler.cpp + HW/StereoResampler.h + Loaders.cpp + Loaders.h + FileLoaders/CachingFileLoader.cpp + FileLoaders/CachingFileLoader.h + FileLoaders/DiskCachingFileLoader.cpp + FileLoaders/DiskCachingFileLoader.h + FileLoaders/HTTPFileLoader.cpp + FileLoaders/HTTPFileLoader.h + FileLoaders/LocalFileLoader.cpp + FileLoaders/LocalFileLoader.h + FileLoaders/RamCachingFileLoader.cpp + FileLoaders/RamCachingFileLoader.h + FileLoaders/RetryingFileLoader.cpp + FileLoaders/RetryingFileLoader.h + FileLoaders/ZipFileLoader.cpp + FileLoaders/ZipFileLoader.h + MIPS/MIPS.cpp + MIPS/MIPS.h + MIPS/MIPSAnalyst.cpp + MIPS/MIPSAnalyst.h + MIPS/MIPSCodeUtils.cpp + MIPS/MIPSCodeUtils.h + MIPS/MIPSDebugInterface.cpp + MIPS/MIPSDebugInterface.h + MIPS/MIPSDis.cpp + MIPS/MIPSDis.h + MIPS/MIPSDisVFPU.cpp + MIPS/MIPSDisVFPU.h + MIPS/MIPSInt.cpp + MIPS/MIPSInt.h + MIPS/MIPSIntVFPU.cpp + MIPS/MIPSIntVFPU.h + MIPS/MIPSStackWalk.cpp + MIPS/MIPSStackWalk.h + MIPS/MIPSTables.cpp + MIPS/MIPSTables.h + MIPS/MIPSVFPUUtils.cpp + MIPS/MIPSVFPUUtils.h + MIPS/MIPSVFPUFallbacks.cpp + MIPS/MIPSVFPUFallbacks.h + MIPS/MIPSAsm.cpp + MIPS/MIPSAsm.h + MIPS/MIPSTracer.cpp + MIPS/MIPSTracer.h + MIPS/JitCommon/JitCommon.cpp + MIPS/JitCommon/JitCommon.h + MIPS/JitCommon/JitBlockCache.cpp + MIPS/JitCommon/JitBlockCache.h + MIPS/JitCommon/JitState.cpp + MIPS/JitCommon/JitState.h + Util/DisArm64.h + Util/DisArm64.cpp + MIPS/fake/FakeJit.cpp + MIPS/fake/FakeJit.h + MemFault.cpp + MemFault.h + MemMap.cpp + MemMap.h + MemMapFunctions.cpp + MemMapHelpers.h + PSPLoaders.cpp + PSPLoaders.h + Reporting.cpp + Reporting.h + Replay.cpp + Replay.h + SaveState.cpp + SaveState.h + SaveStateRewind.cpp + SaveStateRewind.h + Screenshot.cpp + Screenshot.h + System.cpp + System.h + Util/AtracTrack.cpp + Util/AtracTrack.h + Util/AudioFormat.cpp + Util/AudioFormat.h + Util/GameManager.cpp + Util/GameManager.h + Util/MemStick.cpp + Util/MemStick.h + Util/GameDB.cpp + Util/GameDB.h + Util/PathUtil.cpp + Util/PathUtil.h + Util/PortManager.cpp + Util/PortManager.h + Util/BlockAllocator.cpp + Util/BlockAllocator.h + Util/PPGeDraw.cpp + Util/PPGeDraw.h + Util/RecentFiles.cpp + Util/RecentFiles.h + Util/VideoPlayer.cpp + Util/VideoPlayer.h + ${CMAKE_SOURCE_DIR}/ext/disarm.cpp + ${CMAKE_SOURCE_DIR}/ext/disarm.h + ${CMAKE_SOURCE_DIR}/ext/riscv-disas.cpp + ${CMAKE_SOURCE_DIR}/ext/riscv-disas.h + ${CMAKE_SOURCE_DIR}/ext/loongarch-disasm.cpp + ${CMAKE_SOURCE_DIR}/ext/loongarch-disasm.h + ${CMAKE_CURRENT_BINARY_DIR}/git-version.cpp +) + +if((MACOSX OR IOS) AND NOT LIBRETRO) + set_source_files_properties(Util/DarwinFileSystemServices.mm + PROPERTIES COMPILE_FLAGS -fobjc-arc) +endif() + +if(LIBRETRO) + target_include_directories(Core PRIVATE ${CMAKE_SOURCE_DIR}/libretro/libretro-common/include) +endif() + +set(CoreExtraLibs) +if(ANDROID) + list(APPEND CoreExtraLibs android) + if(X86_64) + set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} -Wl,-Bsymbolic") + endif() +endif() + +list(APPEND CoreExtraLibs armips) + +target_link_libraries(Core GPU Common chdr kirk cityhash sfmt19937 xbrz xxhash rcheevos minimp3 at3_standalone lua + ${CoreExtraLibs} ${CMAKE_DL_LIBS}) + +# Winsock +if(WIN32) + target_link_libraries(Core ws2_32) +endif() + +if(NOT HTTPS_NOT_AVAILABLE) + target_link_libraries(Core naett) +endif() + +target_compile_features(Core PUBLIC cxx_std_17) + +if(FFmpeg_FOUND) + target_compile_definitions(Core PRIVATE USE_FFMPEG=1) + if (HAVE_LIBAVCODEC_CONST_AVCODEC) + target_compile_definitions(Core PRIVATE HAVE_LIBAVCODEC_CONST_AVCODEC=1) + endif() + set_target_properties(Core PROPERTIES NO_SYSTEM_FROM_IMPORTED true) + target_include_directories(Core BEFORE PUBLIC ${FFmpeg_INCLUDE_avcodec} ${FFmpeg_INCLUDE_avformat}) + target_link_libraries(Core + FFmpeg::avcodec + FFmpeg::avformat + FFmpeg::avutil + FFmpeg::swresample + FFmpeg::swscale + ${ZLIB_LIBRARY} + ) +elseif(BUILD_BUNDLED_FFMPEG) + target_compile_definitions(Core PRIVATE USE_FFMPEG=1) + set_target_properties(Core PROPERTIES NO_SYSTEM_FROM_IMPORTED true) + target_link_libraries(Core + avcodec + avformat + avutil + swresample + swscale + ${ZLIB_LIBRARY} + ) +endif() + +# Discord integration +if(USE_DISCORD AND NOT IOS AND NOT LIBRETRO) + target_link_libraries(Core discord-rpc) +endif() + +# miniUPnPc integration (MiniUPnPc supposed to works on any POSIX system, not sure if some of these are redundant/not needed tho) +if(USE_MINIUPNPC) + if(USE_SYSTEM_MINIUPNPC) + find_package(MINIUPNPC REQUIRED) + target_include_directories(Core PRIVATE ${MINIUPNP_INCLUDE_DIR}) + target_link_libraries(Core ${MINIUPNP_LIBRARY}) + add_compile_definitions(WITH_UPNP USE_SYSTEM_MINIUPNPC) + else() + set (MINIUPNPC_VERSION 2.2) # used by miniupnpcstrings.h.cmake + set (MINIUPNPC_API_VERSION 18) + option(UPNPC_BUILD_STATIC "Build static library" TRUE) + option(NO_GETADDRINFO "Define NO_GETADDRINFO" FALSE) + mark_as_advanced(NO_GETADDRINFO) + if (NO_GETADDRINFO) + add_compile_definitions(NO_GETADDRINFO) + endif() + + if (NOT WIN32) + add_compile_definitions (MINIUPNPC_SET_SOCKET_TIMEOUT) + add_compile_definitions (_BSD_SOURCE _DEFAULT_SOURCE _POSIX_C_SOURCE=200112L) + endif() + if (MACOSX) + add_compile_definitions (_DARWIN_C_SOURCE) + endif() + if(WIN32) + add_compile_definitions(WIN32 MINIUPNP_EXPORTS) + else() + add_compile_options(-fPIC) + endif() + + add_compile_definitions(WITH_UPNP MINIUPNP_STATICLIB) + set(MINIUPNP_DIR "${CMAKE_SOURCE_DIR}/ext/miniupnp/miniupnpc") + include_directories(${CMAKE_CURRENT_BINARY_DIR}) + include_directories(${CMAKE_SOURCE_DIR}/ext/miniupnp/miniupnpc/src) + include_directories(${CMAKE_SOURCE_DIR}/ext/miniupnp/miniupnpc/include) + configure_file(${MINIUPNP_DIR}/miniupnpcstrings.h.cmake ${CMAKE_CURRENT_BINARY_DIR}/miniupnpcstrings.h) # by default miniupnp repo doesn't contains miniupnpcstrings.h and need to be generated + set(MINIUPNPC_SOURCES + # the needed bits of miniupnpc (no python module, no tests, no cli) + ${MINIUPNP_DIR}/src/addr_is_reserved.c + ${MINIUPNP_DIR}/src/connecthostport.c + ${MINIUPNP_DIR}/src/igd_desc_parse.c + ${MINIUPNP_DIR}/src/minisoap.c + ${MINIUPNP_DIR}/src/minissdpc.c + ${MINIUPNP_DIR}/src/miniupnpc.c + #${MINIUPNP_DIR}/miniupnpcmodule.c + ${MINIUPNP_DIR}/src/miniwget.c + ${MINIUPNP_DIR}/src/minixml.c + ${MINIUPNP_DIR}/src/portlistingparse.c + ${MINIUPNP_DIR}/src/receivedata.c + #${MINIUPNP_DIR}/upnpc.c # causing an error due to already existing _main() + ${MINIUPNP_DIR}/src/upnpcommands.c + ${MINIUPNP_DIR}/src/upnpdev.c + ${MINIUPNP_DIR}/src/upnperrors.c + ${MINIUPNP_DIR}/src/upnpreplyparse.c + ${CMAKE_CURRENT_BINARY_DIR}/miniupnpcstrings.h + ) + if (NOT WIN32 AND NOT CMAKE_SYSTEM_NAME STREQUAL "AmigaOS") + #set(MINIUPNPC_SOURCES ${MINIUPNPC_SOURCES} minissdpc.c) # causing an error due to duplication in MINIUPNPC_SOURCES? + endif() + if (WIN32) + set_source_files_properties(${MINIUPNPC_SOURCES} PROPERTIES COMPILE_DEFINITIONS "MINIUPNP_STATICLIB;MINIUPNP_EXPORTS") + list(PREPEND LDLIBS ws2_32 iphlpapi) + #elseif (CMAKE_SYSTEM_NAME STREQUAL "Solaris") + # find_library (SOCKET_LIBRARY NAMES socket) + # find_library (NSL_LIBRARY NAMES nsl) + # find_library (RESOLV_LIBRARY NAMES resolv) + # set (LDLIBS ${SOCKET_LIBRARY} ${NSL_LIBRARY} ${RESOLV_LIBRARY} ${LDLIBS}) + endif() + if (UPNPC_BUILD_STATIC) + add_library(miniupnpc STATIC ${MINIUPNPC_SOURCES}) + target_link_libraries(Core miniupnpc ${LDLIBS}) + set(UPNPC_LIBRARY miniupnpc) + if (MSVC) + # Suppress noise warnings + target_compile_definitions(miniupnpc PRIVATE _CRT_SECURE_NO_WARNINGS _WINSOCK_DEPRECATED_NO_WARNINGS) + endif() + if (WIN32) + target_link_libraries(miniupnpc ws2_32) + endif() + endif() + endif() +endif() + +setup_target_project(Core Core) + +# Generate git-version at build time. +add_custom_target(GitVersion DEPENDS something_that_never_exists) + +set(WIN_VERSION_CMD "") +if (WIN32) + set(WIN_VERSION_CMD COMMAND ${CMAKE_SOURCE_DIR}/Windows/git-version-gen.cmd PPSSPPWindows) +endif() + +add_custom_command(OUTPUT something_that_never_exists + COMMAND ${CMAKE_COMMAND} -DSOURCE_DIR=${CMAKE_SOURCE_DIR} + -DOUTPUT_DIR=${CMAKE_CURRENT_BINARY_DIR} + -P ${CMAKE_SOURCE_DIR}/git-version.cmake + ${WIN_VERSION_CMD}) + +set_source_files_properties(${CMAKE_CURRENT_BINARY_DIR}/git-version.cpp + PROPERTIES GENERATED TRUE + SKIP_AUTOMOC ON) +add_dependencies(Core GitVersion) diff --git a/GPU/CMakeLists.txt b/GPU/CMakeLists.txt new file mode 100644 index 0000000000..a095300f2b --- /dev/null +++ b/GPU/CMakeLists.txt @@ -0,0 +1,217 @@ +set(GPUArch) +list(APPEND GPUArch + Common/VertexDecoderArm.cpp + Common/VertexDecoderArm64.cpp + Common/VertexDecoderX86.cpp + Software/DrawPixelX86.cpp + Software/SamplerX86.cpp + Common/VertexDecoderRiscV.cpp + Common/VertexDecoderLoongArch64.cpp +) + +set(GPU_GLES + GLES/StencilBufferGLES.cpp + GLES/GPU_GLES.cpp + GLES/GPU_GLES.h + GLES/FragmentTestCacheGLES.cpp + GLES/FragmentTestCacheGLES.h + GLES/FramebufferManagerGLES.cpp + GLES/FramebufferManagerGLES.h + GLES/ShaderManagerGLES.cpp + GLES/ShaderManagerGLES.h + GLES/StateMappingGLES.cpp + GLES/StateMappingGLES.h + GLES/TextureCacheGLES.cpp + GLES/TextureCacheGLES.h + GLES/DrawEngineGLES.cpp + GLES/DrawEngineGLES.h +) + +set(GPU_VULKAN + Vulkan/DebugVisVulkan.cpp + Vulkan/DebugVisVulkan.h + Vulkan/DrawEngineVulkan.cpp + Vulkan/DrawEngineVulkan.h + Vulkan/FramebufferManagerVulkan.cpp + Vulkan/FramebufferManagerVulkan.h + Vulkan/GPU_Vulkan.cpp + Vulkan/GPU_Vulkan.h + Vulkan/PipelineManagerVulkan.cpp + Vulkan/PipelineManagerVulkan.h + Vulkan/ShaderManagerVulkan.cpp + Vulkan/ShaderManagerVulkan.h + Vulkan/StateMappingVulkan.cpp + Vulkan/StateMappingVulkan.h + Vulkan/TextureCacheVulkan.cpp + Vulkan/TextureCacheVulkan.h + Vulkan/VulkanUtil.cpp + Vulkan/VulkanUtil.h +) + +set(GPU_D3D11 + D3D11/DrawEngineD3D11.cpp + D3D11/DrawEngineD3D11.h + D3D11/FramebufferManagerD3D11.cpp + D3D11/FramebufferManagerD3D11.h + D3D11/GPU_D3D11.cpp + D3D11/GPU_D3D11.h + D3D11/D3D11Util.cpp + D3D11/D3D11Util.h + D3D11/ShaderManagerD3D11.cpp + D3D11/ShaderManagerD3D11.h + D3D11/StateMappingD3D11.cpp + D3D11/StateMappingD3D11.h + D3D11/TextureCacheD3D11.cpp + D3D11/TextureCacheD3D11.h +) + +# We build Vulkan even on Apple to avoid annoying build differences. +set(GPU_IMPLS ${GPU_GLES} ${GPU_VULKAN}) +if(WIN32) + list(APPEND GPU_IMPLS ${GPU_D3D11}) +endif() + +set(GPU_SOURCES + ${GPUArch} + ${GPU_IMPLS} + ${GPU_NEON} + Common/Draw2D.cpp + Common/Draw2D.h + Common/DepthBufferCommon.cpp + Common/DepthRaster.cpp + Common/DepthRaster.h + Common/TextureShaderCommon.cpp + Common/TextureShaderCommon.h + Common/DepalettizeShaderCommon.cpp + Common/DepalettizeShaderCommon.h + Common/FragmentShaderGenerator.cpp + Common/FragmentShaderGenerator.h + Common/VertexShaderGenerator.cpp + Common/VertexShaderGenerator.h + Common/FramebufferManagerCommon.cpp + Common/FramebufferManagerCommon.h + Common/GPUDebugInterface.cpp + Common/GPUDebugInterface.h + Common/GPUStateUtils.cpp + Common/GPUStateUtils.h + Common/DrawEngineCommon.cpp + Common/DrawEngineCommon.h + Common/PresentationCommon.cpp + Common/PresentationCommon.h + Common/ReinterpretFramebuffer.cpp + Common/ReinterpretFramebuffer.h + Common/ShaderId.cpp + Common/ShaderId.h + Common/ShaderUniforms.cpp + Common/ShaderUniforms.h + Common/ShaderCommon.cpp + Common/ShaderCommon.h + Common/SplineCommon.cpp + Common/SplineCommon.h + Common/StencilCommon.cpp + Common/StencilCommon.h + Common/SoftwareTransformCommon.cpp + Common/SoftwareTransformCommon.h + Common/VertexDecoderCommon.cpp + Common/VertexDecoderCommon.h + Common/VertexDecoderHandwritten.cpp + Common/VertexDecoderHandwritten.h + Common/VertexReader.h + Common/TransformCommon.cpp + Common/TransformCommon.h + Common/IndexGenerator.cpp + Common/IndexGenerator.h + Common/ImageCommon.h + Common/TextureDecoder.cpp + Common/TextureDecoder.h + Common/TextureCacheCommon.cpp + Common/TextureCacheCommon.h + Common/TextureScalerCommon.cpp + Common/TextureScalerCommon.h + Common/PostShader.cpp + Common/PostShader.h + Common/TextureReplacer.cpp + Common/TextureReplacer.h + Common/ReplacedTexture.cpp + Common/ReplacedTexture.h + Debugger/Breakpoints.cpp + Debugger/Breakpoints.h + Debugger/Debugger.cpp + Debugger/Debugger.h + Debugger/GECommandTable.cpp + Debugger/GECommandTable.h + Debugger/Playback.cpp + Debugger/Playback.h + Debugger/Record.cpp + Debugger/Record.h + Debugger/RecordFormat.h + Debugger/State.cpp + Debugger/State.h + Debugger/Stepping.cpp + Debugger/Stepping.h + ge_constants.h + GeConstants.cpp + GPUDefinitions.h + GeDisasm.cpp + GeDisasm.h + GPU.cpp + GPU.h + GPUCommon.cpp + GPUCommon.h + GPUCommonHW.cpp + GPUCommonHW.h + GPUState.cpp + GPUState.h + GPUStateSIMDUtil.h + Math3D.cpp + Math3D.h + Software/BinManager.cpp + Software/BinManager.h + Software/Clipper.cpp + Software/Clipper.h + Software/DrawPixel.cpp + Software/DrawPixel.h + Software/FuncId.cpp + Software/FuncId.h + Software/Lighting.cpp + Software/Lighting.h + Software/Rasterizer.cpp + Software/Rasterizer.h + Software/RasterizerRectangle.cpp + Software/RasterizerRectangle.h + Software/RasterizerRegCache.cpp + Software/RasterizerRegCache.h + Software/Sampler.cpp + Software/Sampler.h + Software/SoftGpu.cpp + Software/SoftGpu.h + Software/TransformUnit.cpp + Software/TransformUnit.h +) + +# GPU has a genuine two-way dependency with Core (Core/System.cpp calls GPU_Init(), while +# all of GPU/ calls back into Core for Memory/Config/CoreTiming/etc). An OBJECT library's +# object files are always included wherever it's consumed rather than being lazily pulled +# from an archive, which sidesteps the GNU ld single-pass archive-ordering problem a normal +# two-way STATIC dependency would hit. Core links this PUBLICLY so consumers of Core get it. +add_library(GPU OBJECT ${GPU_SOURCES}) +target_compile_features(GPU PUBLIC cxx_std_17) + +if(LIBRETRO) + target_include_directories(GPU PRIVATE ${CMAKE_SOURCE_DIR}/libretro/libretro-common/include) +endif() + +setup_target_project(GPU GPU) + +# The only direct external dependencies of GPU/ itself (as opposed to Common/GPU/*, which +# already carries its own GL/Vulkan loader abstractions): raw gl*() calls in GPU/GLES, direct +# ZSTD_compress/decompress calls in GPU/Debugger/Record.cpp and Playback.cpp, and Playback.cpp +# also calls snappy_uncompress() directly. +target_link_libraries(GPU PUBLIC ${OPENGL_LIBRARIES} ${X11_LIBRARIES} Ext::Snappy) + +if(USE_SYSTEM_ZSTD) + target_include_directories(GPU PRIVATE ${ZSTD_INCLUDE_DIR}) + target_link_libraries(GPU PUBLIC ${ZSTD_LIBRARY}) +else() + target_link_libraries(GPU PUBLIC libzstd_static) +endif() diff --git a/libretro/CMakeLists.txt b/libretro/CMakeLists.txt index f9fd9499fa..7b600ffbbc 100644 --- a/libretro/CMakeLists.txt +++ b/libretro/CMakeLists.txt @@ -42,7 +42,7 @@ if(NOT MSVC) target_link_libraries(ppsspp_libretro "-Wl,-Bsymbolic") endif() endif() -target_link_libraries(ppsspp_libretro core ${CMAKE_THREAD_LIBS_INIT}) +target_link_libraries(ppsspp_libretro Core ${CMAKE_THREAD_LIBS_INIT}) if(ANDROID) target_link_libraries(ppsspp_libretro log) endif() From 688eb99a5308bca3a0efb80931a15f6837defa9c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Henrik=20Rydg=C3=A5rd?= Date: Fri, 24 Jul 2026 18:37:14 +0200 Subject: [PATCH 03/10] Fix miniUPnPc add_compile_definitions ordering in Core/CMakeLists.txt Same class of bug as the USE_DISCORD fix: add_compile_definitions() only affects targets created after the call, but the whole USE_MINIUPNPC block sat after add_library(Core STATIC ...). That meant Core/Util/PortManager.cpp, built as part of that same add_library call, never actually saw WITH_UPNP or any of the other miniupnpc defines - UPnP support was silently compiled out on every platform. Split the block: compile definitions and the miniupnpc source-file/include setup now run before add_library(Core STATIC ...), while building the bundled miniupnpc target and linking it into Core (which needs the Core target to already exist) stays after, in its original spot. Co-Authored-By: Claude Sonnet 5 Claude-Session: https://claude.ai/code/session_01PSNaZnHCjmryS3ziVN9gZU --- Core/CMakeLists.txt | 161 ++++++++++++++++++++++++-------------------- 1 file changed, 88 insertions(+), 73 deletions(-) diff --git a/Core/CMakeLists.txt b/Core/CMakeLists.txt index 4eb63a94c1..86136cd4d9 100644 --- a/Core/CMakeLists.txt +++ b/Core/CMakeLists.txt @@ -167,6 +167,83 @@ if(NOT LIBRETRO) ) endif() +# miniUPnPc integration (MiniUPnPc supposed to works on any POSIX system, not sure if some of these are redundant/not needed tho) +# +# The add_compile_definitions()/target_link_libraries(Core ...) split below looks awkward, but it's +# required: add_compile_definitions() only affects targets created *after* the call, and +# target_link_libraries(Core ...) requires the Core target to already exist. So the defines have to +# land before add_library(Core STATIC ...) further up this file, while linking miniupnpc into Core +# has to happen after it. Previously this whole block sat after add_library(Core STATIC ...), which +# meant Core/Util/PortManager.cpp (built as part of that same add_library call) never actually saw +# WITH_UPNP or any of the other defines below - UPnP support was silently compiled out everywhere. +if(USE_MINIUPNPC) + if(USE_SYSTEM_MINIUPNPC) + find_package(MINIUPNPC REQUIRED) + add_compile_definitions(WITH_UPNP USE_SYSTEM_MINIUPNPC) + else() + set (MINIUPNPC_VERSION 2.2) # used by miniupnpcstrings.h.cmake + set (MINIUPNPC_API_VERSION 18) + option(UPNPC_BUILD_STATIC "Build static library" TRUE) + option(NO_GETADDRINFO "Define NO_GETADDRINFO" FALSE) + mark_as_advanced(NO_GETADDRINFO) + if (NO_GETADDRINFO) + add_compile_definitions(NO_GETADDRINFO) + endif() + + if (NOT WIN32) + add_compile_definitions (MINIUPNPC_SET_SOCKET_TIMEOUT) + add_compile_definitions (_BSD_SOURCE _DEFAULT_SOURCE _POSIX_C_SOURCE=200112L) + endif() + if (MACOSX) + add_compile_definitions (_DARWIN_C_SOURCE) + endif() + if(WIN32) + add_compile_definitions(WIN32 MINIUPNP_EXPORTS) + else() + add_compile_options(-fPIC) + endif() + + add_compile_definitions(WITH_UPNP MINIUPNP_STATICLIB) + set(MINIUPNP_DIR "${CMAKE_SOURCE_DIR}/ext/miniupnp/miniupnpc") + include_directories(${CMAKE_CURRENT_BINARY_DIR}) + include_directories(${CMAKE_SOURCE_DIR}/ext/miniupnp/miniupnpc/src) + include_directories(${CMAKE_SOURCE_DIR}/ext/miniupnp/miniupnpc/include) + configure_file(${MINIUPNP_DIR}/miniupnpcstrings.h.cmake ${CMAKE_CURRENT_BINARY_DIR}/miniupnpcstrings.h) # by default miniupnp repo doesn't contains miniupnpcstrings.h and need to be generated + set(MINIUPNPC_SOURCES + # the needed bits of miniupnpc (no python module, no tests, no cli) + ${MINIUPNP_DIR}/src/addr_is_reserved.c + ${MINIUPNP_DIR}/src/connecthostport.c + ${MINIUPNP_DIR}/src/igd_desc_parse.c + ${MINIUPNP_DIR}/src/minisoap.c + ${MINIUPNP_DIR}/src/minissdpc.c + ${MINIUPNP_DIR}/src/miniupnpc.c + #${MINIUPNP_DIR}/miniupnpcmodule.c + ${MINIUPNP_DIR}/src/miniwget.c + ${MINIUPNP_DIR}/src/minixml.c + ${MINIUPNP_DIR}/src/portlistingparse.c + ${MINIUPNP_DIR}/src/receivedata.c + #${MINIUPNP_DIR}/upnpc.c # causing an error due to already existing _main() + ${MINIUPNP_DIR}/src/upnpcommands.c + ${MINIUPNP_DIR}/src/upnpdev.c + ${MINIUPNP_DIR}/src/upnperrors.c + ${MINIUPNP_DIR}/src/upnpreplyparse.c + ${CMAKE_CURRENT_BINARY_DIR}/miniupnpcstrings.h + ) + if (NOT WIN32 AND NOT CMAKE_SYSTEM_NAME STREQUAL "AmigaOS") + #set(MINIUPNPC_SOURCES ${MINIUPNPC_SOURCES} minissdpc.c) # causing an error due to duplication in MINIUPNPC_SOURCES? + endif() + if (WIN32) + set_source_files_properties(${MINIUPNPC_SOURCES} PROPERTIES COMPILE_DEFINITIONS "MINIUPNP_STATICLIB;MINIUPNP_EXPORTS") + list(PREPEND LDLIBS ws2_32 iphlpapi) + #elseif (CMAKE_SYSTEM_NAME STREQUAL "Solaris") + # find_library (SOCKET_LIBRARY NAMES socket) + # find_library (NSL_LIBRARY NAMES nsl) + # find_library (RESOLV_LIBRARY NAMES resolv) + # set (LDLIBS ${SOCKET_LIBRARY} ${NSL_LIBRARY} ${RESOLV_LIBRARY} ${LDLIBS}) + endif() + endif() +endif() + add_library(Core STATIC ${CoreExtra} ${CmdLine} @@ -683,85 +760,23 @@ if(USE_DISCORD AND NOT IOS AND NOT LIBRETRO) target_link_libraries(Core discord-rpc) endif() -# miniUPnPc integration (MiniUPnPc supposed to works on any POSIX system, not sure if some of these are redundant/not needed tho) +# The other half of the miniUPnPc integration above: that half sets up the compile definitions +# (which had to happen before add_library(Core STATIC ...)), this half builds/links the library +# (which needs the Core target to already exist). if(USE_MINIUPNPC) if(USE_SYSTEM_MINIUPNPC) - find_package(MINIUPNPC REQUIRED) target_include_directories(Core PRIVATE ${MINIUPNP_INCLUDE_DIR}) target_link_libraries(Core ${MINIUPNP_LIBRARY}) - add_compile_definitions(WITH_UPNP USE_SYSTEM_MINIUPNPC) - else() - set (MINIUPNPC_VERSION 2.2) # used by miniupnpcstrings.h.cmake - set (MINIUPNPC_API_VERSION 18) - option(UPNPC_BUILD_STATIC "Build static library" TRUE) - option(NO_GETADDRINFO "Define NO_GETADDRINFO" FALSE) - mark_as_advanced(NO_GETADDRINFO) - if (NO_GETADDRINFO) - add_compile_definitions(NO_GETADDRINFO) - endif() - - if (NOT WIN32) - add_compile_definitions (MINIUPNPC_SET_SOCKET_TIMEOUT) - add_compile_definitions (_BSD_SOURCE _DEFAULT_SOURCE _POSIX_C_SOURCE=200112L) - endif() - if (MACOSX) - add_compile_definitions (_DARWIN_C_SOURCE) - endif() - if(WIN32) - add_compile_definitions(WIN32 MINIUPNP_EXPORTS) - else() - add_compile_options(-fPIC) - endif() - - add_compile_definitions(WITH_UPNP MINIUPNP_STATICLIB) - set(MINIUPNP_DIR "${CMAKE_SOURCE_DIR}/ext/miniupnp/miniupnpc") - include_directories(${CMAKE_CURRENT_BINARY_DIR}) - include_directories(${CMAKE_SOURCE_DIR}/ext/miniupnp/miniupnpc/src) - include_directories(${CMAKE_SOURCE_DIR}/ext/miniupnp/miniupnpc/include) - configure_file(${MINIUPNP_DIR}/miniupnpcstrings.h.cmake ${CMAKE_CURRENT_BINARY_DIR}/miniupnpcstrings.h) # by default miniupnp repo doesn't contains miniupnpcstrings.h and need to be generated - set(MINIUPNPC_SOURCES - # the needed bits of miniupnpc (no python module, no tests, no cli) - ${MINIUPNP_DIR}/src/addr_is_reserved.c - ${MINIUPNP_DIR}/src/connecthostport.c - ${MINIUPNP_DIR}/src/igd_desc_parse.c - ${MINIUPNP_DIR}/src/minisoap.c - ${MINIUPNP_DIR}/src/minissdpc.c - ${MINIUPNP_DIR}/src/miniupnpc.c - #${MINIUPNP_DIR}/miniupnpcmodule.c - ${MINIUPNP_DIR}/src/miniwget.c - ${MINIUPNP_DIR}/src/minixml.c - ${MINIUPNP_DIR}/src/portlistingparse.c - ${MINIUPNP_DIR}/src/receivedata.c - #${MINIUPNP_DIR}/upnpc.c # causing an error due to already existing _main() - ${MINIUPNP_DIR}/src/upnpcommands.c - ${MINIUPNP_DIR}/src/upnpdev.c - ${MINIUPNP_DIR}/src/upnperrors.c - ${MINIUPNP_DIR}/src/upnpreplyparse.c - ${CMAKE_CURRENT_BINARY_DIR}/miniupnpcstrings.h - ) - if (NOT WIN32 AND NOT CMAKE_SYSTEM_NAME STREQUAL "AmigaOS") - #set(MINIUPNPC_SOURCES ${MINIUPNPC_SOURCES} minissdpc.c) # causing an error due to duplication in MINIUPNPC_SOURCES? + elseif(UPNPC_BUILD_STATIC) + add_library(miniupnpc STATIC ${MINIUPNPC_SOURCES}) + target_link_libraries(Core miniupnpc ${LDLIBS}) + set(UPNPC_LIBRARY miniupnpc) + if (MSVC) + # Suppress noise warnings + target_compile_definitions(miniupnpc PRIVATE _CRT_SECURE_NO_WARNINGS _WINSOCK_DEPRECATED_NO_WARNINGS) endif() if (WIN32) - set_source_files_properties(${MINIUPNPC_SOURCES} PROPERTIES COMPILE_DEFINITIONS "MINIUPNP_STATICLIB;MINIUPNP_EXPORTS") - list(PREPEND LDLIBS ws2_32 iphlpapi) - #elseif (CMAKE_SYSTEM_NAME STREQUAL "Solaris") - # find_library (SOCKET_LIBRARY NAMES socket) - # find_library (NSL_LIBRARY NAMES nsl) - # find_library (RESOLV_LIBRARY NAMES resolv) - # set (LDLIBS ${SOCKET_LIBRARY} ${NSL_LIBRARY} ${RESOLV_LIBRARY} ${LDLIBS}) - endif() - if (UPNPC_BUILD_STATIC) - add_library(miniupnpc STATIC ${MINIUPNPC_SOURCES}) - target_link_libraries(Core miniupnpc ${LDLIBS}) - set(UPNPC_LIBRARY miniupnpc) - if (MSVC) - # Suppress noise warnings - target_compile_definitions(miniupnpc PRIVATE _CRT_SECURE_NO_WARNINGS _WINSOCK_DEPRECATED_NO_WARNINGS) - endif() - if (WIN32) - target_link_libraries(miniupnpc ws2_32) - endif() + target_link_libraries(miniupnpc ws2_32) endif() endif() endif() From ae9060d501c4e06c64dfb5b7dd03795216dac229 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Henrik=20Rydg=C3=A5rd?= Date: Fri, 24 Jul 2026 18:51:15 +0200 Subject: [PATCH 04/10] Extract UI into its own CMakeLists.txt Same treatment as Common/Core/GPU: move the ppsspp_ui target definition (kept that name rather than renaming to "UI", since it was deliberately named that in a previous commit) into UI/CMakeLists.txt, pulled in via add_subdirectory(UI). Source paths are now relative to UI/ instead of prefixed with "UI/". PPSSPPHeadless and PPSSPPUnitTest already didn't link ppsspp_ui (they link Core/Common directly) - that's unchanged, just preserved. The main per-platform binaries (${TargetBin}) and the Android JNI target keep linking it as before. add_compile_definitions(USE_DISCORD=1) has to stay in the root file rather than move into UI/CMakeLists.txt: it only affects targets created after the call, and add_subdirectory() snapshots the parent's directory scope at the point it's invoked, so the definition needs to already be set before add_subdirectory(UI) runs. Verified UI/DiscordIntegration.cpp still pulls in Discord_Initialize etc as undefined symbols post-move. Also removed two now-dead variable inits sitting right next to this block: "nativeExtra" (never appended to or consumed anywhere anymore, a leftover from before the old "native" target was removed) and a duplicate early set(UISource) (the real one now lives inside UI/CMakeLists.txt's own scope). Verified with a clean ./b.sh --debug rebuild, a HEADLESS=ON UNITTEST=ON build (confirmed ppsspp_ui/UI never gets built in that configuration), and a LIBRETRO=ON build. Co-Authored-By: Claude Sonnet 5 Claude-Session: https://claude.ai/code/session_01PSNaZnHCjmryS3ziVN9gZU --- CMakeLists.txt | 128 ++-------------------------------------------- UI/CMakeLists.txt | 125 ++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 130 insertions(+), 123 deletions(-) create mode 100644 UI/CMakeLists.txt diff --git a/CMakeLists.txt b/CMakeLists.txt index fbd6abc7bd..71d60f8d9c 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -959,10 +959,8 @@ add_library(pugixml STATIC ext/pugixml/pugixml.hpp ) -set(nativeExtra) set(targetExtra) set(targetExtraLibs) -set(UISource) if(IOS OR MACOSX) list(APPEND targetExtra @@ -1165,131 +1163,15 @@ else() endif() endif() -set(UISource) -if(NOT LIBRETRO) - list(APPEND UISource - UI/AudioCommon.h - UI/AudioCommon.cpp - ) -endif() - -list(APPEND UISource - UI/ImDebugger/ImDebugger.cpp - UI/ImDebugger/ImDebugger.h - UI/ImDebugger/ImGe.cpp - UI/ImDebugger/ImGe.h - UI/ImDebugger/ImConsole.cpp - UI/ImDebugger/ImConsole.h - UI/ImDebugger/ImDisasmView.cpp - UI/ImDebugger/ImDisasmView.h - UI/ImDebugger/ImMemView.cpp - UI/ImDebugger/ImMemView.h - UI/ImDebugger/ImStructViewer.cpp - UI/ImDebugger/ImStructViewer.h - UI/ImDebugger/ImJitViewer.cpp - UI/ImDebugger/ImJitViewer.h - UI/DiscordIntegration.cpp - UI/NativeApp.cpp - UI/AdhocServerScreen.h - UI/AdhocServerScreen.cpp - UI/BackgroundAudio.h - UI/BackgroundAudio.cpp - UI/Background.h - UI/Background.cpp - UI/ChatScreen.h - UI/ChatScreen.cpp - UI/BaseScreens.h - UI/BaseScreens.cpp - UI/DebugOverlay.cpp - UI/DebugOverlay.h - UI/DevScreens.cpp - UI/DevScreens.h - UI/DisplayLayoutScreen.cpp - UI/DisplayLayoutScreen.h - UI/EmuScreen.h - UI/EmuScreen.cpp - UI/GameInfoCache.h - UI/GameInfoCache.cpp - UI/IAPScreen.cpp - UI/IAPScreen.h - UI/MainScreen.h - UI/MainScreen.cpp - UI/GameBrowser.h - UI/GameBrowser.cpp - UI/MiscScreens.h - UI/MiscScreens.cpp - UI/MiscViews.h - UI/MiscViews.cpp - UI/PauseScreen.h - UI/PauseScreen.cpp - UI/SimpleDialogScreen.h - UI/SimpleDialogScreen.cpp - UI/TabbedDialogScreen.h - UI/TabbedDialogScreen.cpp - UI/GameScreen.h - UI/GameScreen.cpp - UI/GameSettingsScreen.h - UI/GameSettingsScreen.cpp - UI/DeveloperToolsScreen.h - UI/DeveloperToolsScreen.cpp - UI/DriverManagerScreen.h - UI/DriverManagerScreen.cpp - UI/GPUDriverTestScreen.h - UI/GPUDriverTestScreen.cpp - UI/TiltAnalogSettingsScreen.h - UI/TiltAnalogSettingsScreen.cpp - UI/TouchControlLayoutScreen.h - UI/TouchControlLayoutScreen.cpp - UI/TouchControlVisibilityScreen.h - UI/TouchControlVisibilityScreen.cpp - UI/GamepadEmu.h - UI/GamepadEmu.cpp - UI/JoystickHistoryView.h - UI/JoystickHistoryView.cpp - UI/LoadStateConfirmScreen.h - UI/LoadStateConfirmScreen.cpp - UI/OnScreenDisplay.h - UI/OnScreenDisplay.cpp - UI/ControlMappingScreen.h - UI/ControlMappingScreen.cpp - UI/RemoteISOScreen.h - UI/RemoteISOScreen.cpp - UI/ReportScreen.h - UI/ReportScreen.cpp - UI/SavedataScreen.h - UI/SavedataScreen.cpp - UI/SystemInfoScreen.h - UI/SystemInfoScreen.cpp - UI/Store.h - UI/Store.cpp - UI/UploadScreen.h - UI/UploadScreen.cpp - UI/CwCheatScreen.h - UI/CwCheatScreen.cpp - UI/InstallZipScreen.h - UI/InstallZipScreen.cpp - UI/JitCompareScreen.h - UI/JitCompareScreen.cpp - UI/MemStickScreen.h - UI/MemStickScreen.cpp - UI/ProfilerDraw.h - UI/ProfilerDraw.cpp - UI/CustomButtonMappingScreen.h - UI/CustomButtonMappingScreen.cpp - UI/Theme.h - UI/Theme.cpp - UI/UIAtlas.h - UI/UIAtlas.cpp - UI/RetroAchievementScreens.cpp - UI/RetroAchievementScreens.h -) - if(NOT LIBRETRO) + # add_compile_definitions() only affects targets created after the call, and + # add_subdirectory() snapshots the parent's directory-scope state at the point it's + # invoked, so this has to happen here rather than inside UI/CMakeLists.txt - see the + # commit that fixed this same issue for miniUPnPc in Core/CMakeLists.txt. if(USE_DISCORD AND NOT IOS) add_compile_definitions(USE_DISCORD=1) endif() - add_library(ppsspp_ui STATIC ${UISource}) - target_link_libraries(ppsspp_ui Common Core) + add_subdirectory(UI) endif() if(ANDROID) diff --git a/UI/CMakeLists.txt b/UI/CMakeLists.txt new file mode 100644 index 0000000000..6ad1a9ac52 --- /dev/null +++ b/UI/CMakeLists.txt @@ -0,0 +1,125 @@ +set(UISource) +if(NOT LIBRETRO) + list(APPEND UISource + AudioCommon.h + AudioCommon.cpp + ) +endif() + +list(APPEND UISource + ImDebugger/ImDebugger.cpp + ImDebugger/ImDebugger.h + ImDebugger/ImGe.cpp + ImDebugger/ImGe.h + ImDebugger/ImConsole.cpp + ImDebugger/ImConsole.h + ImDebugger/ImDisasmView.cpp + ImDebugger/ImDisasmView.h + ImDebugger/ImMemView.cpp + ImDebugger/ImMemView.h + ImDebugger/ImStructViewer.cpp + ImDebugger/ImStructViewer.h + ImDebugger/ImJitViewer.cpp + ImDebugger/ImJitViewer.h + DiscordIntegration.cpp + NativeApp.cpp + AdhocServerScreen.h + AdhocServerScreen.cpp + BackgroundAudio.h + BackgroundAudio.cpp + Background.h + Background.cpp + ChatScreen.h + ChatScreen.cpp + BaseScreens.h + BaseScreens.cpp + DebugOverlay.cpp + DebugOverlay.h + DevScreens.cpp + DevScreens.h + DisplayLayoutScreen.cpp + DisplayLayoutScreen.h + EmuScreen.h + EmuScreen.cpp + GameInfoCache.h + GameInfoCache.cpp + IAPScreen.cpp + IAPScreen.h + MainScreen.h + MainScreen.cpp + GameBrowser.h + GameBrowser.cpp + MiscScreens.h + MiscScreens.cpp + MiscViews.h + MiscViews.cpp + PauseScreen.h + PauseScreen.cpp + SimpleDialogScreen.h + SimpleDialogScreen.cpp + TabbedDialogScreen.h + TabbedDialogScreen.cpp + GameScreen.h + GameScreen.cpp + GameSettingsScreen.h + GameSettingsScreen.cpp + DeveloperToolsScreen.h + DeveloperToolsScreen.cpp + DriverManagerScreen.h + DriverManagerScreen.cpp + GPUDriverTestScreen.h + GPUDriverTestScreen.cpp + TiltAnalogSettingsScreen.h + TiltAnalogSettingsScreen.cpp + TouchControlLayoutScreen.h + TouchControlLayoutScreen.cpp + TouchControlVisibilityScreen.h + TouchControlVisibilityScreen.cpp + GamepadEmu.h + GamepadEmu.cpp + JoystickHistoryView.h + JoystickHistoryView.cpp + LoadStateConfirmScreen.h + LoadStateConfirmScreen.cpp + OnScreenDisplay.h + OnScreenDisplay.cpp + ControlMappingScreen.h + ControlMappingScreen.cpp + RemoteISOScreen.h + RemoteISOScreen.cpp + ReportScreen.h + ReportScreen.cpp + SavedataScreen.h + SavedataScreen.cpp + SystemInfoScreen.h + SystemInfoScreen.cpp + Store.h + Store.cpp + UploadScreen.h + UploadScreen.cpp + CwCheatScreen.h + CwCheatScreen.cpp + InstallZipScreen.h + InstallZipScreen.cpp + JitCompareScreen.h + JitCompareScreen.cpp + MemStickScreen.h + MemStickScreen.cpp + ProfilerDraw.h + ProfilerDraw.cpp + CustomButtonMappingScreen.h + CustomButtonMappingScreen.cpp + Theme.h + Theme.cpp + UIAtlas.h + UIAtlas.cpp + RetroAchievementScreens.cpp + RetroAchievementScreens.h +) + +# Headless and unit test builds never link this - they don't have a UI to show. See the +# comment above add_subdirectory(UI) in the root CMakeLists.txt for why USE_DISCORD=1 has +# to be defined before this add_subdirectory() call rather than in here. +add_library(ppsspp_ui STATIC ${UISource}) +target_link_libraries(ppsspp_ui Common Core) +setup_target_project(ppsspp_ui UI) From bb6164e79934661fe6dcd08c41504b6d80de7135 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Henrik=20Rydg=C3=A5rd?= Date: Fri, 24 Jul 2026 19:15:36 +0200 Subject: [PATCH 05/10] Move ten inline vendor libraries out of root CMakeLists.txt into ext/ gason, vma, cityhash, 7zip (ext/lzma-sdk), basis_universal, pugixml, kirk (ext/libkirk), sfmt19937, xbrz, and xxhash were each defined with a small add_library() block directly in the root CMakeLists.txt, even though ext/CMakeLists.txt already exists and handles every other vendor library (freetype, imgui, naett, discord-rpc, libchdr, zstd, miniupnp, armips, glew, snappy, ...) via add_subdirectory(). Gave each one its own ext//CMakeLists.txt to match that established pattern; xxhash stays a loose file pair in ext/ (it never had its own directory) so its add_library() lives directly in ext/CMakeLists.txt instead. ext/libkirk/CMakeLists.txt already existed but was dead - nothing add_subdirectory()'d it, and its source list was stale (missing amctrl.c/.h, which the live inline definition in root had). Replaced its contents with the current, correct list instead of leaving two diverging definitions around. Dropped several target_include_directories()/include_directories() calls that came along with these (e.g. cityhash, kirk, xbrz, xxhash, and the lzma-sdk one for 7zip): traced their actual consumers and found each library's own sources resolve their sibling headers via the default same-directory quote-include rule, and every external consumer already uses the full "ext//..." path resolved through the global root include - so these were dead weight regardless of position. Replaced two single-value alias variables (LIB7ZIP_LIBRARY, always "7zip"; BASISU_LIBRARIES, always "basis_universal") with their target names directly in Common/CMakeLists.txt, rather than trying to carry them across the new add_subdirectory boundary - plain set() variables don't propagate back up out of a child scope without PARENT_SCOPE, so keeping them as-was would have silently broken Common's link line. Verified with a fully clean rebuild (removed build/ entirely), a HEADLESS=ON UNITTEST=ON build, and a LIBRETRO=ON build. Co-Authored-By: Claude Sonnet 5 Claude-Session: https://claude.ai/code/session_01PSNaZnHCjmryS3ziVN9gZU --- CMakeLists.txt | 99 ------------------------------ Common/CMakeLists.txt | 2 +- ext/CMakeLists.txt | 14 +++++ ext/basis_universal/CMakeLists.txt | 20 ++++++ ext/cityhash/CMakeLists.txt | 5 ++ ext/gason/CMakeLists.txt | 4 ++ ext/libkirk/CMakeLists.txt | 27 ++++---- ext/lzma-sdk/CMakeLists.txt | 16 +++++ ext/pugixml/CMakeLists.txt | 4 ++ ext/sfmt19937/CMakeLists.txt | 8 +++ ext/vma/CMakeLists.txt | 4 ++ ext/xbrz/CMakeLists.txt | 4 ++ 12 files changed, 92 insertions(+), 115 deletions(-) create mode 100644 ext/basis_universal/CMakeLists.txt create mode 100644 ext/cityhash/CMakeLists.txt create mode 100644 ext/gason/CMakeLists.txt create mode 100644 ext/lzma-sdk/CMakeLists.txt create mode 100644 ext/pugixml/CMakeLists.txt create mode 100644 ext/sfmt19937/CMakeLists.txt create mode 100644 ext/vma/CMakeLists.txt create mode 100644 ext/xbrz/CMakeLists.txt diff --git a/CMakeLists.txt b/CMakeLists.txt index 71d60f8d9c..150e415647 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -571,16 +571,6 @@ if(USING_GLES2 OR (USING_EGL AND NOT USING_FBDEV)) find_package(X11) endif() -add_library(gason STATIC - ext/gason/gason.cpp - ext/gason/gason.h -) - -add_library(vma STATIC - ext/vma/vk_mem_alloc.cpp - ext/vma/vk_mem_alloc.h -) - if(USE_FFMPEG) if(NOT BUILD_BUNDLED_FFMPEG) if(NOT FFMPEG_DIR) @@ -701,13 +691,6 @@ else() set(ZLIB_LIBRARY zlib) endif() -add_library(cityhash STATIC - ext/cityhash/city.cpp - ext/cityhash/city.h - ext/cityhash/citycrc.h -) -target_include_directories(cityhash PRIVATE ext/cityhash) - if(NOT MSVC) # These can be fast even for debug. target_compile_options(udis86 PRIVATE "-O2") @@ -859,25 +842,6 @@ else() set(LIBZIP_LIBRARY libzip) endif() -add_library(7zip STATIC - ext/lzma-sdk/7zArcIn.c - ext/lzma-sdk/7zBuf.c - ext/lzma-sdk/7zCrc.c - ext/lzma-sdk/7zCrcOpt.c - ext/lzma-sdk/7zDec.c - ext/lzma-sdk/7zFile.c - ext/lzma-sdk/7zStream.c - ext/lzma-sdk/Bcj2.c - ext/lzma-sdk/Bra.c - ext/lzma-sdk/Bra86.c - ext/lzma-sdk/CpuArch.c - ext/lzma-sdk/Delta.c - ext/lzma-sdk/Lzma2Dec.c - ext/lzma-sdk/LzmaDec.c -) -include_directories(ext/lzma-sdk) -set(LIB7ZIP_LIBRARY 7zip) - # Arm platforms require at least libpng17. if(ANDROID OR ARMV7 OR ARM64 OR ARM OR IOS) set(PNG_REQUIRED_VERSION 1.7) @@ -932,32 +896,6 @@ else() include_directories(ext/libpng17) endif() -add_library(basis_universal STATIC - ext/basis_universal/basisu.h - ext/basis_universal/basisu_containers.h - ext/basis_universal/basisu_containers_impl.h - ext/basis_universal/basisu_file_headers.h - ext/basis_universal/basisu_transcoder.cpp - ext/basis_universal/basisu_transcoder.h - ext/basis_universal/basisu_transcoder_internal.h - ext/basis_universal/basisu_transcoder_tables_astc.inc - ext/basis_universal/basisu_transcoder_tables_astc_0_255.inc - ext/basis_universal/basisu_transcoder_tables_atc_55.inc - ext/basis_universal/basisu_transcoder_tables_atc_56.inc - ext/basis_universal/basisu_transcoder_tables_bc7_m5_alpha.inc - ext/basis_universal/basisu_transcoder_tables_bc7_m5_color.inc - ext/basis_universal/basisu_transcoder_tables_dxt1_5.inc - ext/basis_universal/basisu_transcoder_tables_dxt1_6.inc - ext/basis_universal/basisu_transcoder_tables_pvrtc2_45.inc - ext/basis_universal/basisu_transcoder_tables_pvrtc2_alpha_33.inc - ext/basis_universal/basisu_transcoder_uastc.h -) -set(BASISU_LIBRARIES basis_universal) - -add_library(pugixml STATIC - ext/pugixml/pugixml.cpp - ext/pugixml/pugixml.hpp -) set(targetExtra) set(targetExtraLibs) @@ -1199,43 +1137,6 @@ if(ANDROID OR (LINUX AND ARM_DEVICE) OR (LINUX AND RISCV64) OR (LINUX AND LOONGA set(ATOMIC_LIB atomic) endif() -add_library(kirk STATIC - ext/libkirk/AES.c - ext/libkirk/AES.h - ext/libkirk/amctrl.c - ext/libkirk/amctrl.h - ext/libkirk/SHA1.c - ext/libkirk/SHA1.h - ext/libkirk/bn.c - ext/libkirk/ec.c - ext/libkirk/kirk_engine.c - ext/libkirk/kirk_engine.h - ext/libkirk/kirk_common.h -) -target_include_directories(kirk PRIVATE ext/libkirk) - -add_library(sfmt19937 STATIC - ext/sfmt19937/SFMT.c - ext/sfmt19937/SFMT.h - ext/sfmt19937/SFMT-common.h - ext/sfmt19937/SFMT-params.h - ext/sfmt19937/SFMT-params19937.h -) -target_compile_definitions(sfmt19937 PRIVATE SFMT_MEXP=19937) -target_include_directories(sfmt19937 PRIVATE ext/sfmt19937) - -add_library(xbrz STATIC - ext/xbrz/xbrz.cpp - ext/xbrz/xbrz.h -) -target_include_directories(xbrz PRIVATE ext/xbrz) - -add_library(xxhash STATIC - ext/xxhash.c - ext/xxhash.h -) -target_include_directories(xxhash PRIVATE ext/xxhash) - set(GlslangLibs glslang OGLCompiler OSDependent SPIRV spirv-cross-glsl) if (ENABLE_SPVREMAPPER) diff --git a/Common/CMakeLists.txt b/Common/CMakeLists.txt index e246a7e6d3..f610b9a5a0 100644 --- a/Common/CMakeLists.txt +++ b/Common/CMakeLists.txt @@ -380,7 +380,7 @@ if(WIN32) target_link_libraries(Common winmm dsound dxguid d2d1 dwrite d3d11 Version) endif() -target_link_libraries(Common ${LIBZIP_LIBRARY} ${LIB7ZIP_LIBRARY} ${PNG_LIBRARIES} ${BASISU_LIBRARIES} ${ZLIB_LIBRARY} pugixml vma gason udis86 ${RT_LIB} ${ATOMIC_LIB}) +target_link_libraries(Common ${LIBZIP_LIBRARY} 7zip ${PNG_LIBRARIES} basis_universal ${ZLIB_LIBRARY} pugixml vma gason udis86 ${RT_LIB} ${ATOMIC_LIB}) # Common/GPU/ShaderTranslation.cpp and Common/GPU/Vulkan/VulkanContext.cpp call directly into # glslang/spirv-cross, so Common needs to declare this dependency itself rather than relying on diff --git a/ext/CMakeLists.txt b/ext/CMakeLists.txt index 7f2e6e0362..a700a6bda6 100644 --- a/ext/CMakeLists.txt +++ b/ext/CMakeLists.txt @@ -36,6 +36,20 @@ add_subdirectory(at3_standalone) add_subdirectory(udis86) add_subdirectory(SPIRV-Cross-build) add_subdirectory(rcheevos-build) +add_subdirectory(gason) +add_subdirectory(vma) +add_subdirectory(cityhash) +add_subdirectory(lzma-sdk) +add_subdirectory(basis_universal) +add_subdirectory(pugixml) +add_subdirectory(libkirk) +add_subdirectory(sfmt19937) +add_subdirectory(xbrz) + +add_library(xxhash STATIC + xxhash.c + xxhash.h +) set(FT_REQUIRE_ZLIB OFF CACHE BOOL "" FORCE) set(FT_REQUIRE_BZIP2 OFF CACHE BOOL "" FORCE) diff --git a/ext/basis_universal/CMakeLists.txt b/ext/basis_universal/CMakeLists.txt new file mode 100644 index 0000000000..a4490537b1 --- /dev/null +++ b/ext/basis_universal/CMakeLists.txt @@ -0,0 +1,20 @@ +add_library(basis_universal STATIC + basisu.h + basisu_containers.h + basisu_containers_impl.h + basisu_file_headers.h + basisu_transcoder.cpp + basisu_transcoder.h + basisu_transcoder_internal.h + basisu_transcoder_tables_astc.inc + basisu_transcoder_tables_astc_0_255.inc + basisu_transcoder_tables_atc_55.inc + basisu_transcoder_tables_atc_56.inc + basisu_transcoder_tables_bc7_m5_alpha.inc + basisu_transcoder_tables_bc7_m5_color.inc + basisu_transcoder_tables_dxt1_5.inc + basisu_transcoder_tables_dxt1_6.inc + basisu_transcoder_tables_pvrtc2_45.inc + basisu_transcoder_tables_pvrtc2_alpha_33.inc + basisu_transcoder_uastc.h +) diff --git a/ext/cityhash/CMakeLists.txt b/ext/cityhash/CMakeLists.txt new file mode 100644 index 0000000000..74b75f7497 --- /dev/null +++ b/ext/cityhash/CMakeLists.txt @@ -0,0 +1,5 @@ +add_library(cityhash STATIC + city.cpp + city.h + citycrc.h +) diff --git a/ext/gason/CMakeLists.txt b/ext/gason/CMakeLists.txt new file mode 100644 index 0000000000..045db20e88 --- /dev/null +++ b/ext/gason/CMakeLists.txt @@ -0,0 +1,4 @@ +add_library(gason STATIC + gason.cpp + gason.h +) diff --git a/ext/libkirk/CMakeLists.txt b/ext/libkirk/CMakeLists.txt index 6b8cb5fabd..e7e584490b 100644 --- a/ext/libkirk/CMakeLists.txt +++ b/ext/libkirk/CMakeLists.txt @@ -1,16 +1,13 @@ -set(SRCS - AES.c - bn.c - ec.c - kirk_engine.c - SHA1.c +add_library(kirk STATIC + AES.c + AES.h + amctrl.c + amctrl.h + SHA1.c + SHA1.h + bn.c + ec.c + kirk_engine.c + kirk_engine.h + kirk_common.h ) - -set(SRCS ${SRCS}) - -add_library(kirk STATIC ${SRCS}) - -if(UNIX) - add_definitions(-fPIC) -endif(UNIX) - diff --git a/ext/lzma-sdk/CMakeLists.txt b/ext/lzma-sdk/CMakeLists.txt new file mode 100644 index 0000000000..c522d79571 --- /dev/null +++ b/ext/lzma-sdk/CMakeLists.txt @@ -0,0 +1,16 @@ +add_library(7zip STATIC + 7zArcIn.c + 7zBuf.c + 7zCrc.c + 7zCrcOpt.c + 7zDec.c + 7zFile.c + 7zStream.c + Bcj2.c + Bra.c + Bra86.c + CpuArch.c + Delta.c + Lzma2Dec.c + LzmaDec.c +) diff --git a/ext/pugixml/CMakeLists.txt b/ext/pugixml/CMakeLists.txt new file mode 100644 index 0000000000..a7534953d6 --- /dev/null +++ b/ext/pugixml/CMakeLists.txt @@ -0,0 +1,4 @@ +add_library(pugixml STATIC + pugixml.cpp + pugixml.hpp +) diff --git a/ext/sfmt19937/CMakeLists.txt b/ext/sfmt19937/CMakeLists.txt new file mode 100644 index 0000000000..e12ffe6e4b --- /dev/null +++ b/ext/sfmt19937/CMakeLists.txt @@ -0,0 +1,8 @@ +add_library(sfmt19937 STATIC + SFMT.c + SFMT.h + SFMT-common.h + SFMT-params.h + SFMT-params19937.h +) +target_compile_definitions(sfmt19937 PRIVATE SFMT_MEXP=19937) diff --git a/ext/vma/CMakeLists.txt b/ext/vma/CMakeLists.txt new file mode 100644 index 0000000000..3627184419 --- /dev/null +++ b/ext/vma/CMakeLists.txt @@ -0,0 +1,4 @@ +add_library(vma STATIC + vk_mem_alloc.cpp + vk_mem_alloc.h +) diff --git a/ext/xbrz/CMakeLists.txt b/ext/xbrz/CMakeLists.txt new file mode 100644 index 0000000000..aebb85597e --- /dev/null +++ b/ext/xbrz/CMakeLists.txt @@ -0,0 +1,4 @@ +add_library(xbrz STATIC + xbrz.cpp + xbrz.h +) From e8f85f7804351b4eecfad65b731fc03f0fecbf11 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Henrik=20Rydg=C3=A5rd?= Date: Fri, 24 Jul 2026 20:49:29 +0200 Subject: [PATCH 06/10] Fix missing zstd include/link deps in Common and basis_universal Common and basis_universal call zstd functions directly but never declared the dependency after being split into their own CMakeLists.txt files, relying on directory-scope include_directories() that no longer reached them. Worked on Linux via system zstd.h, but broke the Android NDK build which has no such fallback. Co-Authored-By: Claude Sonnet 5 Claude-Session: https://claude.ai/code/session_01XMv4XdM5dThs9Avr5FPXRv --- Common/CMakeLists.txt | 8 ++++++++ ext/basis_universal/CMakeLists.txt | 8 ++++++++ 2 files changed, 16 insertions(+) diff --git a/Common/CMakeLists.txt b/Common/CMakeLists.txt index f610b9a5a0..2ac2d9631a 100644 --- a/Common/CMakeLists.txt +++ b/Common/CMakeLists.txt @@ -382,6 +382,14 @@ endif() target_link_libraries(Common ${LIBZIP_LIBRARY} 7zip ${PNG_LIBRARIES} basis_universal ${ZLIB_LIBRARY} pugixml vma gason udis86 ${RT_LIB} ${ATOMIC_LIB}) +# ZIMLoad.cpp/ZIMSave.cpp, Serializer.cpp, and Render/TextureAtlas.cpp call directly into zstd. +if(USE_SYSTEM_ZSTD) + target_include_directories(Common PRIVATE ${ZSTD_INCLUDE_DIR}) + target_link_libraries(Common ${ZSTD_LIBRARY}) +else() + target_link_libraries(Common libzstd_static) +endif() + # Common/GPU/ShaderTranslation.cpp and Common/GPU/Vulkan/VulkanContext.cpp call directly into # glslang/spirv-cross, so Common needs to declare this dependency itself rather than relying on # some downstream consumer happening to also link it (that was the previous, fragile setup: this diff --git a/ext/basis_universal/CMakeLists.txt b/ext/basis_universal/CMakeLists.txt index a4490537b1..9390370746 100644 --- a/ext/basis_universal/CMakeLists.txt +++ b/ext/basis_universal/CMakeLists.txt @@ -18,3 +18,11 @@ add_library(basis_universal STATIC basisu_transcoder_tables_pvrtc2_alpha_33.inc basisu_transcoder_uastc.h ) + +# basisu_transcoder.cpp calls ZSTD_decompress()/ZSTD_isError() directly for KTX2 supercompression. +if(USE_SYSTEM_ZSTD) + target_include_directories(basis_universal PRIVATE ${ZSTD_INCLUDE_DIR}) + target_link_libraries(basis_universal ${ZSTD_LIBRARY}) +else() + target_link_libraries(basis_universal libzstd_static) +endif() From c8c20985a99f8409406e12794aee3d090584f83c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Henrik=20Rydg=C3=A5rd?= Date: Fri, 24 Jul 2026 21:15:45 +0200 Subject: [PATCH 07/10] Bump FFMPEG to fix x86-64 --- ffmpeg | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ffmpeg b/ffmpeg index 18bbf9bf44..b87f7c6d52 160000 --- a/ffmpeg +++ b/ffmpeg @@ -1 +1 @@ -Subproject commit 18bbf9bf443ff2baceebab63cba85b9314a88b83 +Subproject commit b87f7c6d522d1edba77cfc4fac96ce48a236f806 From 8cfd63b86decf90b45ea1d841633d71bc2a6acca Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Henrik=20Rydg=C3=A5rd?= Date: Fri, 24 Jul 2026 22:47:29 +0200 Subject: [PATCH 08/10] Apple buildfix --- Common/File/FileUtil.cpp | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/Common/File/FileUtil.cpp b/Common/File/FileUtil.cpp index 53a86f54f1..0cc02ecf0b 100644 --- a/Common/File/FileUtil.cpp +++ b/Common/File/FileUtil.cpp @@ -20,6 +20,12 @@ #ifndef UNICODE #error Win32 build requires a unicode build #endif +#elif defined(__APPLE__) +// _POSIX_SOURCE alone restricts Darwin's libc headers to POSIX.1-1990 declarations, +// which predates fseeko/ftello/ftruncate (POSIX.1-2001+) and hides them entirely - +// unlike glibc, Darwin doesn't fall back to a broader feature set here. +#define _DARWIN_C_SOURCE +#define _LARGE_TIME_API #else #define _POSIX_SOURCE #define _LARGE_TIME_API From d959ef72b1de084f17008a4fd1886ac995d2ad99 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Fri, 24 Jul 2026 21:17:44 +0000 Subject: [PATCH 09/10] Fix iOS build: copy git-version.cpp to Core/ before xcodebuild --- b-ios.sh | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/b-ios.sh b/b-ios.sh index 10ac7e3322..1fb0ff8c3e 100755 --- a/b-ios.sh +++ b/b-ios.sh @@ -34,6 +34,11 @@ echo ' # There are 2 ways to build PPSSPP for iOS, using make or xcodebuild # Generate xcodeproject (only needed when building using xcode, similar to ./b.sh --ios-xcode) cmake -DCMAKE_TOOLCHAIN_FILE=../cmake/Toolchains/ios.cmake -GXcode .. +# Xcode's new build system validates that source files exist before running script phases. +# CMake places git-version.cpp at Core/git-version.cpp (CMAKE_CURRENT_BINARY_DIR for Core/). +# Copy the pre-created git-version.cpp so Xcode can find it. +mkdir -p Core +cp git-version.cpp Core/git-version.cpp # Build PPSSPP using xcode #xcodebuild clean build -project PPSSPP.xcodeproj CODE_SIGNING_ALLOWED=NO -sdk iphoneos -configuration Release xcodebuild -project PPSSPP.xcodeproj -scheme PPSSPP -sdk iphoneos -configuration Release -quiet clean build archive -archivePath ./build/PPSSPP.xcarchive CODE_SIGNING_REQUIRED=NO CODE_SIGNING_ALLOWED=NO #CODE_SIGN_IDENTITY="iPhone Distribution: Your NAME / Company (TeamID)" #PROVISIONING_PROFILE="xxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx" From 0e2995b30e86bf13e79e81cdf8c02ef44ad1f84f Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Fri, 24 Jul 2026 21:24:42 +0000 Subject: [PATCH 10/10] Fix iOS build: use CMAKE_BINARY_DIR for git-version.cpp so it stays at the build root --- Core/CMakeLists.txt | 6 +++--- b-ios.sh | 8 ++------ 2 files changed, 5 insertions(+), 9 deletions(-) diff --git a/Core/CMakeLists.txt b/Core/CMakeLists.txt index 86136cd4d9..58cbcc1d2a 100644 --- a/Core/CMakeLists.txt +++ b/Core/CMakeLists.txt @@ -691,7 +691,7 @@ add_library(Core STATIC ${CMAKE_SOURCE_DIR}/ext/riscv-disas.h ${CMAKE_SOURCE_DIR}/ext/loongarch-disasm.cpp ${CMAKE_SOURCE_DIR}/ext/loongarch-disasm.h - ${CMAKE_CURRENT_BINARY_DIR}/git-version.cpp + ${CMAKE_BINARY_DIR}/git-version.cpp ) if((MACOSX OR IOS) AND NOT LIBRETRO) @@ -793,11 +793,11 @@ endif() add_custom_command(OUTPUT something_that_never_exists COMMAND ${CMAKE_COMMAND} -DSOURCE_DIR=${CMAKE_SOURCE_DIR} - -DOUTPUT_DIR=${CMAKE_CURRENT_BINARY_DIR} + -DOUTPUT_DIR=${CMAKE_BINARY_DIR} -P ${CMAKE_SOURCE_DIR}/git-version.cmake ${WIN_VERSION_CMD}) -set_source_files_properties(${CMAKE_CURRENT_BINARY_DIR}/git-version.cpp +set_source_files_properties(${CMAKE_BINARY_DIR}/git-version.cpp PROPERTIES GENERATED TRUE SKIP_AUTOMOC ON) add_dependencies(Core GitVersion) diff --git a/b-ios.sh b/b-ios.sh index 1fb0ff8c3e..629dc20152 100755 --- a/b-ios.sh +++ b/b-ios.sh @@ -8,7 +8,8 @@ mkdir -p build # For the final IPA & DEB file mkdir -p build-ios cd build-ios rm -rf PPSSPP.app # There seems to be an existing symlink, may be from ccache? We don't want to include old stuff that might be removed to be included in the final IPA file. -# It seems xcodebuild is looking for "git-version.cpp" file inside "build-ios" directory instead of at repo's root dir. +# git-version.cpp is listed as a source file at ${CMAKE_BINARY_DIR}/git-version.cpp, +# so we pre-create it here so Xcode can find it before any script phases run. echo "const char *PPSSPP_GIT_VERSION = \"$(git describe --always)\";" > git-version.cpp echo "#define PPSSPP_GIT_VERSION_NO_UPDATE 1" >> git-version.cpp # Generate exportOptions.plist for xcodebuild @@ -34,11 +35,6 @@ echo ' # There are 2 ways to build PPSSPP for iOS, using make or xcodebuild # Generate xcodeproject (only needed when building using xcode, similar to ./b.sh --ios-xcode) cmake -DCMAKE_TOOLCHAIN_FILE=../cmake/Toolchains/ios.cmake -GXcode .. -# Xcode's new build system validates that source files exist before running script phases. -# CMake places git-version.cpp at Core/git-version.cpp (CMAKE_CURRENT_BINARY_DIR for Core/). -# Copy the pre-created git-version.cpp so Xcode can find it. -mkdir -p Core -cp git-version.cpp Core/git-version.cpp # Build PPSSPP using xcode #xcodebuild clean build -project PPSSPP.xcodeproj CODE_SIGNING_ALLOWED=NO -sdk iphoneos -configuration Release xcodebuild -project PPSSPP.xcodeproj -scheme PPSSPP -sdk iphoneos -configuration Release -quiet clean build archive -archivePath ./build/PPSSPP.xcarchive CODE_SIGNING_REQUIRED=NO CODE_SIGNING_ALLOWED=NO #CODE_SIGN_IDENTITY="iPhone Distribution: Your NAME / Company (TeamID)" #PROVISIONING_PROFILE="xxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"