-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
90 changed files
with
6,596 additions
and
468 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,3 @@ | ||
[submodule "Submodules/vcpkg"] | ||
path = Submodules/vcpkg | ||
url = https://github.com/microsoft/vcpkg.git | ||
[submodule "Submodules/thorvg"] | ||
path = Submodules/thorvg | ||
url = https://github.com/thorvg/thorvg.git |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,47 +1,27 @@ | ||
cmake_minimum_required(VERSION 3.29) | ||
|
||
# toolchain | ||
set(EXTERN_PATH ${CMAKE_CURRENT_SOURCE_DIR}/Submodules) | ||
set(CMAKE_TOOLCHAIN_FILE ${EXTERN_PATH}/vcpkg/scripts/buildsystems/vcpkg.cmake CACHE PATH "vcpkg toolchain file") | ||
include(${EXTERN_PATH}/cmake/toolchain.cmake) | ||
|
||
project(ThorVGApp) | ||
set(VERSION_MAJOR "1") | ||
set(VERSION_MINOR "2") | ||
set(VERSION_ALTER "2") | ||
set(VERSION_BUILD "1") | ||
set(PACKAGE_NAME "ru.xitrix.Moonlight") | ||
set(PSN_VERSION "01.00") | ||
set(PROJECT_AUTHOR "XITRIX") | ||
set(PROJECT_ICON ${CMAKE_CURRENT_SOURCE_DIR}/resources/img/moonlight_icon.jpg) | ||
set(PROJECT_RESOURCES ${CMAKE_CURRENT_SOURCE_DIR}/resources) | ||
set(CMAKE_CXX_STANDARD 17) | ||
|
||
add_definitions( | ||
-DSK_TRIVIAL_ABI=[[clang::trivial_abi]] | ||
) | ||
|
||
|
||
add_subdirectory(${EXTERN_PATH}) | ||
add_subdirectory(${EXTERN_PATH}/UIKit) | ||
|
||
add_executable(${PROJECT_NAME} | ||
app/main.cpp | ||
) | ||
|
||
target_link_libraries(${PROJECT_NAME} PRIVATE | ||
target_link_libraries(${PROJECT_NAME} PUBLIC | ||
UIKit | ||
) | ||
|
||
if (APPLE) | ||
set_target_properties(${PROJECT_NAME} PROPERTIES | ||
MACOSX_BUNDLE TRUE | ||
MACOSX_BUNDLE_BUNDLE_NAME ${PROJECT_NAME} | ||
# MACOSX_BUNDLE_ICON_FILE "borealis.icns" | ||
MACOSX_BUNDLE_COPYRIGHT "Copyright 2024 ${PROJECT_AUTHOR}" | ||
# RESOURCE "${CMAKE_SOURCE_DIR}/app/borealis.icns" | ||
XCODE_ATTRIBUTE_ASSETCATALOG_COMPILER_APPICON_NAME "AppIcon" | ||
MACOSX_BUNDLE_GUI_IDENTIFIER "${PACKAGE_NAME}" | ||
MACOSX_BUNDLE_BUNDLE_VERSION "${VERSION_BUILD}" | ||
MACOSX_BUNDLE_SHORT_VERSION_STRING "${VERSION_MAJOR}.${VERSION_MINOR}.${VERSION_ALTER}" | ||
MACOSX_BUNDLE_LONG_VERSION_STRING "${VERSION_MAJOR}.${VERSION_MINOR}.${VERSION_ALTER}" | ||
XCODE_ATTRIBUTE_INFOPLIST_KEY_LSApplicationCategoryType "public.app-category.games" # Not work | ||
XCODE_ATTRIBUTE_INSTALL_PATH $(LOCAL_APPS_DIR) | ||
XCODE_EMBED_RESOURCES_CODE_SIGN_ON_COPY ON # Not work | ||
XCODE_EMBED_FRAMEWORKS_CODE_SIGN_ON_COPY ON # Not work | ||
XCODE_EMBED_FRAMEWORKS "${IOS_FRAMEWORKS}" | ||
INSTALL_RPATH "@executable_path/../Frameworks" | ||
XCODE_ATTRIBUTE_LD_RUNPATH_SEARCH_PATHS "@executable_path/../Frameworks" | ||
) | ||
|
||
target_link_libraries(${PROJECT_NAME} PRIVATE "-framework Foundation" "-framework VideoToolbox" "-framework AVKit" "-framework MetalKit") | ||
endif () | ||
setup_project() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,39 +1,62 @@ | ||
project(UIKit) | ||
|
||
find_package(SDL2 REQUIRED) | ||
|
||
add_definitions( | ||
-DSK_TRIVIAL_ABI=[[clang::trivial_abi]] | ||
) | ||
|
||
add_library(${PROJECT_NAME} | ||
# APPLE | ||
if (APPLE) | ||
list(APPEND platform_sources | ||
lib/platforms/apple/SkiaInit.mm | ||
) | ||
|
||
# MAC | ||
if (PLATFORM_DESKTOP) | ||
list(APPEND google_angle_libs | ||
${EXTERN_PATH}/angle/mac/libEGL.dylib | ||
${EXTERN_PATH}/angle/mac/libGLESv2.dylib | ||
) | ||
|
||
list(APPEND platform_libs | ||
${google_angle_libs} | ||
${EXTERN_PATH}/skia/out/mac-arm64-angle/libskia.a | ||
${EXTERN_PATH}/skia/out/mac-arm64-angle/libwindow.a | ||
) | ||
# IOS | ||
elseif (PLATFORM_IOS) | ||
list(APPEND FRAMEWORKS ${EXTERN_PATH}/angle/ios/MetalANGLE.framework) | ||
|
||
list(APPEND platform_libs | ||
${google_angle_libs} | ||
${EXTERN_PATH}/skia/out/ios-arm64-angle/libskia.a | ||
${EXTERN_PATH}/skia/out/ios-arm64-angle/libwindow.a | ||
) | ||
endif () | ||
|
||
set_property( | ||
SOURCE ${google_angle_libs} | ||
PROPERTY MACOSX_PACKAGE_LOCATION "Frameworks" | ||
) | ||
endif () | ||
|
||
add_library(UIKit | ||
lib/Application.cpp | ||
lib/platforms/mac/SkiaInit.mm | ||
${platform_sources} | ||
) | ||
|
||
target_include_directories(${PROJECT_NAME} PUBLIC | ||
target_include_directories(UIKit PUBLIC | ||
${EXTERN_PATH}/skia | ||
include | ||
lib | ||
) | ||
|
||
|
||
list(APPEND google_angle_libs | ||
${EXTERN_PATH}/angle/mac/libEGL.dylib | ||
${EXTERN_PATH}/angle/mac/libGLESv2.dylib | ||
) | ||
|
||
find_package(SDL2 REQUIRED) | ||
target_link_libraries(${PROJECT_NAME} PUBLIC | ||
${google_angle_libs} | ||
${EXTERN_PATH}/skia/out/mac-arm64-angle/libskia.a | ||
${EXTERN_PATH}/skia/out/mac-arm64-angle/libwindow.a | ||
target_link_libraries(UIKit PUBLIC | ||
${platform_libs} | ||
SDL2::SDL2 | ||
GLAD | ||
ThorVG | ||
) | ||
|
||
set_property( | ||
SOURCE ${google_angle_libs} | ||
PROPERTY MACOSX_PACKAGE_LOCATION "Frameworks" | ||
) | ||
if (APPLE) | ||
set_target_properties(${PROJECT_NAME} PROPERTIES | ||
XCODE_EMBED_FRAMEWORKS "${FRAMEWORKS}") | ||
endif () |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
#include "tools/window/WindowContext.h" | ||
|
||
#include <functional> | ||
#include <SDL.h> | ||
|
||
std::unique_ptr<skwindow::WindowContext> skiaMakeWindow(SDL_Window* window); | ||
|
||
bool platformRunLoop(const std::function<bool()>& runLoop); |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.