Skip to content

Commit

Permalink
Add google drive support
Browse files Browse the repository at this point in the history
  • Loading branch information
OFFTKP committed Dec 17, 2023
1 parent 62b06d2 commit 2da6992
Show file tree
Hide file tree
Showing 6,746 changed files with 1,705,428 additions and 128 deletions.
The diff you're trying to view is too large. We only load the first 3000 changed files.
4 changes: 4 additions & 0 deletions .github/workflows/deploy_web.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
name: Build Web & Deploy to GH
on: [push,pull_request]
permissions:
contents: write
pull-requests: write
issues: write
jobs:
build-and-deploy:
runs-on: ubuntu-latest
Expand Down
1 change: 0 additions & 1 deletion .github/workflows/deploy_win.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ jobs:
- name: Get latest CMake and ninja
# Using 'latest' branch, the most recent CMake and ninja are installed.
uses: lukka/get-cmake@latest

- name: Build 🔧
run: |
mkdir build
Expand Down
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -47,4 +47,4 @@ cmake-build-*/
.idea/
.gradle
.google
tools/android_project/app/release
tools/android_project/app/release
61 changes: 45 additions & 16 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@ else()
project(SkyEmu C CXX)
endif()


set(CMAKE_C_STANDARD 11)
set(CMAKE_CXX_STANDARD 11)
set(LINK_LIBS "")
Expand All @@ -23,8 +22,8 @@ set(LINK_LIBS "")
set(CMAKE_EXPORT_COMPILE_COMMANDS ON)

if (EMSCRIPTEN)
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -s ERROR_ON_UNDEFINED_SYMBOLS=0 -s ELIMINATE\_DUPLICATE\_FUNCTIONS=1 -s ENVIRONMENT=web -s ASSERTIONS=0 -s WASM=1 -DPLATFORM_WEB --shell-file ${PROJECT_SOURCE_DIR}/src/shell.html -s USE_CLOSURE_COMPILER=0 ")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -s ERROR_ON_UNDEFINED_SYMBOLS=0 -s ELIMINATE\_DUPLICATE\_FUNCTIONS=1 -s ENVIRONMENT=web -s ASSERTIONS=0 -s WASM=1 -DPLATFORM_WEB --shell-file ${PROJECT_SOURCE_DIR}/src/shell.html -s USE_CLOSURE_COMPILER=0 ")
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -s ERROR_ON_UNDEFINED_SYMBOLS=0 -s ELIMINATE\_DUPLICATE\_FUNCTIONS=1 -s ENVIRONMENT=web -s ASSERTIONS=0 -s WASM=1 -DSE_PLATFORM_WEB --shell-file ${PROJECT_SOURCE_DIR}/src/shell.html -s USE_CLOSURE_COMPILER=0 ")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -s ERROR_ON_UNDEFINED_SYMBOLS=0 -s ELIMINATE\_DUPLICATE\_FUNCTIONS=1 -s ENVIRONMENT=web -s ASSERTIONS=0 -s WASM=1 -DSE_PLATFORM_WEB --shell-file ${PROJECT_SOURCE_DIR}/src/shell.html -s USE_CLOSURE_COMPILER=0 ")
endif ()
if (MSVC)
# Perform extremely aggressive optimization on Release builds:
Expand Down Expand Up @@ -69,7 +68,7 @@ if(IOS)
endif()
if(WIN32)
message("Building for Windows")
add_definitions(-DPLATFORM_WINDOWS=1)
add_definitions(-DSE_PLATFORM_WINDOWS=1)
endif()
if(ANDROID)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS}")
Expand All @@ -86,19 +85,41 @@ if ((CMAKE_SYSTEM_NAME STREQUAL Linux) AND NOT EMSCRIPTEN AND NOT ANDROID)
set(THREADS_PREFER_PTHREAD_FLAG ON)
find_package(Threads REQUIRED)
find_package(ALSA REQUIRED)
set(PLATFORM_LINUX TRUE)
set(SE_PLATFORM_LINUX TRUE)
add_definitions(-DSE_PLATFORM_LINUX=1)
endif()
if (UNIX AND NOT APPLE AND NOT PLATFORM_LINUX AND NOT EMSCRIPTEN AND NOT ANDROID)
set(PLATFORM_FREEBSD TRUE)
if (UNIX AND NOT APPLE AND NOT SE_PLATFORM_LINUX AND NOT EMSCRIPTEN AND NOT ANDROID)
set(SE_PLATFORM_FREEBSD TRUE)
add_definitions(-DSE_PLATFORM_FREEBSD=1)
find_package(ALSA REQUIRED)
link_directories(/usr/local/lib)
endif()

if (PLATFORM_LINUX OR PLATFORM_FREEBSD)
if (SE_PLATFORM_LINUX OR SE_PLATFORM_FREEBSD)
find_package(X11 REQUIRED)
endif()

if(NOT EMSCRIPTEN)
set(WITH_APPS OFF) # don't build executable
add_subdirectory(src/openssl)

set(CURL_USE_LIBSSH2 OFF)
set(CURL_USE_LIBPSL OFF)
set(CURL_ENABLE_EXPORT_TARGET OFF)
set(BUILD_TESTING OFF)
set(BUILD_CURL_EXE OFF)
set(BUILD_SHARED_LIBS OFF)
set(BUILD_STATIC_LIBS ON)
if (WIN32)
set(CURL_STATIC_CRT ON)
endif()
# see "Important static libcurl usage note" in INSTALL.md
add_definitions(-DCURL_STATICLIB)
add_subdirectory(src/curl)
endif()

