mirror of
https://github.com/libretro/Play-.git
synced 2025-02-23 13:10:32 +00:00
Merge pull request #772 from Zer0xFF/cmake_cleanup
CMake modularisation cleanup
This commit is contained in:
commit
0f0a010939
@ -12,6 +12,8 @@ set(PROJECT_LIBS)
|
||||
|
||||
include(PrecompiledHeader)
|
||||
|
||||
set(ENABLE_AMAZON_S3 ON CACHE BOOL "Enable loading disc from Amazon S3 servers")
|
||||
|
||||
if(DEBUGGER_INCLUDED)
|
||||
list(APPEND DEFINITIONS_LIST DEBUGGER_INCLUDED=1)
|
||||
endif()
|
||||
@ -41,21 +43,20 @@ if(NOT TARGET Framework)
|
||||
endif()
|
||||
list(APPEND PROJECT_LIBS Framework)
|
||||
|
||||
if(NOT TARGET Framework_Http)
|
||||
add_subdirectory(
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/../../Framework/build_cmake/FrameworkHttp
|
||||
${CMAKE_CURRENT_BINARY_DIR}/FrameworkHttp
|
||||
if(ENABLE_AMAZON_S3)
|
||||
if(NOT TARGET Framework_Http)
|
||||
add_subdirectory(
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/../../Framework/build_cmake/FrameworkHttp
|
||||
${CMAKE_CURRENT_BINARY_DIR}/FrameworkHttp
|
||||
)
|
||||
endif()
|
||||
list(APPEND PROJECT_LIBS Framework_Http)
|
||||
set(AMAZON_S3_SRC
|
||||
s3stream/AmazonS3Client.cpp
|
||||
s3stream/S3ObjectStream.cpp
|
||||
)
|
||||
list(APPEND DEFINITIONS_LIST HAS_AMAZON_S3=1)
|
||||
endif()
|
||||
list(APPEND PROJECT_LIBS Framework_Http)
|
||||
|
||||
if(NOT TARGET Framework_Sqlite)
|
||||
add_subdirectory(
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/../../Framework/build_cmake/FrameworkSqlite
|
||||
${CMAKE_CURRENT_BINARY_DIR}/FrameworkSqlite
|
||||
)
|
||||
endif()
|
||||
list(INSERT PROJECT_LIBS 0 Framework_Sqlite)
|
||||
|
||||
if(NOT TARGET CodeGen)
|
||||
add_subdirectory(
|
||||
@ -113,16 +114,6 @@ if(NOT (TARGET_PLATFORM_ANDROID OR TARGET_PLATFORM_IOS))
|
||||
endif()
|
||||
endif()
|
||||
|
||||
if(NOT TARGET nlohmann_json)
|
||||
set(JSON_BuildTests OFF CACHE BOOL "Disable test build")
|
||||
add_subdirectory(
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/../../Dependencies/build_cmake/nlohmann_json
|
||||
${CMAKE_CURRENT_BINARY_DIR}/nlohmann_json
|
||||
EXCLUDE_FROM_ALL
|
||||
)
|
||||
endif()
|
||||
list(APPEND PROJECT_LIBS nlohmann_json)
|
||||
|
||||
set(COMMON_SRC_FILES
|
||||
AppConfig.cpp
|
||||
AppConfig.h
|
||||
@ -390,8 +381,6 @@ set(COMMON_SRC_FILES
|
||||
PS2VM_Preferences.h
|
||||
psx/PsxBios.cpp
|
||||
psx/PsxBios.h
|
||||
s3stream/AmazonS3Client.cpp
|
||||
s3stream/S3ObjectStream.cpp
|
||||
saves/Icon.cpp
|
||||
saves/Icon.h
|
||||
saves/MaxSaveImporter.cpp
|
||||
@ -424,14 +413,9 @@ set(COMMON_SRC_FILES
|
||||
ScreenShotUtils.cpp
|
||||
ScreenShotUtils.h
|
||||
SifDefs.h
|
||||
ui_shared/BootablesDbClient.cpp
|
||||
ui_shared/BootablesDbClient.h
|
||||
ui_shared/BootablesProcesses.cpp
|
||||
ui_shared/BootablesProcesses.h
|
||||
ui_shared/TheGamesDbClient.cpp
|
||||
ui_shared/TheGamesDbClient.h
|
||||
VirtualPad.cpp
|
||||
VirtualPad.h
|
||||
${AMAZON_S3_SRC}
|
||||
)
|
||||
|
||||
if(TARGET_PLATFORM_WIN32)
|
||||
|
@ -6,7 +6,9 @@
|
||||
#include "CsoImageStream.h"
|
||||
#include "MdsDiscImage.h"
|
||||
#include "StdStream.h"
|
||||
#ifdef HAS_AMAZON_S3
|
||||
#include "s3stream/S3ObjectStream.h"
|
||||
#endif
|
||||
#ifdef _WIN32
|
||||
#include "VolumeStream.h"
|
||||
#else
|
||||
@ -24,6 +26,7 @@ static Framework::CStream* CreateImageStream(const boost::filesystem::path& imag
|
||||
auto imagePathString = imagePath.string();
|
||||
if(imagePathString.find("s3://") == 0)
|
||||
{
|
||||
#ifdef HAS_AMAZON_S3
|
||||
auto fullObjectPath = std::string(imagePathString.c_str() + 5);
|
||||
auto objectPathPos = fullObjectPath.find('/');
|
||||
if(objectPathPos == std::string::npos)
|
||||
@ -32,6 +35,9 @@ static Framework::CStream* CreateImageStream(const boost::filesystem::path& imag
|
||||
}
|
||||
auto bucketName = std::string(fullObjectPath.begin(), fullObjectPath.begin() + objectPathPos);
|
||||
return new CS3ObjectStream(bucketName.c_str(), fullObjectPath.c_str() + objectPathPos + 1);
|
||||
#else
|
||||
throw std::runtime_error("S3 support was disabled during build configuration.");
|
||||
#endif
|
||||
}
|
||||
#ifdef __ANDROID__
|
||||
return new Framework::CPosixFileStream(imagePathString.c_str(), O_RDONLY);
|
||||
|
@ -24,6 +24,14 @@ if(NOT TARGET gsh_opengl)
|
||||
endif()
|
||||
list(INSERT PROJECT_LIBS 0 gsh_opengl)
|
||||
|
||||
if(NOT TARGET ui_shared)
|
||||
add_subdirectory(
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/../ui_shared
|
||||
${CMAKE_CURRENT_BINARY_DIR}/ui_shared
|
||||
)
|
||||
endif()
|
||||
list(APPEND PROJECT_LIBS ui_shared)
|
||||
|
||||
set(ANDROID_SRC_FILES
|
||||
BootablesInterop.cpp
|
||||
com_virtualapplications_play_Bootable.cpp
|
||||
|
@ -48,6 +48,14 @@ if(NOT TARGET SDWebImage_Static)
|
||||
endif()
|
||||
list(APPEND PROJECT_LIBS SDWebImage_Static)
|
||||
|
||||
if(NOT TARGET ui_shared)
|
||||
add_subdirectory(
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/../ui_shared
|
||||
${CMAKE_CURRENT_BINARY_DIR}/ui_shared
|
||||
)
|
||||
endif()
|
||||
list(APPEND PROJECT_LIBS ui_shared)
|
||||
|
||||
find_library(UIKIT_LIBRARY NAMES UIKit)
|
||||
find_library(COREGRAPHICS_LIBRARY NAMES CoreGraphics)
|
||||
find_library(GAMECONTROLLER_LIBRARY NAMES GameController)
|
||||
|
@ -42,6 +42,14 @@ if(TARGET_PLATFORM_MACOS OR TARGET_PLATFORM_UNIX)
|
||||
list(APPEND PROJECT_LIBS sh_openal)
|
||||
endif()
|
||||
|
||||
if(NOT TARGET ui_shared)
|
||||
add_subdirectory(
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/../ui_shared
|
||||
${CMAKE_CURRENT_BINARY_DIR}/ui_shared
|
||||
)
|
||||
endif()
|
||||
list(APPEND PROJECT_LIBS ui_shared)
|
||||
|
||||
set(QT_SOURCES
|
||||
bootablelistdialog.cpp
|
||||
BootableModel.cpp
|
||||
|
47
Source/ui_shared/CMakeLists.txt
Normal file
47
Source/ui_shared/CMakeLists.txt
Normal file
@ -0,0 +1,47 @@
|
||||
cmake_minimum_required(VERSION 3.5)
|
||||
|
||||
set(CMAKE_MODULE_PATH
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/../../../Dependencies/cmake-modules
|
||||
${CMAKE_MODULE_PATH}
|
||||
)
|
||||
|
||||
project(ui_shared)
|
||||
|
||||
if(NOT TARGET Framework_Sqlite)
|
||||
add_subdirectory(
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/../../../Framework/build_cmake/FrameworkSqlite
|
||||
${CMAKE_CURRENT_BINARY_DIR}/FrameworkSqlite
|
||||
)
|
||||
endif()
|
||||
list(APPEND SHARED_UI_PROJECT_LIBS Framework_Sqlite)
|
||||
|
||||
if(NOT TARGET Framework_Http)
|
||||
add_subdirectory(
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/../../../Framework/build_cmake/FrameworkHttp
|
||||
${CMAKE_CURRENT_BINARY_DIR}/FrameworkHttp
|
||||
)
|
||||
endif()
|
||||
list(APPEND SHARED_UI_PROJECT_LIBS Framework_Http)
|
||||
|
||||
if(NOT TARGET nlohmann_json)
|
||||
set(JSON_BuildTests OFF CACHE BOOL "Disable test build")
|
||||
add_subdirectory(
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/../../../Dependencies/build_cmake/nlohmann_json
|
||||
${CMAKE_CURRENT_BINARY_DIR}/nlohmann_json
|
||||
EXCLUDE_FROM_ALL
|
||||
)
|
||||
endif()
|
||||
list(APPEND SHARED_UI_PROJECT_LIBS nlohmann_json)
|
||||
|
||||
set(SHARED_UI_SRC_FILES
|
||||
BootablesDbClient.cpp
|
||||
BootablesDbClient.h
|
||||
BootablesProcesses.cpp
|
||||
BootablesProcesses.h
|
||||
TheGamesDbClient.cpp
|
||||
TheGamesDbClient.h
|
||||
)
|
||||
|
||||
add_library(ui_shared STATIC ${SHARED_UI_SRC_FILES})
|
||||
target_link_libraries(ui_shared ${SHARED_UI_PROJECT_LIBS})
|
||||
target_include_directories(ui_shared PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/..)
|
Loading…
x
Reference in New Issue
Block a user