# TinyFileDialogs
if ((NOT IOS) AND (NOT EMSCRIPTEN) AND (NOT ANDROID) AND (NOT PLATFORM_LINUX) AND (NOT PLATFORM_FREEBSD))
if ((NOT IOS) AND (NOT EMSCRIPTEN) AND (NOT ANDROID) AND (NOT SE_PLATFORM_LINUX) AND (NOT SE_PLATFORM_FREEBSD))
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -DUSE_TINY_FILE_DIALOGS")
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -DUSE_TINY_FILE_DIALOGS")
add_library(tinyfd STATIC
Expand Down Expand Up @@ -157,8 +178,8 @@ endif()

if (EMSCRIPTEN)
set(CMAKE_EXECUTABLE_SUFFIX ".html") # This line is used to set your executable to build with the emscripten html template so taht you can directly open it.
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -sEXPORTED_FUNCTIONS=[_se_load_settings,_main] -sEXPORTED_RUNTIME_METHODS=ccall ")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -sEXPORTED_FUNCTIONS=[_se_load_settings,_main] -sEXPORTED_RUNTIME_METHODS=ccall ")
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -sEXPORTED_FUNCTIONS=[_se_load_settings,_se_login_cloud,_main,_malloc,_free,_em_oath_sign_in_callback,_em_https_request_callback_wrapper,_gsecret_web] -sEXPORTED_RUNTIME_METHODS=ccall")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -sEXPORTED_FUNCTIONS=[_se_load_settings,_se_login_cloud,_main,_malloc,_free,_em_oath_sign_in_callback,_em_https_request_callback_wrapper,_gsecret_web] -sEXPORTED_RUNTIME_METHODS=ccall")
endif ()

#=== LIBRARY: sokol
Expand All @@ -171,14 +192,14 @@ set(SOKOL_HEADERS
src/sokol/sokol_audio.h
src/sokol/sokol_glue.h)
if(ANDROID)
add_definitions(-DPLATFORM_ANDROID)
add_definitions(-DSE_PLATFORM_ANDROID)
set(LINK_LIBS ${LINK_LIBS} GLESv3 EGL OpenSLES log android)
message("Android Build!")
endif()
if(MACOS OR IOS)
add_library(sokol STATIC src/sokol/sokol.m ${SOKOL_HEADERS})
if(MACOS AND (NOT IOS))
add_definitions(-DPLATFORM_MACOS)
add_definitions(-DSE_PLATFORM_MACOS)
target_link_libraries(sokol PUBLIC
"-framework QuartzCore"
"-framework Cocoa"
Expand All @@ -198,7 +219,7 @@ if(MACOS OR IOS)
else()
add_library(sokol STATIC src/sokol/sokol.c ${SOKOL_HEADERS})
set_property(TARGET sokol PROPERTY MSVC_RUNTIME_LIBRARY "MultiThreaded")
if (PLATFORM_LINUX OR PLATFORM_FREEBSD)
if (SE_PLATFORM_LINUX OR SE_PLATFORM_FREEBSD)
target_include_directories(sokol PRIVATE "${X11_INCLUDE_DIR}")
target_link_libraries(sokol INTERFACE ${X11_X11_LIB} ${X11_Xi_LIB} ${X11_Xcursor_LIB} OpenGL::OpenGL dl)
endif()
Expand Down Expand Up @@ -256,13 +277,15 @@ add_definitions(-DGIT_COMMIT_HASH=\"${GIT_COMMIT_HASH}\")
add_definitions(-DGIT_BRANCH=\"${GIT_BRANCH}\")
add_definitions(-DGIT_TAG=\"${GIT_TAG}\")

set(SKYEMU_SRC src/main.c src/stb.c src/miniz.c src/res.c src/localization.c)
set(SKYEMU_SRC src/main.c src/stb.c src/miniz.c src/res.c src/localization.c src/mutex.cpp)

if(ENABLE_HTTP_CONTROL_SERVER)
add_definitions(-DENABLE_HTTP_CONTROL_SERVER=1)
set(SKYEMU_SRC ${SKYEMU_SRC} src/http_control_server.cpp)
endif()

set(SKYEMU_SRC ${SKYEMU_SRC} src/cloud.cpp)

if(UNICODE_GUI)
set(SKYEMU_SRC ${SKYEMU_SRC} src/utf8proc/utf8proc.c)
include_directories(src/utf8proc/)
Expand All @@ -277,7 +300,7 @@ endif()

if(IOS)
set(SKYEMU_SRC ${SKYEMU_SRC} src/ios_support.m)
add_definitions(-DPLATFORM_IOS)
add_definitions(-DSE_PLATFORM_IOS)
endif()

if(WIN32)
Expand Down Expand Up @@ -314,6 +337,12 @@ if (EMSCRIPTEN)
endif ()
set(LINK_LIBS ${LINK_LIBS} sokol ${ALSA_LIBRARIES})

if(NOT EMSCRIPTEN)
target_include_directories(${PROJECT_NAME} PRIVATE src/openssl/include)
target_include_directories(${PROJECT_NAME} PRIVATE src/curl/include)
set(LINK_LIBS ${LINK_LIBS} libcurl_static)
endif()

set(CAPSTONE_BUILD_TESTS OFF CACHE BOOL "Build capstone tests" FORCE)
set(CAPSTONE_BUILD_CSTOOL OFF CACHE BOOL "Build capstone cstool" FORCE)
set(CAPSTONE_BUILD_SHARED OFF CACHE BOOL "Build capstone shared library" FORCE)
Expand Down
Loading

0 comments on commit 2da6992

Please sign in to comment.